[libcamera-devel] qcam display scale bug
hermann at stamm-wilbrandt.de
hermann at stamm-wilbrandt.de
Tue Jul 7 09:02:04 CEST 2020
Hi Laurent,
> I assume you're using the new HQ camera, right ?
>
yes, but from looking into the code that should not make a difference.
> I'd like to clarify this first, to make sure I understand the problem
> correctly. Do you mean that qcam display a captured frame of 800x472
> pixels in a 800x600 screen region, scaling it in a way that doesn't
> preserve square pixels ? Do you just start the qcam application without
> passing it any parameter or resizing the window, or do you perform any
> specific operation ?
>
Yes, I am calling qcam without parameters.
qcam application requests 800x600 frames (see "size"):
libcamera/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
case StreamRole::Viewfinder:
fmts =
data->isp_[Isp::Output0].dev()->formats();
pixelFormat = formats::ARGB8888;
size = { 800, 600 };
bufferCount = 4;
outCount++;
break;
libcamera determines "2028x1520 pbCC" as best fit per log output.
The 2028x1520 frames captured get scaled into the display frame.
If the display frame would be 800x600 as requested, all would be fine.
But display frame being 800x472 compresses captured frame vertically
by factor 600/472=1.27.
I verified that by picture of micrometer:
https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=278268&p=1690839#p1690839
The longest divisions are of length 300µm vertically, but show only
221px in display. Horizontally I measured 281px for 300µm.
I just see that the 800x600 is specified in raspberrypi.cpp.
Can you please start qcam on some non-Raspberry system passing width=800
and height=600, and then take screenshot and use image processing (I use
gimp) to measure size of displayed frame?
On 2020-07-07 01:30, Laurent Pinchart wrote:
> Hi Hermann,
>
> (CC'ing Naush)
>
> On Sun, Jul 05, 2020 at 09:44:15PM +0200, hermann at stamm-wilbrandt.de
> wrote:
>> I started working with libcamera on Raspberry Pi.
>
> Thank you for your interest in the project :-)
>
>> I cannot tell whether this scale bug exists for raspberrypi only, or
>> in
>> general.
>>
>> qcam app requests a 800x600 window, but displayed window is 800x472
>> only.
>> This is not acceptable when using qcam as microscope app:
>> https://www.raspberrypi.org/forums/viewtopic.php?f=43&t=278268&p=1690839#p1690839
>
> I assume you're using the new HQ camera, right ?
>
>> The best mode selected by libcamera is 2028x1520 which is 4:3.
>> So 800x600 (also 4:3) is needed for display.
>>
>> It would be helpful to know whether qcam display is also 800x472
>> instead
>> of 800x600 when not running on Rasberry Pi.
>
> I'd like to clarify this first, to make sure I understand the problem
> correctly. Do you mean that qcam display a captured frame of 800x472
> pixels in a 800x600 screen region, scaling it in a way that doesn't
> preserve square pixels ? Do you just start the qcam application without
> passing it any parameter or resizing the window, or do you perform any
> specific operation ?
More information about the libcamera-devel
mailing list