Fast, reliable focus for cameras

I'm doing real-time step-by-step analysis of the video stream in iOS.

I need to assign a rating for each frame, as in focus. The method should be very fast for calculating on a mobile device and should be sufficiently reliable.

I tried simple things like summing after using the edge detector, but were not impressed with the results. I also tried using the focus estimates presented in the frame metadata dictionary, but they are significantly affected by the brightness of the image and much more on the device.

What are good ways to calculate fast and reliable focus counts?

+3
source share
4 answers

. , . iPhone ARM Cortex, NEON, FFT.

@9000 JPEG -, , , .

+1

, , . JPEG .

, . , , . , .

. (, .) , iPhone JPEG.

+3

, , , , , . , , , .

+2

Consider the different types of edges: for example. peaks in relation to the edges of the steps. The latter will continue to be present regardless of focus. To isolate the former, use asymmetric suppression in the direction of the gradient. As an indicator of focus, use the ratio of suppressed edges at two different resolutions.

0
source

Source: https://habr.com/ru/post/1794569/


All Articles