[libcamera-devel] Fixing debayering?

Rafael Diniz rafael at riseup.net
Wed Jul 6 19:02:32 CEST 2022


Hi Jacopo

qcam -r gles --stream pixelformat=YUYV

Gives me completely surreal images (not only with small artifacts).

O patched sun6i, and I can say libcamera seems to be getting just its 
default settings:

        /* Setup default format */
        fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
        fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_SBGGR8;
        fmt.fmt.pix.width = 1280;
        fmt.fmt.pix.height = 720;
        fmt.fmt.pix.field = V4L2_FIELD_NONE;
        fmt.fmt.pix.sizeimage = fmt.fmt.pix.width * fmt.fmt.pix.height;
        fmt.fmt.pix.colorspace = V4L2_COLORSPACE_RAW;
        fmt.fmt.pix.ycbcr_enc = V4L2_YCBCR_ENC_DEFAULT;
        fmt.fmt.pix.quantization = V4L2_QUANTIZATION_DEFAULT;
        fmt.fmt.pix.xfer_func = V4L2_XFER_FUNC_DEFAULT;
        video->fmt = fmt;


Of course there could be a problem in sun6i... but it does not seem the 
libcamera does not set a different capture format than the driver default.

Rafael

On 7/6/22 09:34, Jacopo Mondi wrote:
> Hi Rafael,
> 
> On Wed, Jul 06, 2022 at 02:29:56PM +0300, Rafael Diniz wrote:
>> Hi Jacopo,
>>
>> I'm using SBGGR8 in qcam just because it is the only format it works.
>>
>> I always get
>> Stream configuration adjusted to  XXXXxYYYY-SBGGR8
> 
> No matter how you configure the streams ? I mean with --stream
> pixelformat=YUYV, in example passed, to qcam. I'm actually not sure what
> formats the sun6i receiver supports, you might need to check what is
> the intersection between the sensor produced formats and the ones
> accepted by the receiver.
> 
> Thanks
>     j
>>
>>
>> Rafael
>>
>> On 7/6/22 07:05, Jacopo Mondi wrote:
>>> I let people with more exerience about qcam reply about the debayering
>>> thing, but I wonder one thing: you've been experimenting with RAW
>>> formats, are you doing so becaue you need RAW ? Because if you're
>>> "just" trying to see how to provide a preview I would really switch to
>>> YUV/RGB. The pinephone doesn't have any ISP, debayering is then
>>> delegated to either the CPU or the GPU.
>>>
>>> Your sensor (the ov5640 at least) supports YUV/RGB natively, and the
>>> simple pipeline handler allows you to capture those formats.
>>>
>>> On Wed, Jul 06, 2022 at 12:26:29PM +0300, Rafael Diniz via libcamera-devel wrote:
>>>> Hi all,
>>>>
>>>> The last annoying bug I can find in using qcam on the Pinephone (at least on
>>>> lower resolutions, as high resolutions are still borked) is the debayering
>>>> from SBGGR8, which is clearly producing artifacts. Where can I find its
>>>> implementation? I plan to read it and compare to the canonical one and see
>>>> what could be wrong.
>>>>
>>>> Best regards,
>>>> Rafael Diniz
>>>>
>>>
>>>
>>>
> 
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220706/fe98e1dd/attachment.sig>


More information about the libcamera-devel mailing list