You're looking at V1.10 of those docs. V1.11 included the V2 camera modes. It's now up to
V1.13, or you can view
latest which also includes a load more information on what is actually going on under the bonnet.
Please remember that mode 2 does limit you to 15fps.
jpers wrote:4. important To get proper crop-out, you have to take into the account sensor aspect ratio and explicitly specify -w and -h! The ROI is essentially digital zoom, without this your ROI will be resized to full sensor size, and aspect size will be wrong.
5. Therefore, if you want to crop 1280x720 ROI starting at pixels 100,200 with sensor mode 2 (2592x1944 with 4:3 aspect ratio) you calculate ROI parameters as follows: xmin=100/2592, ymin=200/1944, width=1280/2592, height=720/1944 and you will use -w 1280 -h 720. Now your output image will have correct dimensions and aspect ratio.
I haven't done exhaustive tests there, but quick tests and my recollection of the setup is that the crop to match the output aspect ratio is done first, and then the roi is applied. That means if you ask for -w 1280 -h 720 (or any aspect ratio different to the sensor mode), the input image of 2592x1944 has 729 lines cropped off top and bottom to give 2592x1458. You can't get an image of those cropped lines regardless of how you set roi.
That being done, then the roi range of 0-1 is always with regard the aspect ratio corrected image and not the full FOV.
Doing the same as your example but asking for a 32:9 image of 1280x360 would give an roi with w/h 0.494 and 0.185. Doing that I get an image stretched vertically. 0.494,0.494 gives an undistorted image.
I did try your numbers of 0.494 and 0.370 but couldn't convince myself whether it was right or wrong hence using an even wider aspect ratio.
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.