hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Raspivid cropping in full FOV mode

Sun May 17, 2015 3:33 pm

Even in full FOV mode raspivid is cropping the image. The below image shows the left-most edge of the results from both raspistill and raspivid (I uniformly scaled the raspivid image for a better comparison to the higher resolution raspistill output). Notice how part of the "7" is cropped out of the raspivid output. The commands I used are below.

Code: Select all

raspivid -vf -hf -o myvid.h264 -w 1296 -h 972
raspistill -vf -hf -o picture.jpg
Attachments
bug.jpg
Raspistill vs Raspicam
bug.jpg (22.94 KiB) Viewed 2627 times

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

Re: Raspivid cropping in full FOV mode

Sun May 17, 2015 8:54 pm

Stills capture and raspivid 1296x972 will still be using different sensor modes. Stills always uses the full 5MPix unless you override it with -md N, and vid 1296x972 will use the binned mode.
The binned mode does seem to have a very minor offset (about four pixels) - I noted it back when the modes were released viewtopic.php?p=520132#p520078
For some reason there is about a 4 pixel offset in FOV between the binned and unbinned modes and we haven't been able to fathom out why as yet. We will keep looking into why, so please be patient.
Seeing as none of us now work for Broadcom, don't expect it to be fixed any time soon.

If you're that fussed, then force the mode that you want with -md.
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.

hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Re: Raspivid cropping in full FOV mode

Mon May 18, 2015 12:18 am

Thanks for the quick reply 6by9. I appreciate all the work you guys have done. It may seem like a small offset but it makes a big difference in 3D scanning applications that need to operate in stills mode and video mode (binned). I will look into implementing a workaround by padding and scaling the video output to match the result from the stills.

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

Re: Raspivid cropping in full FOV mode

Mon May 18, 2015 8:16 am

Force the mode then with -md 4. That way there should be zero offset as it uses the binned mode for stills and video.
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.

hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Re: Raspivid cropping in full FOV mode

Mon May 18, 2015 9:53 pm

If I specify -md 4 to raspistill won't it capture the image at 1296 x 972 and then scale it to 2592 x 1944? If so, this would result in spatial resolution of a 1.2 MP camera instead of 5 MP.

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

Re: Raspivid cropping in full FOV mode

Mon May 18, 2015 10:03 pm

hairu526 wrote:If I specify -md 4 to raspistill won't it capture the image at 1296 x 972 and then scale it to 2592 x 1944? If so, this would result in spatial resolution of a 1.2 MP camera instead of 5 MP.
Seeing as you'd posted two images where the numbers appeared to be the same size, then I assumed you were capturing at 1296x976 for both stills and video anyway.
Can you go the other way then and force it to mode 2 at 15fps?
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.

hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Re: Raspivid cropping in full FOV mode

Mon May 18, 2015 10:20 pm

I understand the confusion. I uniformly scaled the image in the attached image so that it would be easier to compare raspistill's output to raspivid's. I'm actually using the MMAL API directly and used raspistill and raspivid to reproduce this issue that I was seeing there. My application, FreeLSS https://github.com/hairu/freelss, can run in either video mode (fast) or stills mode (higher detail) but this cropping issue is causing problems when scanning in video mode. The frame rate will unfortunately be lower than before, but I think your suggestion to force mode 2 in video mode may work.

Thanks!

User avatar
jbeale
Posts: 3499
Joined: Tue Nov 22, 2011 11:51 pm
Contact: Website

Re: Raspivid cropping in full FOV mode

Tue May 19, 2015 5:22 am

The FreeLSS program sounds interesting, do you have a webpage with examples of the results? I played around with a laser-scanner program several years ago, http://forum.david-3d.com/viewtopic.php?t=183#p819 but I never got quite satisfying accuracy from it.

hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Re: Raspivid cropping in full FOV mode

Wed May 20, 2015 1:14 am

FreeLSS began as part of a personal laser scanner project but it really caught on, so I open sourced it and created a Kickstarter for the kits called ATLAS 3D. Everything runs directly on the Pi and the user interface is all via HTTP. I recently added WebGL support so that you can view the scans right in the browser as well.

This is the scanner.
Image

Here are some scans that I performed myself.
Image
Image
Image

Here is one done by another FreeLSS user and shows the software's WebGL capabilities.
Image

Some models created with FreeLSS
https://s3.amazonaws.com/freelss/dog.zip
https://s3.amazonaws.com/freelss/orc.zip
https://s3.amazonaws.com/freelss/skull.zip
https://s3.amazonaws.com/freelss/rock.zip

ATLAS 3D Kickstarter: https://www.kickstarter.com/projects/15 ... ild-yourse
FreeLSS Forum: http://www.soliforum.com/forum/29/atlas-3d-freelss/
FreeLSS Website: http://www.freelss.org

hairu526
Posts: 18
Joined: Thu Mar 06, 2014 1:12 am

Re: Raspivid cropping in full FOV mode

Sat Jun 13, 2015 12:52 pm

@6by9 Your suggestion to force the sensor mode worked great, thanks!

Return to “Camera board”