Quantcast

Caspa camera produces yellow images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Caspa camera produces yellow images

mjgreci
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Caspa camera produces yellow images

Chris Whittenburg

Your issue could be the same one I had.  

Below is an exchange I had with Laurent about it...  

Please let me know if this turns out to be the problem.

Thanks,
Chris


From: Laurent Pinchart <[hidden email]>
To: [hidden email]
Subject: Re: mt9v032 (caspa) and omap3isp
Date: Wed, 07 May 2014 12:39:44 +0200


Hi Chris,

Sorry for the late reply, I've been traveling and only came back home 
yesterday night.

On Thursday 01 May 2014 17:03:09 Chris Whittenburg wrote:
> Hi Laurent,
> 
> Sorry to bother you, but I thought you might know this off the top of your
> head since it involves both omap3isp and yavta.
> 
> We're using the mt9v032 on omap3, (using preview to convert to UYVY. [1].
> 
> The images have a yellow tint, like a bad white balance.  Funny thing is,
> the images are fine in yavta with raw2rgbpnm. [2]
> 
> Should I look at the private ioctl of the previewer?  Do you know if it is
> white balance or rgb conversion mapping?

It could be both :-) However the problem most comes from either RGB to YUV 
conversion or RGB to RGB blending, as the preview engine default white balance 
configuration is to apply a 1.0 gain to all components, while the RGB to YUB 
and RGB to RGB blending default matrices are set up for fluorescent light 
environment.

You can reset both matrices to neutral values using the 
VIDIOC_OMAP3ISP_PRV_CFG ioctl. A sample implementation is available as part of 
the omap3-isp-live application and library available at

	git://git.ideasonboard.org/omap3-isp-live.git

In particular, see the omap3_isp_preview_setup() function in 
http://git.ideasonboard.org/omap3-isp-live.git/blob/HEAD:/isp/controls.c. 
Please note that the code is licensed under the LGPL.

> [1]
> 
> media-ctl -r
> media-ctl -v -l '"mt9v032 3-005c":0->"OMAP3 ISP CCDC":0[1]'
> media-ctl -v -l '"OMAP3 ISP CCDC":2->"OMAP3 ISP preview":0[1]'
> media-ctl -v -l '"OMAP3 ISP preview":1->"OMAP3 ISP resizer":0[1]'
> media-ctl -v -l '"OMAP3 ISP resizer":1->"OMAP3 ISP resizer output":0[1]'
> 
> #Set the formats
> media-ctl -v -V '"mt9v032 3-005c":0[SGRBG10 752x480]'
> media-ctl -v -V '"OMAP3 ISP CCDC":2[SGRBG10 752x480]'
> media-ctl -v -V '"OMAP3 ISP preview":1[UYVY 752x480]'
> media-ctl -v -V '"OMAP3 ISP resizer":1[UYVY 752x480]'
> 
> [2]
> media-ctl -r
> media-ctl -v -l '"mt9v032 3-005c":0->"OMAP3 ISP CCDC":0[1]'
> media-ctl -v -l '"OMAP3 ISP CCDC":1->"OMAP3 ISP CCDC output":0[1]'
> media-ctl -v -V '"mt9v032 3-005c":0 [SGRBG10 752x480]'
> media-ctl -v -V '"OMAP3 ISP CCDC":1 [SGRBG10 752x480]'
> yavta -p -f SGRBG10 -s 752x480 -n 4 --capture=11 --skip=10 \
> $(media-ctl -e "OMAP3 ISP CCDC output") --file=img-vl.bin
> raw2rgbpnm -s 752x480 -f SGRBG10 img-vl.bin img-vl.pnm
-- 
Regards,

Laurent Pinchart


On Fri, Aug 26, 2016 at 11:30 AM, Greci, Matthew J <[hidden email]> wrote:

Hello,
 
I have an EarthSTORM COM with a Tobi expansion board. I have connected the Caspa camera via the 27-pin connector provided to the COM as instructed. I then run the two commands to link up the Caspa camera:

media-ctl -v -r -l '"mt9v032 3-005c":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 -v -V '"mt9v032 3-005c":0[SGRBG10 640x480], "OMAP3 ISP CCDC":2[SGRBG10 640x480], "OMAP3 ISP preview":1[UYVY 640x480], "OMAP3 ISP resizer":1[UYVY 640x480]'

I then can use the v4l2 library to read images from camera. I am using a variation to this sample program for v4l2: https://linuxtv.org/downloads/v4l-dvb-apis/capture-example.html
 
I am able to get images from the Caspa and the images are changing with time (I can see my hand waving), however I always get a yellow tint or hue to the images. I am also able to stream the caspa camera to a host machine using gstreamer. I understand this wiki says there will be a yellow tint: https://github.com/gumstix/yocto-manifest/wiki/Gstreamer-and-Caspa
 
So I attempted to call a ioctl() before grabbing images from the Caspa following these examples (https://linuxtv.org/downloads/v4l-dvb-apis/control.html), however querying the device (/dev/video6) says that no capabilities are available.

I have inserted this code in just before capturing has started. It should walk through every V4L2_CID_* and query the Caspa camera for this capability (such as brightness, hue, contrast, saturation,  do_white_balance, autowhite_balance, etc.) but all these return nothing. Also I do not get an error or early exit (still getting pass this function and obtaining a picture) so all queries result in errno being set to EINVAL which is "Invalid argument".

void check_caps(void) {
        memset(&queryctrl, 0, sizeof(queryctrl));

        for (queryctrl.id = V4L2_CID_BASE; queryctrl.id < V4L2_CID_LASTP1; queryctrl.id++) {
                if (0 == ioctl(fd, VIDIOC_QUERYCTRL, &queryctrl)) {
                        if (queryctrl.flags & V4L2_CTRL_FLAG_DISABLED)
                                continue;
                        printf("Control %s\n", queryctrl.name);
                } else { //query not supported
                        if (errno == EINVAL)
                                continue;
                        perror("VIDIOC_QUERYCTRL");
                        exit(EXIT_FAILURE);
                }
        }
}

Is there another way to adjust the yellow tint/hue?

Any help is appreciated.

 

Thank you,

Matthew Greci

<a href="tel:505-280-1921" value="+15052801921" target="_blank">505-280-1921

 


------------------------------------------------------------------------------

_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users



------------------------------------------------------------------------------

_______________________________________________
gumstix-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gumstix-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [EXTERNAL] Re: Caspa camera produces yellow images

mjgreci
CONTENTS DELETED
The author has deleted this message.
Loading...