josephchrzempiec
Posts: 238
Joined: Tue Jun 21, 2016 7:56 am

My camera view size.

Tue Jun 22, 2021 12:16 am

hello I have one of these Arducam comes with a CS Mount Lens for Pi 4, 3, 3B+, 5MP OV5647 1080P. I only need to to see small stuff I'm looking at on a large 24 inch monitor. The problem is The camera viewing showing on the monitor is not full screen. In height it goes full it looks full but not in width. How can i make the viewing Full screen hight and width?


Joseph

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11499
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: My camera view size.

Tue Jun 22, 2021 7:46 am

What software are you using?

The sensor has a 4:3 aspect ratio. Most monitors have a 16:9 widescreen aspect ratio.
You need to specify that you want the preview to have a 16:9 aspect ratio (eg 1920x1080), and then the system will chop a strip off both the top and bottom of the sensor images to produce 16:9 images.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

josephchrzempiec
Posts: 238
Joined: Tue Jun 21, 2016 7:56 am

Re: My camera view size.

Fri Jul 02, 2021 2:43 am

Hello 6by9. I'm using a 24 inch Monitor. Everything looks good. However when trying to video the camera i'm seeing a square box image. I would love to see a full wide camera. I'm using a arducam csmera using the flex camera it is a 5mp camera with a cs lens on it. Basically I'm tring to set it up as a digital microscope to see small things including chips soldering and traces. I'm 42 years old and my eyes are not so good anymore and I have to go back to wearing glasses again :(

So basically I do not know the command to make the camera fullscreen.


Joseph

aBUGSworstnightmare
Posts: 3231
Joined: Tue Jun 30, 2015 1:35 pm

Re: My camera view size.

Sun Jul 04, 2021 6:53 am

Documentation is here https://www.raspberrypi.org/documentati ... /camera.md

That should be a OV5647 camera, so add the -md parameter and test which resolution setting you prefer. Then mix-in other parameters like preview window size, brightness, etc.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11499
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: My camera view size.

Sun Jul 04, 2021 7:43 am

-md is wrong as it forces the mode from the sensor, nothing to do with output resolution.

"raspivid - t 0" defaults to a 16:9 preview. Raspistill defaults to 4:3.
The display window for both can be changed with - p.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

josephchrzempiec
Posts: 238
Joined: Tue Jun 21, 2016 7:56 am

Re: My camera view size.

Sun Jul 04, 2021 7:46 am

Hello, if i put raspivid - t 0 would that record or give me a live view? I'm not looking to take images or videos. I'm just trying to get a live view only.


Joseph

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11499
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: My camera view size.

Sun Jul 04, 2021 12:04 pm

josephchrzempiec wrote:
Sun Jul 04, 2021 7:46 am
Hello, if i put raspivid - t 0 would that record or give me a live view? I'm not looking to take images or videos. I'm just trying to get a live view only.
Just a live view. Resolution will be the same as would be recorded if you added a -o filename option, so can be set via -w and -h.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

josephchrzempiec
Posts: 238
Joined: Tue Jun 21, 2016 7:56 am

Re: My camera view size.

Sun Jul 04, 2021 12:59 pm

Thank you very much.


Joseph

aBUGSworstnightmare
Posts: 3231
Joined: Tue Jun 30, 2015 1:35 pm

Re: My camera view size.

Sun Jul 04, 2021 1:56 pm

6by9 wrote:
Sun Jul 04, 2021 7:43 am
-md is wrong as it forces the mode from the sensor, nothing to do with output resolution.

"raspivid - t 0" defaults to a 16:9 preview. Raspistill defaults to 4:3.
The display window for both can be changed with - p.
but doens't it impact on the preview as well? As target use case is a microscope a preview window is all that is needed, changing the FOV via 'mode' is a option here from my personal POV.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11499
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: My camera view size.

Sun Jul 04, 2021 2:09 pm

-md will choose the mode off the sensor. If the aspect ratio of that mode doesn't match the requested output mode then the image produced will be cropped from it in the isp.

Eg requesting an output resolution of 800x600 (4:3) from mode 5 (binned 16:9 1292x730) will result in 1292x730 being cropped to 973x730 (4:3) to match the output aspect ratio, and then resized in the isp to 800x600. That 4:3 aspect ratio output image will still not fill a 16:9 display.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aBUGSworstnightmare
Posts: 3231
Joined: Tue Jun 30, 2015 1:35 pm

Re: My camera view size.

Sun Jul 04, 2021 2:17 pm

6by9 wrote:
Sun Jul 04, 2021 2:09 pm
-md will choose the mode off the sensor. If the aspect ratio of that mode doesn't match the requested output mode then the image produced will be cropped from it in the isp.

Eg requesting an output resolution of 800x600 (4:3) from mode 5 (binned 16:9 1292x730) will result in 1292x730 being cropped to 973x730 (4:3) to match the output aspect ratio, and then resized in the isp to 800x600. That 4:3 aspect ratio output image will still not fill a 16:9 display.
so is it better to specify an AOI (area of interrest) instead? At least with my 300x (max magnifition) I'm not able to use the full sensor; that's why I use the 'trick' for changing the mode to get a different crop/resize --> FOV changes without needing to change the optics focus.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 11499
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: My camera view size.

Sun Jul 04, 2021 3:10 pm

aBUGSworstnightmare wrote:
Sun Jul 04, 2021 2:17 pm
so is it better to specify an AOI (area of interrest) instead? At least with my 300x (max magnifition) I'm not able to use the full sensor; that's why I use the 'trick' for changing the mode to get a different crop/resize --> FOV changes without needing to change the optics focus.
Yes you can use -roi to crop the default image modes as you wish and then resize them to the desired output resolution.

But that's not the OP's original issue:
. The problem is The camera viewing showing on the monitor is not full screen. In height it goes full it looks full but not in width.
ie the display is leaving black bars either side of a 4:3 image to put it onto a 16:9 screen.
Using -md with raspistill will still leave the preview as a 4:3 image, so it'll have black bars to the left and right.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

aBUGSworstnightmare
Posts: 3231
Joined: Tue Jun 30, 2015 1:35 pm

Re: My camera view size.

Sun Jul 04, 2021 3:23 pm

Thanks 6by9!

Anyhow, to visualize what I was talking about - and how I typically use the scope with least effort in fiddling with parameters - let me show some examples.

Code: Select all

raspistill -t 0 -md 1 -hf -vf -p 0,30,640,450 -k -o my_pics%02d.jpg
results in
IMG_20210704_170655.jpg
IMG_20210704_170655.jpg (104.94 KiB) Viewed 318 times

Code: Select all

raspistill -t 0 -md 2 -hf -vf -p 0,30,640,450 -k -o my_pics%02d.jpg
results in
IMG_20210704_170626.jpg
IMG_20210704_170626.jpg (126.16 KiB) Viewed 318 times
Focusing on the small D on top of the 1 Pfennig coin
IMG_20210704_170441.jpg
IMG_20210704_170441.jpg (107.86 KiB) Viewed 318 times
As my screen resolution is 4:3 a 16:9 mode gives a different FOV, comparable to a slight zoom-in, which might help if refocusing is not preferred.

P.S. my LED lights on the optics are not switched on --> that's why the preview colors are all but 'golden'. Specifiying a preview window size allows easy access to the task bar items (i.e. for closing terminal).
Last edited by aBUGSworstnightmare on Sun Jul 04, 2021 3:32 pm, edited 1 time in total.

aBUGSworstnightmare
Posts: 3231
Joined: Tue Jun 30, 2015 1:35 pm

Re: My camera view size.

Sun Jul 04, 2021 3:27 pm

and the 'DUT' jig, this time with a changed lens position/magnifition
IMG_20210704_170437.jpg
IMG_20210704_170437.jpg (180.27 KiB) Viewed 314 times
As I also use this for soldering and/or solder joint inspection a big distance between lens and DUT is what I'm aiming for.
The Pi+display unit will get mounted to the black stud above it once everything is finished. Still need to integrate the WiFi controllable LED driver then the whole setup is battery powered.

josephchrzempiec
Posts: 238
Joined: Tue Jun 21, 2016 7:56 am

Re: My camera view size.

Wed Aug 04, 2021 11:18 pm

Hello all, thank you very much for the help. I was able to get things fixed on the screen and keep it open forever on the screen.


Joseph

Return to “Camera board”