CN117197435A - Camera focusing definition evaluation method and system - Google Patents

Camera focusing definition evaluation method and system Download PDF

Info

Publication number
CN117197435A
CN117197435A CN202311168883.2A CN202311168883A CN117197435A CN 117197435 A CN117197435 A CN 117197435A CN 202311168883 A CN202311168883 A CN 202311168883A CN 117197435 A CN117197435 A CN 117197435A
Authority
CN
China
Prior art keywords
image
row
column
gray
pixel points
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
CN202311168883.2A
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.)
Shenzhen Jingce Optoelectronics Co ltd
Wuhan Jingce Electronic Group Co Ltd
Wuhan Jingli Electronic Technology Co Ltd
Original Assignee
Shenzhen Jingce Optoelectronics Co ltd
Wuhan Jingce Electronic Group Co Ltd
Wuhan Jingli Electronic Technology Co Ltd
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 Shenzhen Jingce Optoelectronics Co ltd, Wuhan Jingce Electronic Group Co Ltd, Wuhan Jingli Electronic Technology Co Ltd filed Critical Shenzhen Jingce Optoelectronics Co ltd
Priority to CN202311168883.2A priority Critical patent/CN117197435A/en
Publication of CN117197435A publication Critical patent/CN117197435A/en
Pending legal-status Critical Current

Links

Abstract

The application relates to a camera focusing definition evaluation method and a camera focusing definition evaluation system, wherein the method comprises the following steps: and shooting the black-and-white object by using a camera to obtain a black-and-white original image, adopting differential processing to obtain a differential image, selecting pixel points with the maximum gray value of each column or each row of the differential image to further obtain the edge position of each column or each row, and intercepting the ROI image of the edge position. And performing straight line fitting by using the edge position information and adopting a least square method to obtain an edge fitting straight line, and then arranging all pixel points in the ROI image to the pixel points with the same distance on the edge fitting straight line into the same row or the same column to obtain a reconstructed image. And finally, solving a gray projection image of the reconstructed image, carrying out second-order difference on the gray projection image, and evaluating the definition of the image according to the maximum value of the second-order difference. Compared with other definition evaluation algorithms, the method can normalize the definition evaluation characteristic parameters, can evaluate the definition evaluation characteristic parameters by adopting local images, greatly saves the calculation time and improves the calculation efficiency.

Description

Camera focusing definition evaluation method and system
Technical Field
The present application relates to the field of image data processing technologies, and in particular, to a method and a system for evaluating focusing definition of a camera.
Background
Along with the development of digital imaging technology to automation and intellectualization, the application range of the automatic focusing technology is continuously expanded, great progress is made in the aspects of automation, high precision, high stability and the like, and the automatic focusing technology is widely applied to various precise instruments such as cameras, video cameras, microscopes, scanners and the like.
The good imaging state is the premise that the camera can normally detect, and the imaging definition evaluation of the camera is the key for ensuring that the camera obtains clear images, and most of the imaging definition of the camera is still evaluated by human eyes at present, so that the imaging state evaluation method is low in efficiency and is easy to influence subjective factors of human eyes.
Image sharpness evaluation has important implications in image analysis and recognition. The digital image evaluation function is an important basis for evaluating the definition of the digital image, and is a key for realizing automatic focusing in a digital image acquisition system.
The existing definition evaluation method mainly comprises a Tenengard gradient method, a Laplacian gradient method, a variance method and the like, normalization is difficult to carry out when the Tenengard gradient method and the Laplacian gradient method are adopted for evaluation, global processing is needed to bring a certain difficulty to a machine adjustment, the variance method is easily interfered by environmental factors, and the evaluation accuracy is not high.
Disclosure of Invention
The embodiment of the application provides a camera focusing definition evaluation method and a camera focusing definition evaluation system, which are used for solving the problems of low efficiency and low accuracy of a definition evaluation method in the related art.
An embodiment of the present application provides a method for evaluating focus sharpness of a camera, including:
image acquisition, namely acquiring a black-and-white original image after shooting a black-and-white object with a camera under a set exposure time;
extracting edges, namely obtaining a differential image by adopting differential processing in an original image, selecting pixel points with the maximum gray value of each column or each row of the differential image as edge positions of each column or each row, and intercepting an ROI image of the edge positions;
image reconstruction, namely performing straight line fitting on edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line, rounding, and taking the pixel points with the same distance as the fitting straight line as the same row or the same column to obtain a reconstructed image;
and evaluating the image, namely solving each column or each row of gray projection of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
In some embodiments, the differential processing is specifically:
subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction;
or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point of the same row in the original image to obtain a horizontal second-order differential image.
In some embodiments, the edge position information includes row coordinates and column coordinates of each edge position pixel point, so as to obtain data pairs of each edge position pixel point, and then, performing linear fitting on multiple groups of data pairs by using a least square method to obtain an edge fitting straight line.
In some embodiments, projecting each column or row of the reconstructed image comprises:
adding gray values of each row of pixel points of the reconstructed image along the horizontal direction and then averaging;
alternatively, the gray values of each column of pixels of the reconstructed image in the vertical direction are added and averaged.
In some embodiments, obtaining the second order difference of the gray-scale projection image specifically includes:
subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value;
or subtracting the gray value of the pixel point in the ith column from the gray value of the pixel point in the (i+2) th column in the gray projection image.
A second aspect of an embodiment of the present application provides a camera focus sharpness evaluation system, including:
a camera for shooting the black and white objects under the set exposure time to obtain black and white original images;
the edge extraction module is used for obtaining a differential image by adopting differential processing in the original image, selecting pixel points with the maximum gray value of each column or each row of the differential image as the edge position of each column or each row, and intercepting the ROI image of the edge position;
the image reconstruction module is used for carrying out straight line fitting on the edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line and rounding, and arranging the pixel points with the same distance as the fitting straight line into the same row or the same column to obtain a reconstructed image;
and the image evaluation module is used for solving gray projection of each column or each row of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
In some embodiments, the edge extraction module differential processing is specifically:
subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction;
or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point of the same row in the original image to obtain a horizontal second-order differential image.
In some embodiments, the edge position information in the image reconstruction module includes row coordinates and column coordinates of each edge position pixel point, so as to obtain data pairs of each edge position pixel point, and then, a least square method is adopted to perform linear fitting on multiple groups of data pairs to obtain an edge fitting straight line.
In some embodiments, the image evaluation module projects the reconstructed image for each column or each row of gray scales specifically includes:
adding gray values of each row of pixel points of the reconstructed image along the horizontal direction and then averaging;
alternatively, the gray values of each column of pixels of the reconstructed image in the vertical direction are added and averaged.
In some embodiments, the image evaluation module obtains a second order difference of the gray projection image specifically includes:
subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value;
or subtracting the gray value of the pixel point in the ith column from the gray value of the pixel point in the (i+2) th column in the gray projection image.
The technical scheme provided by the application has the beneficial effects that:
the embodiment of the application provides a camera focusing definition evaluation method and a camera focusing definition evaluation system, wherein the camera focusing definition evaluation method firstly performs image acquisition, and obtains a black-white original image after a black-white object is shot by a camera under a set exposure time; and secondly, extracting edges, adopting differential processing in an original image to obtain a differential image, selecting pixel points with the maximum gray value of each column or each row of the differential image as edge positions of each column or each row, and intercepting an ROI image of the edge positions.
Then, reconstructing an image, namely performing straight line fitting on edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line, rounding, and listing the pixel points with the same distance to the fitting straight line as the same row or the same column to obtain a reconstructed image; and finally, evaluating the image, namely solving each column or each row of gray projection of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
Therefore, the camera focusing definition evaluation method of the application obtains a black-and-white original image after shooting a black-and-white object by using a camera, obtains a differential image by differential processing, further determines the rough position of a target by using the differential image, and then selects the pixel point of the maximum gray value of each column or each row of the differential image, further obtains the edge position of each column or each row. In order to shorten the calculation time of the subsequent image reconstruction and image evaluation, the ROI image of the edge position is intercepted in advance.
And performing straight line fitting by using edge position information by adopting a least square method to obtain an edge fitting straight line, and then arranging all pixel points in the ROI image to the pixel points with the same distance on the edge fitting straight line into the same row or the same column to obtain a reconstructed image, thereby solving the problem of low accuracy of the definition evaluation in image evaluation caused by overlarge gray value difference of the pixel points in the same row or the same column. And finally, solving a gray projection image of the reconstructed image, carrying out second-order difference on the gray projection image, and evaluating the definition of the image according to the maximum value of the second-order difference.
Compared with other sharpness evaluation algorithms, the method for evaluating the sharpness of the image by adopting the transition pixel second-order differential value can normalize the sharpness evaluation characteristic parameters, and can evaluate the sharpness by adopting the partial image, thereby greatly saving the calculation time and improving the calculation efficiency.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a camera focus sharpness evaluation method according to an embodiment of the present application;
FIG. 2 is a block diagram of a camera focus sharpness evaluation system according to an embodiment of the present application;
fig. 3 is a schematic structural view of a black-and-white article according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The embodiment of the application provides a camera focusing definition evaluation method and a camera focusing definition evaluation system, which can solve the problems of low efficiency and low accuracy of a definition evaluation method in the related technology.
Referring to fig. 1 and 3, a first aspect of an embodiment of the present application provides a camera focus sharpness evaluation method, including:
step 101, acquiring an image, namely shooting a black-and-white object by using a camera under a set exposure time to obtain a black-and-white original image; in the step, the camera is controlled to be at a certain constant temperature, the exposure time is 50ms, the original image of the black-and-white object is collected, the black-and-white object can be a black-and-white card preferentially, and the boundary between the black area and the white area of the black-and-white card is clear.
Step 102, extracting edges, namely obtaining a differential image in an original image by adopting differential processing, wherein the differential image can determine the rough position of a target, namely the edge position of a black area and a white area, selecting a pixel point with the maximum gray value of each column or each row of the differential image as the edge position of each column or each row, and intercepting an ROI image of the edge position.
And 103, reconstructing an image, namely performing straight line fitting on edge position information by adopting a least square method to obtain an edge fitting straight line, and then solving the distances from all pixel points in the ROI image to the edge fitting straight line and rounding. And (3) obtaining a reconstructed image by taking the pixel points with the same distance as the fitting straight line as the same row or the same column, for example, taking all the pixel points with the distance of 1 as the first row, taking all the pixel points with the distance of 2 as the 2 nd row, taking all the pixel points with the distance of 3 as the 3 rd row, and the like, thereby obtaining the reconstructed image.
And 104, evaluating the image, namely obtaining gray projection images by gray projection of each column or each row of the reconstructed image, obtaining second-order difference of the gray projection images, obtaining definition evaluation characteristic parameters through taking the maximum value of the second-order difference, wherein the definition evaluation characteristic parameters are dimensionless, and representing the image more clearly through the larger value of the maximum value of the second-order difference, otherwise, representing the image more vague through the smaller value of the maximum value of the second-order difference, and further adjusting the focusing definition of the camera.
According to the camera focusing definition evaluation method, a black-and-white original image is obtained after a black-and-white object is shot by a camera, differential processing is adopted to obtain a differential image, then the rough position of a target is determined by the differential image, and then the pixel point of the maximum gray value of each column or each row of the differential image is selected to obtain the edge position of each column or each row. In order to shorten the calculation time of the subsequent image reconstruction and image evaluation, the ROI image at the edge position is intercepted in advance, and the pixel number of the ROI image is much smaller than that of the difference image, so that the calculation difficulty is reduced, and the calculation time is shortened.
And performing straight line fitting by using edge position information by adopting a least square method to obtain an edge fitting straight line, and then arranging all pixel points in the ROI image to the pixel points with the same distance on the edge fitting straight line into the same row or the same column to obtain a reconstructed image, thereby solving the problem of low accuracy of the definition evaluation in image evaluation caused by overlarge gray value difference of the pixel points in the same row or the same column. And finally, solving a gray projection image of the reconstructed image, carrying out second-order difference on the gray projection image, and evaluating the definition of the image according to the maximum value of the second-order difference.
Compared with other sharpness evaluation algorithms, the method for evaluating the sharpness of the image by adopting the transition pixel second-order differential value can normalize the sharpness evaluation characteristic parameters, is convenient for adjusting a camera, can evaluate by adopting a local image, greatly saves the calculation time and improves the calculation efficiency.
In some optional embodiments, the present application provides a camera focus sharpness evaluation method, where the differential processing specifically includes:
the gray value of the ith row of pixel points in the same column is subtracted from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction, and the gray value of the ith row of pixel points in the same column in the original image is subtracted from the gray value of the ith row of pixel points in the same column in the original image to obtain a first-order difference image in the vertical direction, wherein the first-order difference image is clear in edge position of the second-order difference image.
Or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point in the same row in the original image to obtain a horizontal second-order differential image, or subtracting the gray value of the ith column pixel point from the gray value of the (i+1) th column pixel point in the same row in the original image to obtain a horizontal first-order differential image, wherein the edge position of the first-order differential image is not clear.
In some optional embodiments, the embodiment of the application provides a camera focusing definition evaluation method, in which edge position information includes row coordinates and column coordinates of pixel points at each edge position, so as to obtain data pairs (row coordinates and column coordinates) of the pixel points at each edge position, and then a least square method is adopted to linearly fit multiple groups of data pairs to obtain an edge fitting straight line.
In some optional embodiments, the present application provides a camera focus sharpness evaluation method, where the method for obtaining gray scale projections of each column or each row of a reconstructed image specifically includes: adding the gray values of each row of pixel points of the reconstructed image along the horizontal direction, and then averaging to obtain a one-dimensional gray projection image; or adding the gray values of each column of pixel points of the reconstructed image along the vertical direction, and then averaging to obtain a one-dimensional gray projection image.
The obtaining of the second-order difference of the gray projection image specifically comprises the following steps: subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value; or subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the gray projection image, obtaining a definition evaluation characteristic parameter which is a maximum value in the gray difference value, wherein the definition evaluation characteristic parameter is dimensionless, and the larger the value of the maximum value of the second-order difference is, the clearer the image is represented, and otherwise, the smaller the value of the maximum value of the second-order difference is, the more blurred the image is represented.
Referring to fig. 2 and 3, a second aspect of an embodiment of the present application provides a camera focus sharpness evaluation system, including:
a camera for shooting the black and white objects under the set exposure time to obtain black and white original images; the camera is controlled to be at a certain constant temperature, the exposure time is 50ms, the original image of the black-and-white object is collected, the black-and-white object can be a black-and-white card preferentially, and the boundary between the black area and the white area of the black-and-white card is clear.
The edge extraction module is used for obtaining a differential image by adopting differential processing in an original image, the differential image can determine the rough position of the target, namely the edge position of a black area and the white area, selecting the pixel point of the maximum gray value of each column or each row of the differential image as the edge position of each column or each row, and intercepting the ROI image of the edge position.
And the image reconstruction module is used for carrying out straight line fitting on the edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distance from all the pixel points in the ROI image to the edge fitting straight line, rounding, and listing the pixel points with the same distance as the fitting straight line as the same row or the same column to obtain a reconstructed image, for example, all the pixel points with the distance of 1 are the first row, all the pixel points with the distance of 2 are the 2 nd row, all the pixel points with the distance of 3 are the 3 rd row and the like, thereby obtaining the reconstructed image.
The image evaluation module is used for obtaining gray projection images by gray projection of each column or each row of the reconstructed image, obtaining second-order difference of the gray projection images, obtaining definition evaluation characteristic parameters through taking the maximum value of the second-order difference, wherein the definition evaluation characteristic parameters are dimensionless, the larger the value of the maximum value of the second-order difference is, the clearer the image is represented, the smaller the value of the maximum value of the second-order difference is, the clearer the image is represented, and the focus definition of the camera is required to be adjusted.
In some optional embodiments, a second aspect of the present application provides a camera focus sharpness evaluation system, where the difference processing of the edge extraction module specifically includes:
the gray value of the ith row of pixel points in the same column is subtracted from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction, and the gray value of the ith row of pixel points in the same column in the original image is subtracted from the gray value of the ith row of pixel points in the same column in the original image to obtain a first-order difference image in the vertical direction, wherein the first-order difference image is clear in edge position of the second-order difference image.
Or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point in the same row in the original image to obtain a horizontal second-order differential image, or subtracting the gray value of the ith column pixel point from the gray value of the (i+1) th column pixel point in the same row in the original image to obtain a horizontal first-order differential image, wherein the edge position of the first-order differential image is not clear.
In some optional embodiments, a second aspect of the present application provides a camera focus sharpness evaluation system, where in the system, edge position information in an image reconstruction module includes row coordinates and column coordinates of each edge position pixel point, so as to obtain data pairs (row coordinates and column coordinates) of each edge position pixel point, and then a least square method is used to linearly fit multiple groups of data pairs to obtain an edge fit straight line.
In some optional embodiments, the second aspect of the embodiment of the present application provides a camera focus sharpness evaluation system, in which the image evaluation module obtains each column or each row of gray scale projections of the reconstructed image, specifically including: adding the gray values of each row of pixel points of the reconstructed image along the horizontal direction, and then averaging to obtain a one-dimensional gray projection image; or adding the gray values of each column of pixel points of the reconstructed image along the vertical direction, and then averaging to obtain a one-dimensional gray projection image.
The image evaluation module for obtaining the second-order difference of the gray projection image specifically comprises the following steps: subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value; or subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the gray projection image, obtaining a definition evaluation characteristic parameter which is a maximum value in the gray difference value, wherein the definition evaluation characteristic parameter is dimensionless, and the larger the value of the maximum value of the second-order difference is, the clearer the image is represented, and otherwise, the smaller the value of the maximum value of the second-order difference is, the more blurred the image is represented.
Principle of operation
The embodiment of the application provides a camera focusing definition evaluation method and a camera focusing definition evaluation system, wherein the camera focusing definition evaluation method firstly performs image acquisition, and obtains a black-white original image after a black-white object is shot by a camera under a set exposure time; and secondly, extracting edges, adopting differential processing in an original image to obtain a differential image, selecting pixel points with the maximum gray value of each column or each row of the differential image as edge positions of each column or each row, and intercepting an ROI image of the edge positions.
Then, reconstructing an image, namely performing straight line fitting on edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line, rounding, and listing the pixel points with the same distance to the fitting straight line as the same row or the same column to obtain a reconstructed image; and finally, evaluating the image, namely solving each column or each row of gray projection of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
Therefore, the camera focusing definition evaluation method of the application obtains a black-and-white original image after shooting a black-and-white object by using a camera, obtains a differential image by differential processing, further determines the rough position of a target by using the differential image, and then selects the pixel point of the maximum gray value of each column or each row of the differential image, further obtains the edge position of each column or each row. In order to shorten the calculation time of the subsequent image reconstruction and image evaluation, the ROI image of the edge position is intercepted in advance.
And performing straight line fitting by using edge position information by adopting a least square method to obtain an edge fitting straight line, and then arranging all pixel points in the ROI image to the pixel points with the same distance on the edge fitting straight line into the same row or the same column to obtain a reconstructed image, thereby solving the problem of low accuracy of the definition evaluation in image evaluation caused by overlarge gray value difference of the pixel points in the same row or the same column. And finally, solving a gray projection image of the reconstructed image, carrying out second-order difference on the gray projection image, and evaluating the definition of the image according to the maximum value of the second-order difference.
Compared with other sharpness evaluation algorithms, the method for evaluating the sharpness of the image by adopting the transition pixel second-order differential value can normalize the sharpness evaluation characteristic parameters, and can evaluate the sharpness by adopting the partial image, thereby greatly saving the calculation time and improving the calculation efficiency.
In the description of the present application, it should be noted that the azimuth or positional relationship indicated by the terms "upper", "lower", etc. are based on the azimuth or positional relationship shown in the drawings, and are merely for convenience of describing the present application and simplifying the description, and are not indicative or implying that the apparatus or element in question must have a specific azimuth, be constructed and operated in a specific azimuth, and thus should not be construed as limiting the present application. Unless specifically stated or limited otherwise, the terms "mounted," "connected," and "coupled" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present application can be understood by those of ordinary skill in the art according to the specific circumstances.
It should be noted that in the present application, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a specific embodiment of the application to enable those skilled in the art to understand or practice the application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for evaluating focus sharpness of a camera, the method comprising:
image acquisition, namely acquiring a black-and-white original image after shooting a black-and-white object with a camera under a set exposure time;
extracting edges, namely obtaining a differential image by adopting differential processing in an original image, selecting pixel points with the maximum gray value of each column or each row of the differential image as edge positions of each column or each row, and intercepting an ROI image of the edge positions;
image reconstruction, namely performing straight line fitting on edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line, rounding, and taking the pixel points with the same distance as the fitting straight line as the same row or the same column to obtain a reconstructed image;
and evaluating the image, namely solving each column or each row of gray projection of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
2. The camera focus sharpness evaluation method according to claim 1, wherein the difference processing is specifically:
subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction;
or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point of the same row in the original image to obtain a horizontal second-order differential image.
3. A camera focus sharpness evaluation method according to claim 1, characterized in that:
the edge position information comprises row coordinates and column coordinates of pixel points at each edge position, so that data pairs of the pixel points at each edge position are obtained, and then a least square method is adopted to linearly fit a plurality of groups of data pairs to obtain an edge fitting straight line.
4. A camera focus sharpness evaluation method according to claim 1, characterized in that the projecting of each column or each row of the reconstructed image comprises:
adding gray values of each row of pixel points of the reconstructed image along the horizontal direction and then averaging;
alternatively, the gray values of each column of pixels of the reconstructed image in the vertical direction are added and averaged.
5. The method of claim 4, wherein obtaining the second order difference of the gray projection image comprises:
subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value;
or subtracting the gray value of the pixel point in the ith column from the gray value of the pixel point in the (i+2) th column in the gray projection image.
6. A camera focus sharpness evaluation system, comprising:
a camera for shooting the black and white objects under the set exposure time to obtain black and white original images;
the edge extraction module is used for obtaining a differential image by adopting differential processing in the original image, selecting pixel points with the maximum gray value of each column or each row of the differential image as the edge position of each column or each row, and intercepting the ROI image of the edge position;
the image reconstruction module is used for carrying out straight line fitting on the edge position information by adopting a least square method to obtain an edge fitting straight line, then solving the distances from all pixel points in the ROI image to the edge fitting straight line and rounding, and arranging the pixel points with the same distance as the fitting straight line into the same row or the same column to obtain a reconstructed image;
and the image evaluation module is used for solving gray projection of each column or each row of the reconstructed image to obtain a gray projection image, solving a second-order difference of the gray projection image, and finally solving a definition evaluation characteristic parameter by taking the maximum value of the second-order difference.
7. The camera focus sharpness evaluation system according to claim 6, wherein the edge extraction module performs a difference process of:
subtracting the gray value of the ith row of pixel points from the gray value of the ith row of pixel points in the same column in the original image to obtain a second-order difference image in the vertical direction;
or subtracting the gray value of the ith column pixel point from the gray value of the (i+2) th column pixel point of the same row in the original image to obtain a horizontal second-order differential image.
8. A camera focus sharpness evaluation system according to claim 6, wherein:
and the edge position information in the image reconstruction module comprises row coordinates and column coordinates of each edge position pixel point, so that data pairs of each edge position pixel point are obtained, and then a plurality of groups of data pairs are subjected to linear fitting by adopting a least square method to obtain an edge fitting straight line.
9. The camera focus sharpness evaluation system according to claim 6, wherein the image evaluation module projects gray scale for each column or each row of the reconstructed image, comprising:
adding gray values of each row of pixel points of the reconstructed image along the horizontal direction and then averaging;
alternatively, the gray values of each column of pixels of the reconstructed image in the vertical direction are added and averaged.
10. The camera focus sharpness evaluation system according to claim 9, wherein the image evaluation module obtains a second-order difference of the gray-scale projection image, comprising:
subtracting the gray value of the ith row of pixel points from the gray value of the (i+2) th row of pixel points in the gray projection image to obtain a gray difference value;
or subtracting the gray value of the pixel point in the ith column from the gray value of the pixel point in the (i+2) th column in the gray projection image.
CN202311168883.2A 2023-09-08 2023-09-08 Camera focusing definition evaluation method and system Pending CN117197435A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311168883.2A CN117197435A (en) 2023-09-08 2023-09-08 Camera focusing definition evaluation method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311168883.2A CN117197435A (en) 2023-09-08 2023-09-08 Camera focusing definition evaluation method and system

Publications (1)

Publication Number Publication Date
CN117197435A true CN117197435A (en) 2023-12-08

Family

ID=88984569

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311168883.2A Pending CN117197435A (en) 2023-09-08 2023-09-08 Camera focusing definition evaluation method and system

Country Status (1)

Country Link
CN (1) CN117197435A (en)

Similar Documents

Publication Publication Date Title
US8879869B2 (en) Image defect map creation using batches of digital images
US7369712B2 (en) Automated statistical self-calibrating detection and removal of blemishes in digital images based on multiple occurrences of dust in images
US7676110B2 (en) Determination of need to service a camera based on detection of blemishes in digital images
US7536061B2 (en) Automated statistical self-calibrating detection and removal of blemishes in digital images based on determining probabilities based on image analysis of single images
US7206461B2 (en) Digital image acquisition and processing system
US7683946B2 (en) Detection and removal of blemishes in digital images utilizing original images of defocused scenes
US7315658B2 (en) Digital camera
US7545995B2 (en) Automated statistical self-calibrating detection and removal of blemishes in digital images dependent upon changes in extracted parameter values
US7310450B2 (en) Method of detecting and correcting dust in digital images based on aura and shadow region analysis
CN107316047B (en) Image processing apparatus, image processing method, and storage medium
US7308156B2 (en) Automated statistical self-calibrating detection and removal of blemishes in digital images based on a dust map developed from actual image data
CN111083365B (en) Method and device for rapidly detecting optimal focal plane position
JP2010045613A (en) Image identifying method and imaging device
EP1958158A2 (en) Method for detecting streaks in digital images
CN113375555A (en) Power line clamp measuring method and system based on mobile phone image
CN116563298A (en) Cross line center sub-pixel detection method based on Gaussian fitting
CN117197435A (en) Camera focusing definition evaluation method and system
CN111062887B (en) Image definition judging method based on improved Retinex algorithm
CN117523502B (en) Urban road rubbish intelligent monitoring system based on machine vision
van Zwanenberg et al. Estimation of ISO12233 edge spatial frequency response from natural scene derived step-edge data (JIST-first)
CN117078655A (en) Screen defect detection method, device, equipment and storage medium
CN117041531A (en) Mobile phone camera focusing detection method and system based on image quality evaluation

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