Yellow or green images on LI-5M03 / MT9P031

Hi everyone,

I’m running Ubuntu 12.10 on my BeagleBoard xM Rev C. I have the LI-5M03 imageing device from Leopard Imaging with Aptina’s MT9P031 sensor. I am able to take pictures at a fairly low framerate, which is fine. The issue is that the images have a heavy yellow/green tint, or even purple, in a seemingly random fashion.

I installed Ubuntu following this post.

Here’s the code for capturing images. I’ve modified it slightly from the scripts available at Robert C Nelson’s GitHub:
https://github.com/RobertCNelson/tools/blob/master/pkgs/aptina-media-ctl-n-yavta.sh
https://github.com/RobertCNelson/tools/blob/master/pkgs/aptina-test-capture.sh

`
media-ctl -r -l ‘“mt9p031 2-0048”:0->“OMAP3 ISP CCDC”:0[1], “OMAP3 ISP CCDC”:2->“OMAP3 ISP preview”:0[1], “OMAP3 ISP preview”:1->“OMAP3 ISP resizer”:0[1], “OMAP3 ISP resizer”:1->“OMAP3 ISP resizer output”:0[1]’

media-ctl -f ‘“mt9p031 2-0048”:0 [SGRBG12 2592x1944], “OMAP3 ISP CCDC”:2 [SGRBG12 2592x1944], “OMAP3 ISP preview”:1 [UYVY 1024x768], “OMAP3 ISP resizer”:1 [UYVY 1024x768]’

yavta -f UYVY -s 1024x768 --capture=1 --file=/var/images/img.uyvy /dev/video6

convert -size 1024x768 /var/images/img.uyvy /var/images/img.jpg
`

I’ve seen similar issues been posted before, but I don’t know if anyone has ever solved it. I’ve made a very temporary and not very good fix by converting the image to Grayscale in image magick. So the last line would look something like this:

convert -size 1024x768 -type Grayscale /var/images/img.uyvy /var/images/img.jpg

However, this is obviously not the best option, and it seriously slowed down the framerate.

Have you tried capturing more than one image at a time? I've found that many of these
digital sensors only start providing properly colored images after a few have gone by.

Hi Gary, thank you for your reply. I’ve captured up to 200 images consecutively, and that gave the same yellow or greenish result. Is that enough, or do you think I should capture even more images?

By the way, I’ve also tried Angstrom distribution before, same result.

Best regards,
Carl

Hi Gary, thank you for your reply. I've captured up to 200 images consecutively, and that gave the same yellow or greenish result. Is that enough, or do you think I should capture
even more images?

No, you must have something else wrong. My experience is that it will
clear up within just a few frames.

What version of the driver(s) software are you using? Have you asked about
this on the linux-media list? There are a number of folks on that list that
know about exactly this set up.

I’ve seen similar issues been posted before, but I don’t know if anyone has ever solved it. I’ve made a very temporary and not very good fix by converting the image to Grayscale in image magick. So the last line would look something like this:

convert -size 1024x768 -type Grayscale /var/images/img.uyvy /var/images/img.jpg

However, this is obviously not the best option, and it seriously slowed down the framerate.

Hi Carl,
how “strong” is the taint? Are the colors completely wrong or just not right adjusted? I am asking because the default settings gives you a fairly green-tainted image. You have to adjust the colors either on the sensor or in the previewer. Look at the code of Laurent’s omap3-isp-live (especially controls.c):
http://git.ideasonboard.org/omap3-isp-live.git/blob/HEAD:/isp/controls.c

Yavta does not adjust the colors automagically. You could play with yavta -w while another yavta instance is running to adjust the global gain.
In the actual mt9p031-driver there are no seperate gains for the colors available (just a global gain). I had to adapt the driver myself.

However, there seems to be an issue with colors (at least in my setup). Look at the actual discussion in linux-media (I have posted another mail, that does not show up yet):
http://thread.gmane.org/gmane.linux.drivers.video-input-infrastructure/64486

Greetings,
flo