Calculate final sensor crop from MLV video data (in crop mode)

Started by cedricp, November 16, 2021, 09:52:31 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

cedricp

Hi,

I'm writing a little application to play with my EOS-M footages and I need to calculate the final crop sensor (if crop rec is enabled), the goal is to give the correct information to the LensFun library to do lens undistortion and exposition correction. I tried to find a way with pixel binning params, but not sure how to handle it properly.

Thank you

Walter Schulz

I think you should be able to extract this data from footage itself.

cedricp

Yes, I get the sensor crop factor (1.62 on EOS-M) via (mlv_oject*)->RAWC.sensor_crop, what I'd like to get is the crop factor when the captured image data doesn't fill the entire sensor (in crop mode)

Walter Schulz

That is not what I meant. Footage contains resolution and you should be able to retrieve that information from footage file itself.

cedricp

Oh, yes, there is a lot of information, but I don't exactly know how to do the calculus with pixel binning/skipping values...

cedricp

Here's what I found so far, but seems wrong (or miss parameter(s)) :
sensor_res_x / (sampling_x * raw_res_x) * sensor_crop
where sampling_x = binning_x + skipping_x

example : on EOS-M raw video 1800x754 with 3x3 sampling (3x1 binning) gives a crop factor of 1.56 (!!)

2blackbar

man, nobody told you but its not a constant precise crop formula, its total manual adjustment of what acmera lets us record and card speed factor.
Sometimes you chop off pixels from crop modes to get more recording time.
its a hack, if we will somehow get even more speed from cards, the crop will get more pixels and field of view will be bigger, with slow sd cards crop gets smaller part of full resolution image.
easiest thing you can do, compare full resolution photo size to raw mlv resolutions.
but remember that crop modes are not centered super precisely into the middle of the sensor
your math does not apply, you can divide full res photo by 3 , and even then some pixels can get discarded depending on what ml coders choose.

cedricp

Tough ! Thank you for the reply. I'll do manual correction.