G
G
Great_Beaver2012-12-11 09:06:59
.NET
Great_Beaver, 2012-12-11 09:06:59

Image autofocus library?

There is a camera with mechanical focus adjustment, the mechanics control from the computer is already ready. Now you need to focus)
Tell me if there is a library for autofocusing an image, preferably C #?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
nonname, 2012-12-11
@nonname

I don't think there is ready-made software. It is not entirely clear how this program or library should work, I propose to receive video from the camera, process it and use the contrast method to select the focus by controlling the focus motor, something like this is implemented in mirrorless cameras.

E
Eddy_Em, 2012-12-11
@Eddy_Em

I once made trial attempts to analyze an image to control autofocus (using simple wavelet transforms). Here lies.
I’ll warn you right away: it’s impossible to tell in which direction the focus should be moved by the general appearance of the image. First you need to at least move in some direction, analyze and draw a conclusion where to move (you can also estimate how much to move).
I have not come across any ready-made libraries.
By the way, another simple way to determine the degree of image defocus is to analyze its autocorrelation function.
In general, there are plenty of options: image gradient analysis; selecting the outline of an object and tracking its changes, calculating the half-width of point objects, etc., etc.

I
Indexator, 2012-12-11
@Indexator

I googled especially for you and this is what I came across: www.nbuv.gov.ua/e-journals/vntu/2012_3/2012-3_ru.files/ru/12yybied_ru.pdf

L
lsf, 2012-12-11
@lsf

You can start by reading how the whole thing developed in the software of the cameras themselves :) As I remember, the simplest algorithms were based on taking a small piece in the center of the frame. They tried to find vertical lines, found and shifted the focal length and monitored the change in contrast at the boundaries of the verticals. In the course of studying the issue, links to the necessary works will come across, and already knowing who dealt with the issue, it will be easier to look for an implementation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question