Re: [PATCH] v4l: mt9v032: Fix Bayer pattern

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Jul 16, 2011 at 11:40:23PM +0200, Guennadi Liakhovetski wrote:
> On Sat, 16 Jul 2011, Laurent Pinchart wrote:
> 
> > Hi Guennadi,
> > 
> > On Saturday 16 July 2011 01:11:28 Guennadi Liakhovetski wrote:
> > > On Fri, 15 Jul 2011, Laurent Pinchart wrote:
> > > > Compute crop rectangle boundaries to ensure a GRBG Bayer pattern.
> > > > 
> > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
> > > > ---
> > > > 
> > > >  drivers/media/video/mt9v032.c |   20 ++++++++++----------
> > > >  1 files changed, 10 insertions(+), 10 deletions(-)
> > > > 
> > > > If there's no comment I'll send a pull request for this patch in a couple
> > > > of days.
> > > 
> > > Hm, I might have a comment: why?... Isn't it natural to accept the fact,
> > > that different sensors put a different Bayer pixel at their sensor matrix
> > > origin? Isn't that why we have all possible Bayer formats? Maybe you just
> > > have to choose a different output format?
> > 
> > That's the other solution. The driver currently claims the device outputs 
> > SGRBG, but configures it to output SGBGR. This is clearly a bug. Is it better 
> > to modify the format than the crop rectangle location ?

I would definitely crop the rectangle location than change the
v4l2_mbus_framefmt.code; cropping should have no such side effects.

If the user wants a different format, (s)he will use VIDIOC_SUBDEV_S_FMT
ioctl to change it. Otherwise much of the pipeline configuration would
require changes to it.

What might still be important would be that the size of the image would not
change as a result of adjusting due to the colour pattern. That should be
avoided if possible, as alignment requirements exist and the user may well
have requested a size which fits to the requirements of other blocks in the
pipeline.

> Actually, it is interesting. I just looked (again) in the mt9v032 and some 
> other Aptina Bayer sensor datasheets, and they actually have _odd_ numbers 
> of rows and columns. So, mt9v032 actually has 753x481 active pixels. And 
> that extra pixel is explicitly provided to adjust the origin colour. Ok, 
> they write, it is for uniformity with the mirrored image, but who believes 
> them?;-) So, maybe you should adjust your max values to the above ones, 
> then taking one pixel out of your image will not reduce your useful image 
> size.

Some sensors I've seen are only able to produce just one colour pattern,
even when using cropping.

-- 
Sakari Ailus
sakari.ailus@xxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux