User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

ROI bug or expected behaviour

Sun Jun 22, 2014 7:03 pm

Code: Select all

/opt/vc/bin/raspivid -o vid.h264 -w 640 -h 480 -t 2000 --roi 0.5,0.0,1.0,1.0
1.jpg
1.jpg (29.68 KiB) Viewed 1108 times
There's a white line in the right edge.

PD: I don't understand how the parameter it's supposed to work. 0.5,0.0,1.0,1.0 from my understanding should be the same as 0.5,0.0,0.5,0.5 if we want to maintain the aspect ratio, that is, the upper right corner.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27452
Joined: Sat Jul 30, 2011 7:41 pm

Re: ROI bug or expected behaviour

Sun Jun 22, 2014 9:18 pm

It's a normalised coordinate system. Assume 1.0 is full frame width, so 0.25 would be half a frame width.

So 0.5,0.5,1.0,1.0 is actually a full frame starting at the middle of the frame, which will actually be clipped to the frame edge, so is the same as 0.5,0.5,0.5,0.5

Done like this so when you change frame size the ROI parameters don't need to be adjust to get the same result.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

User avatar
gagle
Posts: 82
Joined: Fri Feb 14, 2014 6:54 pm
Contact: Website

Re: ROI bug or expected behaviour

Mon Jun 23, 2014 7:01 am

And the white edge? It is something about the rounding up to the nearest multiple of 32? 640*0.5 = 320, multiple of 32, so... :?:

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 27452
Joined: Sat Jul 30, 2011 7:41 pm

Re: ROI bug or expected behaviour

Mon Jun 23, 2014 7:54 am

gagle wrote:And the white edge? It is something about the rounding up to the nearest multiple of 32? 640*0.5 = 320, multiple of 32, so... :?:
No idea. Maybe.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

Return to “Camera board”