CN110956624A - An Image Sharpness Evaluation Method for Stereoscopic Objects - Google Patents

An Image Sharpness Evaluation Method for Stereoscopic Objects Download PDF

Info

Publication number
CN110956624A
CN110956624A CN201911212471.8A CN201911212471A CN110956624A CN 110956624 A CN110956624 A CN 110956624A CN 201911212471 A CN201911212471 A CN 201911212471A CN 110956624 A CN110956624 A CN 110956624A
Authority
CN
China
Prior art keywords
image
interest
index
gray value
focusing ring
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.)
Granted
Application number
CN201911212471.8A
Other languages
Chinese (zh)
Other versions
CN110956624B (en
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.)
Hohai University HHU
Original Assignee
Hohai University HHU
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 Hohai University HHU filed Critical Hohai University HHU
Priority to CN201911212471.8A priority Critical patent/CN110956624B/en
Publication of CN110956624A publication Critical patent/CN110956624A/en
Application granted granted Critical
Publication of CN110956624B publication Critical patent/CN110956624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • G06T2207/20032Median filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

本发明是一种基于立体物体的图像清晰度评价方法,包括如下步骤:启动舵机使调焦环转动,并触发相机每隔固定时间采集一组图像;对每幅图像进行预处理,其中预处理包括中值滤波滤除噪声,阈值分割将图像二值化处理;对预处理后的图像进行Canny边缘检测;提取感兴趣的边缘法线方向上固定范围内的灰度值,将得到的灰度值作为点集;用最小二乘法进行曲线拟合;输出每个感兴趣区域的指数系数D,取平均值作为此幅图像的清晰度评价指标;比较每幅图像的指标,得到最清晰的图像并使调焦环转到指定位置。本发明采用新的评价函数对图像的感兴趣区域进行局部评价,针对某一具体物体的具体要求能够实现准确评价的目的。

Figure 201911212471

The invention is an image definition evaluation method based on a three-dimensional object, comprising the following steps: starting a steering gear to rotate a focusing ring, and triggering a camera to collect a group of images at fixed time intervals; preprocessing each image, wherein The preprocessing includes median filtering to filter out noise, threshold segmentation to binarize the image; Canny edge detection is performed on the preprocessed image; gray value in a fixed range in the normal direction of the edge of interest is extracted, and the obtained The gray value is used as a point set; curve fitting is performed by the least square method; the exponential coefficient D of each region of interest is output, and the average value is taken as the sharpness evaluation index of this image; the index of each image is compared to obtain the clearest image and turn the focus ring to the specified position. The invention adopts a new evaluation function to locally evaluate the region of interest of the image, and can achieve the purpose of accurate evaluation according to the specific requirements of a specific object.

Figure 201911212471

Description

Image definition evaluation method for three-dimensional object
Technical Field
The invention relates to the field of computer vision technology and image processing, and designs an image definition evaluation method for a three-dimensional object.
Background
With the application and development of machine vision, the acquisition of high-definition images is of great significance in the field of industrial detection, in the industrial detection process, an experienced machine vision engineer mainly spends a long time to adjust a lens focusing ring to obtain clear images, and focusing results are different due to human factors, so that an imaging system does not reach an optimal use state, and therefore, the research of an automatic focusing technology is of great significance. An important ring of the automatic focusing technology is the evaluation of image definition, and the quality of an image definition evaluation function directly influences the automatic focusing precision. Most of the image definition evaluation functions proposed at home and abroad aim at the whole image, different planes have different definitions for a three-dimensional object, and different planes have different definition requirements according to specific requirements, so that the aim of global definition evaluation on the whole image cannot be achieved. The invention carries out local evaluation on the interested area and can solve the problems.
Disclosure of Invention
In order to solve the problems, the invention provides an image definition evaluation method based on a three-dimensional object, which utilizes an automatic focusing device, wherein the automatic focusing device comprises a steering engine, a camera, a focusing ring and a workbench, the focusing ring is connected to the camera, the focusing ring carries out focusing through the steering engine, the workbench is positioned below the focusing ring, and an object to be measured is placed on the workbench, and the method is characterized by comprising the following steps:
(1) starting a steering engine to enable a focusing ring to rotate, triggering a camera to collect a group of images at fixed time intervals, enabling the definition of the images to be from fuzzy to clear and then to be fuzzy, and recording scale values corresponding to each photo; the manual setting is carried out by an industrial personal computer at fixed time intervals;
(2) preprocessing each image, wherein the preprocessing comprises median filtering to remove noise, and threshold segmentation is used for carrying out binarization processing on the images;
(3) performing Canny edge detection on the preprocessed image, and extracting the image edge;
(4) extracting gray values in a fixed range in the interested edge normal direction, wherein the fixed range is formed by extending pixel points with the same length from edges to two sides, and taking the obtained gray values as a point set;
(5) performing curve fitting by using a least square method to obtain an index coefficient D serving as an index for evaluating the image definition;
(6) outputting the index coefficient D of each interested area, and taking the average value as the definition evaluation index of the image;
(7) and comparing the indexes of each image to obtain the clearest image and enabling the focusing ring to rotate to the specified position.
The curve fitting method in the step (5) is as follows:
the curve function is of the form:
Figure RE-GDA0002327733370000021
wherein y represents the gray value at the x position, A, B, C, D, E is the parameter to be determined; set point set as { (x)1,y1),(x2,y2),…,(xn,yn) The objective function is:
Figure RE-GDA0002327733370000022
is provided with
Figure RE-GDA0002327733370000023
Using least squaresThe normal non-linear fitting method finds the parameter A, B, C, D, E such that L is minimized. The invention fits the curve by calling the nlnfit function in MATLAB.
The invention has the advantages that the local evaluation can be carried out on the specific area, and the requirement of accurate evaluation definition can be met aiming at specific requirements.
Drawings
Fig. 1 shows an automatic focusing mechanism designed by the present invention.
FIG. 2 is a flowchart illustrating operation of an embodiment of the present invention.
Fig. 3 is a diagram of the function variation corresponding to different exponential coefficients D.
Fig. 4 shows workpieces with different degrees of sharpness.
Fig. 5 is a pre-processed image.
Fig. 6 is an image after edge detection.
FIG. 7 is a gray value array of the four interested edges in the left image of FIG. 4 in the fixed range in the normal direction and the fitting result.
FIG. 8 is a gray value array of the four interested edges in the right image of FIG. 4 in the fixed range in the normal direction and the fitting result.
FIG. 9 is a graph of a set of images evaluating sharpness.
Detailed Description
Example (b):
as shown in figure 1, an automatic focusing device is designed, the automatic focusing device comprises a steering engine 1, a camera 2, a focusing ring 3 and a workbench 4, the focusing ring 3 is connected to the camera 2, the focusing ring 3 carries out focusing through the steering engine 1, the workbench 4 is located below the focusing ring, and an object 5 to be measured is placed on the workbench 4. Starting the steering engine 1 to enable the focusing ring 3 to rotate, collecting a group of images, evaluating the collected images to obtain the image with the highest definition, and enabling the focusing ring 3 to rotate to the corresponding position by using the steering engine 1 to finally achieve the purpose of automatic focusing.
The invention will now be described in more detail by way of example with reference to the accompanying drawings.
This example acquires a total of 23 images with different degrees of blur. As shown in fig. 4, 2 images were selected for display. The specific operation process of the invention is as follows:
the method comprises the following steps: the industrial personal computer controls the steering engine to drive the focusing ring to rotate, and triggers the camera to collect a group of images, so that the definition of the images is changed from fuzzy to clear and then fuzzy, and the scale value corresponding to each photo is recorded.
Step two: each image is preprocessed, wherein the preprocessing includes median filtering to remove noise, and the threshold segmentation is used for carrying out binarization processing on the images, as shown in fig. 5.
Step three: and carrying out Canny edge detection on the preprocessed image, and extracting the image edge. As shown in fig. 6.
Step four: extracting the gray values in the fixed range in the normal direction of the edge of interest, as shown in fig. 3, sorting the gray values from left to right or from top to bottom in the normal direction to form an array, fitting the array by using a least square fitting method, in this embodiment, selecting 40 pixels on the left and right of the edge, and extracting the gray values of the 80 pixels as a point set, as shown in fig. 7 and 8.
Step five: and performing curve fitting on the point set, wherein the function form of the curve fitting is as follows:
Figure RE-GDA0002327733370000031
the larger the value of D, the larger the slope of the curve, the larger the gray scale change, and the sharper the image. As shown in fig. 6 and 7, the gray value in the edge range corresponding to the blurred image in the left image of fig. 4 changes smoothly, the slope of the fitted curve is small, the gray value in the edge range corresponding to the sharp image in the right image of fig. 4 changes steeply, and the slope of the fitted curve is large.
Step six: the D values obtained from the four regions of each image are averaged to serve as the evaluation index of the image, and the indexes obtained from the 23 images are output and plotted in a graph, as shown in fig. 9. It can be seen that the invention has the advantages of strong unimodal property and high sensitivity. The focusing ring is rotated to the position where the image is clearest, the workpiece is moved to any position, and the parameters obtained by the algorithm are unchanged, so that the stability of the algorithm is high.

Claims (2)

1.一种基于立体物体的图像清晰度评价方法,利用一种自动对焦装置,所述自动对焦装置包括舵机、相机、调焦环、工作台,所述调焦环连接在相机上,所述调焦环通过舵机进行调焦,所述工作台位于调焦环下方,工作台上放置待测物体,其特征在于包括如下步骤:1. A method for evaluating image clarity based on a three-dimensional object, using an automatic focusing device, the automatic focusing device comprises a steering gear, a camera, a focusing ring, and a workbench, and the focusing ring is connected to the camera. The focusing ring is adjusted by the steering gear, the worktable is located under the focusing ring, and the object to be measured is placed on the worktable, which is characterized by comprising the following steps: (1)、启动舵机使调焦环转动,并触发相机每隔固定时间采集一组图像,使图像清晰度由模糊到清晰再到模糊,记下每张照片对应的刻度值;所述每隔固定时间通过工控机进行人工设定;(1), start the steering gear to rotate the focus ring, and trigger the camera to collect a set of images at fixed time intervals, so that the image clarity is changed from blurred to clear to blurred, and the scale value corresponding to each photo is recorded; Manually set by the industrial computer every fixed time; (2)、对每幅图像进行预处理,其中预处理包括中值滤波滤除噪声,阈值分割将图像二值化处理;(2), preprocessing each image, wherein the preprocessing includes median filtering to filter out noise, and threshold segmentation to binarize the image; (3)、对预处理后的图像进行Canny边缘检测,提取图像边缘;(3), perform Canny edge detection on the preprocessed image, and extract the image edge; (4)、提取感兴趣的边缘法线方向上固定范围内的灰度值,所述固定范围通过边缘向两边延长相同长度的像素点构成,将得到的灰度值作为点集;(4), extract the gray value in the fixed range on the edge normal direction of interest, and the fixed range is formed by the pixel points of the same length extending from the edge to both sides, and the obtained gray value is used as a point set; (5)、用最小二乘法进行曲线拟合,得到的指数系数D作为评价图像清晰度的指标;(5), perform curve fitting with least squares method, and the obtained index coefficient D is used as an index for evaluating image sharpness; (6)、输出每个感兴趣区域的指数系数D,取平均值作为此幅图像的清晰度评价指标;(6), output the index coefficient D of each region of interest, and take the average value as the sharpness evaluation index of this image; (7)、比较每幅图像的指标,得到最清晰的图像并使调焦环转到指定位置。(7), compare the indicators of each image, get the clearest image and turn the focus ring to the designated position. 2.根据权利要求1所述的一种基于立体物体的图像清晰度评价方法,其特征在于:所述步骤(5)中的曲线拟合的方法如下:2. a kind of image sharpness evaluation method based on three-dimensional object according to claim 1 is characterized in that: the method for curve fitting in described step (5) is as follows: 曲线函数形式为:The curve function form is:
Figure FDA0002298512600000011
Figure FDA0002298512600000011
其中,y表示x位置处的灰度值,A、B、C、D、E为待定参数;设点集为{(x1,y1),(x2,y2),…,(xn,yn)},目标函数为:Among them, y represents the gray value at the x position, and A, B, C, D, and E are parameters to be determined; let the point set be {(x 1 , y 1 ), (x 2 , y 2 ), ..., (x n , y n )}, the objective function is:
Figure FDA0002298512600000012
Figure FDA0002298512600000012
Figure FDA0002298512600000013
利用最小二乘法非线性拟合方法求取参数A、B、C、D、E使得L达到最小。
Assume
Figure FDA0002298512600000013
The parameters A, B, C, D and E are obtained by using the least squares nonlinear fitting method so that L can be minimized.
CN201911212471.8A 2019-12-02 2019-12-02 A Method for Image Sharpness Evaluation of Stereo Objects Active CN110956624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911212471.8A CN110956624B (en) 2019-12-02 2019-12-02 A Method for Image Sharpness Evaluation of Stereo Objects

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911212471.8A CN110956624B (en) 2019-12-02 2019-12-02 A Method for Image Sharpness Evaluation of Stereo Objects

Publications (2)

Publication Number Publication Date
CN110956624A true CN110956624A (en) 2020-04-03
CN110956624B CN110956624B (en) 2023-09-01

Family

ID=69979238

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911212471.8A Active CN110956624B (en) 2019-12-02 2019-12-02 A Method for Image Sharpness Evaluation of Stereo Objects

Country Status (1)

Country Link
CN (1) CN110956624B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112285876A (en) * 2020-11-04 2021-01-29 邱妙娜 Camera automatic focusing method based on image processing and bubble detection
CN113639630A (en) * 2021-04-01 2021-11-12 浙江大学台州研究院 Dimensional measuring instrument system based on multi-template matching and auto-focus function
CN113810616A (en) * 2021-09-27 2021-12-17 季华实验室 Aperture focus adjustment method, system, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140029000A1 (en) * 2012-07-25 2014-01-30 Ningbo University Method for detecting parfocality of zoom-stereo microscope
CN106127775A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 Measurement for Digital Image Definition and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140029000A1 (en) * 2012-07-25 2014-01-30 Ningbo University Method for detecting parfocality of zoom-stereo microscope
CN106127775A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 Measurement for Digital Image Definition and device

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112285876A (en) * 2020-11-04 2021-01-29 邱妙娜 Camera automatic focusing method based on image processing and bubble detection
CN113639630A (en) * 2021-04-01 2021-11-12 浙江大学台州研究院 Dimensional measuring instrument system based on multi-template matching and auto-focus function
CN113639630B (en) * 2021-04-01 2024-07-19 浙江大学台州研究院 Dimension measuring instrument system based on multi-template matching and auto-focus function
CN113810616A (en) * 2021-09-27 2021-12-17 季华实验室 Aperture focus adjustment method, system, electronic device and storage medium
CN113810616B (en) * 2021-09-27 2023-05-09 季华实验室 Aperture focal length adjustment method, system, electronic device and storage medium

Also Published As

Publication number Publication date
CN110956624B (en) 2023-09-01

Similar Documents

Publication Publication Date Title
CN109507192B (en) A method for detecting surface defects of magnetic cores based on machine vision
CN111083365B (en) Method and device for rapidly detecting optimal focal plane position
CN110956624A (en) An Image Sharpness Evaluation Method for Stereoscopic Objects
DE112012000950T5 (en) Determine the distance between different points on an imaged object
CN104637064A (en) Defocus blurred image definition detection method based on edge intensity weight
CN107729907A (en) A kind of fault recognition method based on infra-red thermal imaging system
JPH10506206A (en) Automatic focusing device for medical and biological specimens
CN100392403C (en) A method for automatically counting the number of white blood cells in blood microscopic images
DE102014219424A1 (en) Camera lens dirt detection device
CN104792794A (en) Machine vision based optical film surface defect detecting method
CN105139391B (en) A kind of haze weather traffic image edge detection method
CN110517213B (en) Laplacian pyramid-based real-time depth of field extension method for microscope
CN106767564A (en) A kind of detection method for being applied to phone housing surface roughness
CN111462075A (en) Rapid refocusing method and system for full-slice digital pathological image fuzzy area
CN107680152A (en) Target surface topography measurement method and apparatus based on image procossing
CN109360145A (en) A method for stitching infrared thermal images based on eddy current pulses
WO2021000948A1 (en) Counterweight weight detection method and system, and acquisition method and system, and crane
CN105072330A (en) An automatic focusing method for a line scan camera
Dogan et al. Automatic panorama with auto-focusing based on image fusion for microscopic imaging system
CN106534661A (en) Automatic focus algorithm accumulated based on strongest edge gradient Laplasse operator
CN105930811B (en) Palm texture feature detection method based on image processing
CN112200790A (en) Cloth defect detection method, device and medium
WO2009046781A1 (en) Method and device for recording information relating to a tool
CN106878617A (en) A focusing method and system
CN113538545A (en) A monocular depth estimation method based on electro-hydraulic adjustable focus lens and corresponding camera and storage medium

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
GR01 Patent grant
GR01 Patent grant