CN117528240A - Full-pixel automatic focusing method, device, equipment and medium - Google Patents

Full-pixel automatic focusing method, device, equipment and medium Download PDF

Info

Publication number
CN117528240A
CN117528240A CN202311520670.1A CN202311520670A CN117528240A CN 117528240 A CN117528240 A CN 117528240A CN 202311520670 A CN202311520670 A CN 202311520670A CN 117528240 A CN117528240 A CN 117528240A
Authority
CN
China
Prior art keywords
pixel
full
image
focusing
image acquisition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311520670.1A
Other languages
Chinese (zh)
Inventor
杨鹏
刘明
赵晶
董立泉
褚旭红
孔令琴
赵跃进
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yangtze River Delta Research Institute Of Beijing University Of Technology Jiaxing
Beijing Institute of Technology BIT
Original Assignee
Yangtze River Delta Research Institute Of Beijing University Of Technology Jiaxing
Beijing Institute of Technology BIT
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yangtze River Delta Research Institute Of Beijing University Of Technology Jiaxing, Beijing Institute of Technology BIT filed Critical Yangtze River Delta Research Institute Of Beijing University Of Technology Jiaxing
Priority to CN202311520670.1A priority Critical patent/CN117528240A/en
Publication of CN117528240A publication Critical patent/CN117528240A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

The invention discloses a full-pixel automatic focusing generation method, device, equipment and medium, belongs to the technical field of image processing, and mainly relates to the problem of realizing automatic focusing for all pixels of an entire image. The method comprises the steps of determining the radius of a circle of confusion generated by defocusing in a selected focusing area by applying a full-pixel regression model to an image, and calculating the displacement of an image acquisition device according to a triangle similarity principle. Finally, the programming control electric control translation stage moves the image acquisition device according to the displacement to shoot a full-focus image, so that full-pixel automatic focusing is realized. According to the invention, the lens is not required to be repeatedly telescopic, the optimal position is continuously compared and found, the corresponding displacement can be automatically moved to a proper position, the full-focusing image can be shot, and the focusing shooting time is greatly shortened. In addition, the invention can arbitrarily select a focusing area or a pixel point, realizes full-pixel automatic focusing, and solves the problem of focusing pixel number or area selection limitation in the existing automatic focusing technology.

Description

Full-pixel automatic focusing method, device, equipment and medium
Technical Field
The invention belongs to the technical field of image processing, and particularly relates to a full-pixel automatic focusing method, device, equipment and medium.
Background
Autofocus techniques are a leading-edge problem in the field of photography, and the use of autofocus techniques based on computer vision is one of the main current research directions. Such techniques are widely used in a variety of fields including, but not limited to, photography, video recording, and computer vision. The continuous development of auto-focusing technology enables a camera system to more rapidly and accurately realize automatic adjustment of focus.
The existing automatic focusing technology mainly comprises the following steps: contrast detection techniques, phase detection techniques, and the like. A contrast-based detection technique, i.e., determining whether the image reaches a clear state by comparing the brightness differences of adjacent pixels; the focus position is determined by measuring the phase difference of the light based on a phase detection technique, i.e. using a special sensor in front of the camera lens.
At present, the existing automatic focusing technology has the problems of limited focusing pixel number or area selection, long time consumption caused by continuously telescopic selection of the optimal focusing state of a lens in the shooting process and the like due to the problems of sensitivity of a sensor, algorithm precision and the like. Therefore, there is a need for improvement.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a full-pixel automatic focusing method, device, equipment and medium, which are used for solving the problems of limited focusing pixel number or region selection in the prior art, long time consumption caused by continuously telescopic selection of the optimal focusing state of a lens in shooting processes such as snapshot and the like.
To achieve the above and other related objects, the present invention provides a method, apparatus, device, and medium for full-pixel auto-focusing, including:
step 1, fixing an image acquisition device on a motion executing mechanism, and placing the image acquisition device and an optical system in a straight line to ensure that an optical axis of a lens assembly is perpendicular to an imaging surface of the image acquisition device during subsequent shooting. When the device is built, the image acquisition device or the lens assembly is fixed on the motion executing mechanism, the optical axis of the lens assembly is vertical to the imaging surface of the image acquisition device, and the basic experiment shooting requirement is met.
And 2, inputting the image captured by the image acquisition device into a full-pixel regression model to obtain standard deviation of Gaussian point spread functions corresponding to the pixel positions. After preprocessing such as denoising is performed on the defocused image acquired when the image acquisition device is in the initial position state, a full-pixel regression model is adopted to determine the point spread function of each pixel point in the selected area, and the defocusing amount corresponding to each pixel point can be obtained through the point spread function. Conventional cameras as incoherent imaging systems can be modeled as isotropic gaussian functions The defocus amount is the standard deviation in the Gaussian function, and the defocus amount of the selected region is determined by the mean value of the Gaussian distribution standard deviation of all pixel points in the region. And the correspondence between the standard deviation of the Gaussian function and the radius of the circle of confusion is +.>The radius of the circle of confusion of the selected area or pixel point can be obtained accordingly.
And step 3, optionally designating a focusing area or a pixel point. The selection mode of the focusing area or the pixel point includes, but is not limited to, manual arbitrary selection, fixed image center and intelligent algorithm detection of the identification target object.
Step 4, calculating the radius of the circle of confusion of the corresponding pixel position according to the standard deviationBy Gaussian imagingFormula and triangle similarity principle, relative position displacement s-/between imaging surface and lens>The relationship between the radius of the circle of confusion R and the distance v of the object to the lens, the distance s of the lens to the image plane and the aperture diaphragm diameter D is:the distance s from the lens to the image plane at this time can be obtained as R, D, v, and the displacement amount of the image acquisition device to be moved at this time can be obtained by s-v.
And step 5, controlling a motion executing mechanism to move the image acquisition device or the lens to a specified position according to the displacement, so as to realize full-pixel automatic focusing. In order to ensure the accuracy of the moving displacement of the image acquisition device, a mode of programming and controlling the electric control translation stage is selected to push the image acquisition device to move corresponding displacement, so that a full-focus image can be obtained, and the steps of the full-pixel automatic focusing method, the device, the equipment and the medium are realized by a program stored in the computing device.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a full-pixel automatic focusing method, a device, equipment and a medium. Compared with the traditional focusing mode, the method has the advantages that the lens is required to be repeatedly retracted, the camera can be automatically controlled to move correspondingly to move in place by one step, the full-focusing image can be obtained, and the focusing shooting time is greatly shortened. Meanwhile, the region or pixel point to be focused can be arbitrarily selected to realize full-pixel automatic focusing, and the problem that the existing automatic focusing technology has focusing pixel number or region selection limitation is solved.
The invention also provides an experimental device for full-pixel automatic focusing, which comprises:
a recording unit for shooting;
the defocus amount calculating unit calculates the point spread function of each pixel point through a full-pixel regression model, so as to obtain a dispersion amount;
the displacement calculation unit is used for calculating the displacement of the full-focus image obtained by shooting the current position distance of the image acquisition device according to the corresponding relation between the radius of the circle of confusion and the displacement of the camera;
and the movement control unit is used for controlling the electric control translation stage to move the image acquisition device according to the calculated displacement so that the position of the image acquisition device meets the shooting requirement, and full-pixel automatic focusing is realized.
The invention also provides a computer device, which comprises a processor, a register, a display, a memory and a computing program executed by the processor in the register, wherein the computing program realizes the steps of the full-pixel automatic focusing method, the device, the equipment and the medium.
Drawings
FIG. 1 is a system workflow diagram provided in embodiment 1 of the present invention;
FIG. 2 is a schematic diagram of a displacement amount calculation;
FIG. 3 is a schematic diagram of an experimental set-up;
Detailed Description
In order that the manner in which the above recited features and advantages of the present invention will become more readily apparent, a more particular description of the invention will be rendered by reference to specific embodiments thereof which are illustrated in the appended drawings and are described in detail in which they are to be considered in the appended drawings, rather than all embodiments.
The invention provides a full-pixel automatic focusing method, which comprises an image acquisition device, a group of lens components, an electric control translation stage, a supporting component thereof and the like. The flow chart is shown in fig. 1, and specifically comprises the following steps.
Step S10, arranging an experimental device.
Step S20, optionally designating a focusing area or a pixel point.
And step S30, determining the radius of the circle of confusion generated by defocusing in the appointed focusing area through a full-pixel regression model according to the image pixel information captured by the image acquisition device.
And S40, calculating the displacement of the full-focus image by the distance between the current position of the image acquisition device according to the corresponding relation between the radius of the circle of confusion and the displacement of the camera.
And S50, programming and controlling the electric control translation stage to move the image acquisition device according to the calculated displacement so that the position of the image acquisition device meets the shooting requirement, and realizing full-pixel automatic focusing.
A full-focusing and out-of-focus image pair generating method step S10 is that an image acquisition device is fixed on an electric control translation stage and is kept in straight line arrangement with an optical system, and an experimental device schematic diagram is shown in fig. 3.
In some embodiments, the experimental device is arranged, the image acquisition device is required to be fixed on the electric control translation stage, the optical axis of the lens assembly is ensured to be perpendicular to the imaging surface of the image acquisition device, and the basic experimental shooting requirement is met.
In step S20, a focusing area or a pixel point is arbitrarily designated, and in some embodiments of the present invention, an area or a pixel point that is desired to be focused may be arbitrarily designated according to personal wishes, so as to implement full-pixel auto-focusing.
Step S30, determining a radius of a circle of confusion generated by defocus in a designated focusing area according to image pixel information captured by an image capturing device through a full-pixel regression model, and in some embodiments of the present invention, extracting image features through HRNet and UNet algorithms, which specifically relate to the following steps:
1. determining a point spread function generated by defocus in a current position state of the camera:
firstly, other preprocessing operations such as denoising and normalization are needed to be carried out on the defocused image acquired when the image acquisition device is in an initial position state; next, image feature extraction is performed by algorithms including, but not limited to, HRNet and UNet, and standard deviation of gaussian point spread functions corresponding to pixels is obtained through a decoder.
2. The defocus amount of each pixel point is obtained by the standard deviation of the point spread function:
conventional cameras as incoherent imaging systems, the PSF of which can be usedSpecifying the standard deviation to generate a gaussian-type point spread function or using specified zernike polynomial coefficients. Wherein the PSF is approximated as an isotropic Gaussian function using a specified standard deviation to generate the Gaussian point spread function
3. Obtaining the radius R of the circle of confusion
Based on the characteristics and optical principles of the imaging system, the corresponding relation between the standard deviation of the Gaussian function and the radius of the circle of confusion in the image can be obtained through calibration and experiments:the standard deviation of the PSF is mapped to the radius of the circle of confusion using this relationship. Therefore, by preprocessing the defocus image, acquiring the PSF, and then mapping the dispersion amount, that is, the standard deviation of the Gaussian function, to the radius of the circle of confusion, the defocus amount of each pixel point can be deduced, thereby further obtaining the radius of the circle of confusion of each pixel in the image.
And S40, calculating the displacement of the full-focus image by the distance between the current position of the image acquisition device according to the corresponding relation between the radius of the circle of confusion and the displacement of the camera.
In some embodiments of the present invention, referring to FIG. 2 we use the relationship between the radius of the circle of confusion R and the object-to-lens distance v, the lens-to-image-plane distance s, and the aperture stop diameter D The displacement is calculated, wherein R, D, v is known, the distance s from the lens to the image surface at the moment can be obtained, and the displacement required to be moved by the camera at the moment can be obtained through s-v.
And S50, programming and controlling the electric control translation stage to move the image acquisition device according to the calculated displacement so that the position of the image acquisition device meets the shooting requirement, and realizing full-pixel automatic focusing.
In some embodiments of the present invention, in order to ensure the accuracy of the displacement of the image acquisition device, the camera is pushed to move by a corresponding displacement by programming and controlling the electronically controlled translation stage, so that a full-focus image can be obtained.
In summary, the above embodiments are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (6)

1. A full-pixel automatic focusing method, a device, equipment and a medium are characterized by comprising the following steps:
step 1, fixing an image acquisition device on a motion executing mechanism, and placing the image acquisition device and an optical system in a straight line to ensure that an optical axis of a lens assembly is perpendicular to an imaging surface of the image acquisition device during subsequent shooting;
step 2, inputting the image captured by the image acquisition device into a full-pixel regression model to obtain standard deviation of Gaussian point spread functions corresponding to the positions of all pixels;
step 3, optionally designating a focusing area or a pixel point;
step 4, calculating the radius of the circle of confusion of the corresponding pixel position according to the standard deviationThe relative position displacement between the imaging surface and the lens is +.>
And step 5, controlling a motion executing mechanism to move the image acquisition device or the lens to a specified position according to the displacement, so as to realize full-pixel automatic focusing.
2. The method, device, equipment and medium for full-pixel automatic focusing according to claim 1, wherein step 1 is that an image acquisition device or a lens assembly is fixed on a motion executing mechanism when the device is built, and the optical axis of the lens assembly is vertical to an imaging surface of the image acquisition device, so that basic experimental shooting requirements are met.
3. The method, device, equipment and medium for full-pixel automatic focusing according to claim 1, wherein the step 2 is that after preprocessing including but not limited to denoising and normalization is performed on an out-of-focus image obtained when the image acquisition device is in an initial position state, a full-pixel regression model is adopted to determine a point spread function corresponding to each pixel point position in the selected area, and the out-of-focus amount of each pixel point corresponding position can be obtained through the point spread function. Conventional cameras as incoherent imaging systems can be modeled as isotropic gaussian functionsThe defocus amount is the standard deviation in the Gaussian function, and the defocus amount of the selected region is determined by the mean value of the Gaussian distribution standard deviation of all pixel points in the region. And the correspondence between the standard deviation of the Gaussian function and the radius of the circle of confusion is +.>The radius of the circle of confusion of the selected area or pixel point can be obtained accordingly.
4. The method, apparatus, device and medium for full-pixel auto-focusing according to claim 1, wherein the step 3 is that the focusing area or the pixel point is selected by any method including, but not limited to, manual arbitrary selection, image center fixation and intelligent algorithm detection of the identification target.
5. The method, apparatus, device and medium for full-pixel auto-focusing according to claim 1, wherein the step 4 is that the relationship between the radius R of the circle of confusion and the distance v from the object to the lens, the distance s from the lens to the image plane, and the aperture stop diameter D is:the distance s from the lens to the image plane at this time can be obtained as R, D, v, and the displacement amount of the image acquisition device to be moved at this time can be obtained by s-v.
6. The method, apparatus, device and medium for full-pixel auto-focusing according to claim 1, wherein step 5 is a step of selecting a manner of programming and controlling the electronically controlled translation stage to push the image capturing device to move by a corresponding displacement so as to obtain a full-focus image, and implementing any one of the above-mentioned method, apparatus, device and medium for full-pixel auto-focusing by a program stored in the computing device.
CN202311520670.1A 2023-11-15 2023-11-15 Full-pixel automatic focusing method, device, equipment and medium Pending CN117528240A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311520670.1A CN117528240A (en) 2023-11-15 2023-11-15 Full-pixel automatic focusing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311520670.1A CN117528240A (en) 2023-11-15 2023-11-15 Full-pixel automatic focusing method, device, equipment and medium

Publications (1)

Publication Number Publication Date
CN117528240A true CN117528240A (en) 2024-02-06

Family

ID=89743370

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311520670.1A Pending CN117528240A (en) 2023-11-15 2023-11-15 Full-pixel automatic focusing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN117528240A (en)

Similar Documents

Publication Publication Date Title
US10101572B2 (en) Variable focal length lens system with multi-level extended depth of field image processing
CN111932636B (en) Calibration and image correction method and device for binocular camera, storage medium, terminal and intelligent equipment
US20140253785A1 (en) Auto Focus Based on Analysis of State or State Change of Image Content
CN109085113B (en) Automatic focusing method and device for cervical exfoliated cell detection device
KR101784787B1 (en) Imaging device and method for automatic focus in an imaging device as well as a corresponding computer program
US20180122092A1 (en) Apparatus and Method for Capturing Images using Lighting from Different Lighting Angles
US11119382B2 (en) Tunable acoustic gradient lens system with amplitude adjustment corresponding to z-height as indicated by calibration data
JP2010117593A (en) Device for acquiring distance information, imaging apparatus, and program
US10812701B2 (en) High-speed tag lens assisted 3D metrology and extended depth-of-field imaging
RU2389050C1 (en) Automatic focusing method
WO2017101292A1 (en) Autofocusing method, device and system
US10264164B2 (en) System and method of correcting imaging errors for a telescope by referencing a field of view of the telescope
WO2022126430A1 (en) Auxiliary focusing method, apparatus and system
US20210190999A1 (en) Tunable acoustic gradient lens system utilizing amplitude adjustments for acquiring images focused at different z-heights
CN109318235B (en) Quick focusing method of robot vision servo system
CN117233921A (en) Automatic focusing method for fluorescent imaging equipment
CN117528240A (en) Full-pixel automatic focusing method, device, equipment and medium
TW201236448A (en) Auto-focusing camera and method for automatically focusing of the camera
CN113079318B (en) System and method for automatically focusing edge defects and computer storage medium
CN112839168B (en) Method for automatically adjusting camera imaging resolution in AOI detection system
JP5149984B2 (en) Imaging device
CN109212547A (en) A kind of ranging experimental provision and the distance measuring method based on moving-target edge sensitive
CN114384681A (en) Rapid and accurate automatic focusing method and system for microscope, computer equipment and medium
CN115484373A (en) Automatic focusing system and automatic focusing method
CN107959767B (en) Focusing and dimming method using television tracking result as guide

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination