Webcam problem

This is where you talk about the EV3 hardware related topics such as the brick, sensors, LEGO pieces, etc.

Moderators: roger, gloomyandy, skoehler

User avatar
gloomyandy
leJOS Team Member
Posts: 5875
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Webcam problem

Postby gloomyandy » Fri Feb 27, 2015 7:54 pm

Great news, thanks for the update!

Snowman
New User
Posts: 13
Joined: Mon Mar 16, 2015 12:01 pm
Location: ru

Re: Webcam problem

Postby Snowman » Sun Sep 06, 2015 2:00 pm

Hello!

I have some question concerning class YUYVImage.

Our goal is a linefollower over dotted lines. To solve the problem we have used the web cam and look at the frame to find a right route.

We follows the definitions like

https://lejosnews.wordpress.com/2014/09 ... m-support/

The method

img.getY(x,y)

returns a negative value sometimes. But the Y-component is

Y = 0.299 * Red + 0.587 * Green + 0.114 * Blue

therefore it should be positive. Does it not?

User avatar
gloomyandy
leJOS Team Member
Posts: 5875
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Webcam problem

Postby gloomyandy » Sun Sep 06, 2015 2:18 pm

The image is stored in a byte array (which is signed), this means that values over 127 will get returned as a negative value, when I get chance I will fix it but for now just mask out the the upper bits by anding the result with 0xff.
leJOS news https://lejosnews.wordpress.com/

Snowman
New User
Posts: 13
Joined: Mon Mar 16, 2015 12:01 pm
Location: ru

Re: Webcam problem

Postby Snowman » Sun Sep 06, 2015 3:05 pm

Gloomyandy, thanks a lot!

Snowman
New User
Posts: 13
Joined: Mon Mar 16, 2015 12:01 pm
Location: ru

Re: Webcam problem

Postby Snowman » Mon Jun 12, 2017 9:06 am

Hello!

Our team is going to participate in SLAM competition. Now we have a problem with our webcam Logitech C-310. It has automatic white balance and automatic compensation of dark areas. These features make a color detection complicated in short distances. When one color fills the whole picture the cam changes these settings and the color becomes gray.

We can turn off these features by using, for example, guvcview in Linux. But this does not disables these setting permanently. When we reconnect the webcam it restores the default settings.

The question is how to disable the automatic white balance and compensation of dark areas by using LeJOS.

User avatar
gloomyandy
leJOS Team Member
Posts: 5875
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Webcam problem

Postby gloomyandy » Mon Jun 12, 2017 12:14 pm

You may be able to do this from the command line (or by issuing a linux command from your Java program) using the v4l-ctl program that is included with leJOS. See:
http://www.techytalk.info/webcam-settin ... ystem-cli/
It may also be possible to do this from openCV but it is not something I've ever tried to do. You may find that if you disable these features then changes in the lighting will have a big impact on what you are trying to do. I've found it is often easier to try and control the environment and use standard lighting for the test area.

Can you provide details of the SLAM competition? It sounds interesting...
leJOS news https://lejosnews.wordpress.com/

Snowman
New User
Posts: 13
Joined: Mon Mar 16, 2015 12:01 pm
Location: ru

Re: Webcam problem

Postby Snowman » Mon Jun 12, 2017 1:38 pm

Gloomyandy,
thank you for quick replay.

We will try to follow you suggestions. The organizers usually attempt to stabilize the light conditions during the competition but no one is secured if the sun light will appear in the polygon.

The competition is one of branch of Russian Robot Olympiad. The link is below:

http://robolymp.ru/season-2017/rules-an ... v-g-spirs/

Google translate:
https://translate.google.com/translate? ... g-spirs%2F

with best regards.

User avatar
gloomyandy
leJOS Team Member
Posts: 5875
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Webcam problem

Postby gloomyandy » Mon Jun 12, 2017 4:12 pm

Thanks for the links, it looks like an interesting competition! Would love to see a video of people competing if there is one.
leJOS news https://lejosnews.wordpress.com/


Return to “EV3 Hardware”

Who is online

Users browsing this forum: No registered users and 1 guest