CN107356213B - Optical filter concentricity measuring method and terminal equipment - Google Patents

Optical filter concentricity measuring method and terminal equipment Download PDF

Info

Publication number
CN107356213B
CN107356213B CN201710494313.0A CN201710494313A CN107356213B CN 107356213 B CN107356213 B CN 107356213B CN 201710494313 A CN201710494313 A CN 201710494313A CN 107356213 B CN107356213 B CN 107356213B
Authority
CN
China
Prior art keywords
image
contour
detected
optical filter
outline
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.)
Active
Application number
CN201710494313.0A
Other languages
Chinese (zh)
Other versions
CN107356213A (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.)
Shandong Luzhong Zhihua Information Technology Co.,Ltd.
Original Assignee
Riseye Intelligent Technology Shenzhen 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 Riseye Intelligent Technology Shenzhen Co ltd filed Critical Riseye Intelligent Technology Shenzhen Co ltd
Priority to CN201710494313.0A priority Critical patent/CN107356213B/en
Publication of CN107356213A publication Critical patent/CN107356213A/en
Priority to PCT/CN2018/087482 priority patent/WO2019001164A1/en
Application granted granted Critical
Publication of CN107356213B publication Critical patent/CN107356213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/26Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes
    • G01B11/27Measuring arrangements characterised by the use of optical techniques for measuring angles or tapers; for testing the alignment of axes for testing the alignment of axes

Abstract

The invention is suitable for the technical field of industrial detection, and provides an optical filter concentricity measuring method and terminal equipment. The method comprises the following steps: acquiring an initial image containing an optical filter; extracting a target area image from the initial image, and taking the target area image as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image; denoising the image to be detected; respectively calculating the central point positions of a first contour and a second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively. According to the invention, the concentricity of the optical filter is measured by an image processing method, so that the measurement precision of the concentricity of the optical filter can be improved, and the measurement efficiency is improved.

Description

Optical filter concentricity measuring method and terminal equipment
Technical Field
The invention belongs to the technical field of industrial detection, and particularly relates to a method for measuring the concentricity of an optical filter and terminal equipment.
Background
The optical filter is an optical device for selecting a required radiation band, is widely applied, and can be applied to a camera lens to play roles in filtering infrared light, trimming incident light and the like. At present, the application requirements of the optical filter are continuously increased, and the quality requirements of the optical filter are higher and higher. The optical filter manufacturer continuously standardizes the quality requirement of the optical filter while improving the production process. Concentricity is an important quality parameter of the filter and needs to be measured during the manufacturing process. The existing concentricity measurement mainly depends on manual measurement, the manual measurement mode is often high in labor cost and low in measurement efficiency, the measurement precision is low, and the measurement labels are not standard.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and a terminal device for measuring filter concentricity, so as to solve the problems of low measurement accuracy and low measurement efficiency of filter concentricity at present.
The first aspect of the embodiments of the present invention provides a method for measuring the concentricity of an optical filter, including:
acquiring an initial image containing an optical filter;
extracting a target area image from the initial image, and taking the target area image as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
denoising the image to be detected;
respectively calculating the central point positions of a first contour and a second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
A second aspect of an embodiment of the present invention provides an optical filter concentricity measurement apparatus, including:
the acquisition module is used for acquiring an initial image containing the optical filter;
the extraction module is used for extracting a target area image from the initial image and taking the target area image as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
the de-noising module is used for de-noising the image to be detected;
the computing module is used for respectively computing the central point positions of the first contour and the second contour in the image to be detected after the denoising processing; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
A third aspect of the embodiments of the present invention provides an optical filter concentricity measurement terminal apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements a method including:
acquiring an initial image containing an optical filter;
extracting a target area image from the initial image, and taking the target area as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
denoising the image to be detected;
respectively calculating the central point positions of a first contour and a second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium storing a computer program, which when executed by a processor implements a method comprising:
acquiring an initial image containing an optical filter;
extracting a target area image from the initial image, and taking the target area image as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
denoising the image to be detected;
respectively calculating the central point positions of a first contour and a second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
The method and the device for detecting the optical filter contour of the image processing device process the initial image containing the optical filter, extract the target area image corresponding to the external contour of the optical filter as the image to be detected, and search the central point positions of the first contour and the second contour in the image to be detected. The first outline and the second outline respectively correspond to two outlines of the optical filter structure, so that the two found central point positions are the central point positions of the two outlines in the optical filter structure, and the concentricity of the optical filter can be measured by comparing the two central point positions. According to the embodiment of the invention, the concentricity of the optical filter is measured by an image processing method, so that the measurement precision of the concentricity of the optical filter can be improved, and the measurement efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
FIG. 1 is a flowchart illustrating an implementation of a method for measuring concentricity of an optical filter according to an embodiment of the present invention;
FIG. 2 is an image of a single camera filter provided by one embodiment of the present invention;
FIG. 3 is an image of a dual-camera filter provided by one embodiment of the present invention;
fig. 4 is a flowchart illustrating an implementation of a target area in the optical filter concentricity measurement method according to the embodiment of the present invention;
fig. 5 is a flowchart illustrating an implementation of denoising processing on an image to be measured in the method for measuring concentricity of an optical filter according to the embodiment of the present invention;
fig. 6 is a flowchart of an implementation of calculating the positions of the central points of the first profile and the second profile in the method for measuring the concentricity of the optical filter according to the embodiment of the present invention;
FIG. 7 is a schematic diagram of an apparatus for measuring filter concentricity according to an embodiment of the present invention;
fig. 8 is a schematic diagram of a filter concentricity measurement terminal device provided in an embodiment of the present invention.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 is a flowchart of an implementation of the method for measuring the concentricity of an optical filter according to an embodiment of the present invention, which is detailed as follows:
in S101, an initial image including the filter is acquired.
In the present embodiment, the filter includes, but is not limited to, a single-camera filter and a dual-camera filter. To the image acquisition of single camera light filter, can prevent putting on non-light tight smelting tool with single camera light filter, use and be shaded from the smelting tool and project the back of single camera light filter, the light filter part is black in the image of the single camera light filter of gathering this moment, and all the other backgrounds are white. For the image acquisition of the dual-camera filter, coaxial parallel light can be used for irradiation, and the glass part in the filter in the acquired image of the dual-camera filter is white, and the rest background is black. Fig. 2 shows images of several different configurations of single-camera filters. Fig. 3 shows an image of a dual-camera filter.
Measuring the concentricity of the single-camera optical filter, wherein the measured concentricity is the concentricity of the center of the external structure of the single-camera optical filter and the center of the internal glass; concentricity measurements are taken for the dual camera filter, the concentricity of the center of the outer structure of the glass region of the dual camera filter and the center of the inner structure of the glass region being measured.
It is easy to think that the number of the filters in the acquired initial image containing the filters may be one, two or more, and is not limited herein. In the following embodiments, the concentricity measurement is performed on a single optical filter in an image, and when an image includes two or more optical filters, the measurement is performed by referring to a method for measuring the concentricity of the single optical filter, which is not described again.
In S102, extracting a target area image from the initial image, and taking the target area image as an image to be detected; and the target area image is an image corresponding to the external contour of the optical filter in the initial image.
In this embodiment, the obtained initial image including the filter may include more background portions, and the ratio of the filter to the whole image is smaller, at this time, if the image processing is directly performed, the invalid background information in the processed image information is too much, which affects the speed of image processing and the accuracy of concentricity measurement. Therefore, a target area image corresponding to the external contour of the optical filter can be extracted from the acquired initial image including the optical filter, and the target area image can be used as an image to be measured. The subsequent image processing is only carried out on the image to be measured, so that the speed of the image processing and the measurement accuracy of the concentricity are improved.
As an embodiment of the present invention, the target area image may be extracted by locating the position of the filter in the image. As shown in fig. 4, S102 may include the steps of:
in S401, determining an outer contour of a filter in the initial image; the outer contour is the contour of the outermost periphery of the filter.
In this embodiment, the outer contour of the filter may be acquired by performing binarization processing on the acquired initial image. The outer contour is an outermost contour of the entire filter separated from the background region, that is, a contour of the image in which the area of the surrounding region is the largest. Preferably, the initial image is binarized using the large law method.
In S402, the optical filter is positioned according to the outer contour, and position information of the optical filter is acquired.
In this embodiment, the position of the minimum bounding rectangle of the outer contour is the position of the filter. The position information of the filter can be obtained from the position information of the outer contour.
In S403, the target area image is extracted according to the position information, and the target area image is used as the image to be measured.
In this embodiment, since the image to be measured needs to be rotated and the like, the target area is appropriately larger than the position of the filter. The background area in the preset range can be expanded outwards on the position of the optical filter, and the image to be detected is extracted according to the position of the expanded background area.
Preferably, since a situation that the optical filter is not completely captured on the image (for example, a situation that the optical filter is placed in a position offset or a position offset of an image capturing device, etc.) may occur in the captured initial image of the optical filter, before the target area image is extracted, the judgment may be performed according to the outer contour of the optical filter. If the minimum circumscribed rectangle of the external outline is completely positioned in the initial image, the initial image is a qualified image, and subsequent target area image extraction is carried out; and if the minimum circumscribed rectangle of the external outline is not completely positioned in the initial image, the initial image is an unqualified image, and the initial image is deleted without subsequent processing.
Preferably, the optical filter in the extracted image to be measured can be subjected to rotation correction for the convenience of subsequent processing. The steps of rotation correction are: firstly copying one copy of the obtained image to be detected, carrying out Otsu method binaryzation on the copied image to be detected, and then carrying out negation operation on the image to be detected; extracting each contour in the image to be detected, and excluding contours except the maximum contour; extracting a minimum circumscribed rectangle from the maximum outline to obtain an angle and the center of the rectangle, wherein if the angle is smaller than a preset range, for example, -45 degrees, the correction angle is the angle plus 90 degrees; and (3) rotating the image to be detected by affine transformation according to the acquired angle and the rectangular center, wherein the rotated image is the binarized image, inverting the acquired image, returning the image, and completing the rotation correction.
In S103, denoising the image to be detected.
In this embodiment, due to an environmental factor or a factor of the image capturing apparatus, the image of the optical filter acquired in S101 may include a defect, for example, a black spot noise appears in a white background region, or a white spot noise appears in a black optical filter region, so that the subsequently extracted image to be measured also includes noise. Therefore, the image to be measured can be denoised, and the measurement precision of the filter concentricity is prevented from being influenced by noise.
As an embodiment of the invention, the image to be detected can be denoised according to the comparison result by comparing the image to be detected with the image template subjected to binarization processing and negation processing. As shown in fig. 5, S103 may include the steps of:
in S501, a binarization operation and an inversion operation are performed on the image to be detected.
In the present embodiment, the binarization operation means that all pixels of the image are represented by one of two pixel values. For example, the gray value of a pixel point on the image is set to 0 or 255, that is, the whole image is displayed with a visual effect of only black and white. The inversion operation is to change the gray value of the pixel point from 0 to 255 or from 255 to 0, and the black area and the white area on the image are exchanged in color from the visual effect.
In S502, extracting each contour in the image to be detected after binarization operation and negation operation; each contour respectively encloses a certain area.
In the present embodiment, the area of the region surrounded by the outline is the area of the region surrounded by the closed curve constituting the outline. After the binarization and the inversion of the image to be detected, the image may contain white point noise or black point noise. The area of the region surrounded by the outline corresponding to the noise is usually smaller, and the area of the region surrounded by the outline corresponding to the optical filter is usually larger, so that the noise and the optical filter can be distinguished by comparing the area of the region surrounded by the outlines. And sequencing the areas surrounded by the outlines from large to small, wherein the area outline with the larger area is the outline corresponding to the optical filter, and the area outline with the smaller area is the outline corresponding to the noise.
In S503, the previously preset number of contours with the area from large to small in each contour is used as a template.
In this embodiment, the pre-set number of contours with the area from large to small refers to the predetermined number of contours with the larger area of the region surrounded by the contours. For example, if the preset number is 2, the contour with the largest area of the surrounded region and the contour with the second largest area of the surrounded region in each contour are used as templates.
As an embodiment of the present invention, the respective outlines may be sorted according to the area of the area surrounded by the outlines with a smaller number, and the area of the area surrounded by the outlines with a smaller number may be larger. And taking the contour which is less than or equal to the preset contour number as a template. For example, if the number of the contours is 1, 2, 3, … …, n in this order, the area of the region surrounded by the contour No. 1 is the largest. If the preset contour number is 2, the contours with the sequence numbers 3, 4, … …, n are removed, and only the contours with the sequence numbers 1 and 2 are reserved as templates. Therefore, the contour corresponding to the noise is removed in the mode, only the contour corresponding to the optical filter is reserved, and the contour containing the preset number of contours generates the template for denoising and comparison.
In S504, the image to be detected and the template are compared, and the image to be detected is processed according to the comparison result.
In this embodiment, the template obtained in step S503 is an image only including the contour corresponding to the filter, and the image is inverted, so that the template is exchanged with the black area and the white area of the image to be measured. By comparing the image to be detected with the template, the outline which is not present in the template in the image to be detected is removed, and the denoising processing of the image to be detected can be realized. Removing the contour may set the point pixel values of the area inside the contour to coincide with the values of the nearby pixel points outside the contour. Specifically, comparing pixel values of corresponding pixel points in the image to be detected and the template respectively, and if the pixel values of the pixel points in the two images are inconsistent, keeping the pixel value of the pixel point in the image to be detected unchanged; if the pixel values of the pixel points in the two images are consistent, the pixel value of the pixel point in the image to be detected is inverted (for example, a white point is changed into a black point).
By denoising the image to be detected, noise pixel points in the image to be detected can be reduced, and thus the measurement precision of the concentricity of the optical filter is improved.
In S104, respectively calculating the central point positions of the first contour and the second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
In this embodiment, the structure of the filter includes an outer profile and an inner profile. The first contour in the image to be measured corresponds to the outer contour of the optical filter, and the second contour in the image to be measured corresponds to the inner contour of the optical filter. Since the image to be measured may contain a contour of noise or the like, only the center point positions of the first contour and the second contour are calculated when the concentricity measurement is performed. Concentricity can be represented by the distance between the center point of the outer contour and the center point of the inner contour of the filter, so that the measurement of concentricity of the filter can be realized by calculating the position of the center point of the first contour and the position of the center point of the second contour.
As an embodiment of the present invention, four edge positions of a rectangle corresponding to the first contour and the second contour may be searched, and a position of a center point of the rectangle is determined by the four edge positions of the rectangle, as shown in fig. 6, S104 may include the following steps:
in S601, four edge positions of a rectangle corresponding to the first outline and the second outline in the image to be detected are respectively searched.
In S602, four vertex positions of the rectangle corresponding to the first contour and the second contour are respectively calculated according to the four edge positions.
In S603, the center point positions of the rectangles corresponding to the first contour and the second contour are respectively calculated according to the four vertex positions.
In this embodiment, the structures of the single-camera optical filter and the double-camera optical filter correspond to an inner rectangle and an outer rectangle respectively, so that in the image to be measured, the first outline and the second outline correspond to a rectangle respectively, and the positions of the rectangles can be determined by finding the positions of four side lines of the rectangle. Then, four vertex positions of the rectangle are calculated through the four edge lines, two vertexes of opposite corners of the rectangle are connected into a diagonal line, and the intersection position of the two diagonal lines of the rectangle is the center point position of the rectangle, so that the center point positions of the first contour and the second contour can be respectively obtained.
The rectangle corresponding to the first outline can be the minimum circumscribed rectangle of the first outline and can also be the maximum inscribed rectangle of the first outline; the rectangle corresponding to the second contour may be a minimum circumscribed rectangle of the second contour, or may be a maximum inscribed rectangle of the second contour; the specific setting can be selected according to actual conditions, and is not limited herein.
The position of the center point of the first contour may be calculated first and then the position of the center point of the second contour may be calculated, or the position of the center point of the second contour may be calculated first and then the position of the center point of the first contour is calculated, or the positions of the two center points are calculated at the same time, which is not limited herein.
The following description will be made by taking a single-camera filter and a dual-camera filter as examples.
For the single-camera optical filter, firstly extracting a second outline, judging whether the height and the width of a rectangle corresponding to the second outline accord with the size parameters of the optical filter or not, if the height and the width of the rectangle corresponding to the second outline do not accord with the preset size parameter range of the optical filter, not performing subsequent processing on the image to be detected, and simultaneously returning error prompt information; if the height and width of the rectangle corresponding to the second contour meet the preset size parameter range of the optical filter, the areas in the preset range near the four edge lines of the rectangle are respectively extracted (for example, the area extracted for the upper edge line may be an area with the upper edge line as the center and the height of the upper edge line being half of the height of the rectangle, and the area extracted for the left edge line may be an area with the left edge line as the center and the height of the left edge line being half of the width of the rectangle). And searching for edge points adjacent to the black-white pixel points in the extracted region, performing straight line fitting on the edge points to obtain four side lines of the rectangle corresponding to the second contour, and further calculating the position of the center point of the rectangle corresponding to the second contour.
Preferably, least square straight line fitting is adopted, two times of fitting are carried out successively, points with the straight line distance greater than the preset distance after the first time of straight line fitting are deleted, and then the remaining points are used for carrying out straight line fitting for the second time. The straight line obtained by fitting is more accurate, so that the concentricity detection precision is improved.
And searching four side lines of the rectangle corresponding to the first outline outwards according to the central point position of the rectangle corresponding to the second outline, and respectively extracting areas in a preset range near the four side lines of the rectangle. And searching edge points adjacent to the black-white pixel points in the extracted region, performing straight line fitting on the edge points to obtain four side lines of the rectangle corresponding to the first contour, and further calculating the position of the center point of the rectangle corresponding to the first contour.
If the difference value between the position of the central point of the first contour and the position of the central point of the second contour is smaller than or equal to a preset value, the result of measuring the concentricity of the optical filter is qualified; if the difference value between the position of the central point of the first contour and the position of the central point of the second contour is larger than a preset value, the result of measuring the concentricity of the optical filter is qualified; in addition, the value of the filter concentricity may be returned.
For the double-camera optical filter, the first outline is extracted firstly, the minimum circumscribed rectangle of the first outline is obtained according to the first outline, and the central point position of the minimum circumscribed rectangle is obtained. And according to the position of the central point of the minimum external rectangle, extending outwards, searching four side lines of the rectangle corresponding to the second outline, and respectively extracting areas in a preset range near the four side lines of the rectangle. And searching for edge points adjacent to the black-white pixel points in the extracted region, performing straight line fitting on the edge points to obtain four side lines of the rectangle corresponding to the second contour, and further calculating the position of the center point of the rectangle corresponding to the second contour.
As shown in fig. 3, the outer frame region of the dual-camera filter is a ring-shaped region formed by a rectangular region with a middle rectangle removed. The center point position of the rectangle corresponding to the second contour can be extended outwards to find the annular area, the edge points adjacent to the black and white pixel points are found in the annular area, the edge points are subjected to linear fitting, four side lines of the rectangle corresponding to the first contour can be obtained, and the center point position of the rectangle corresponding to the first contour is further obtained.
As an embodiment of the present invention, since there are various shapes of filter components, the rectangle of some structural filters in the image to be measured needs to be compensated, S401 may include: and compensating the position of an edge line needing to be compensated in the four edge lines of the rectangle corresponding to the first outline or the second outline according to the shape information of the optical filter.
In the present embodiment, as shown in fig. 2, the structural types of the single-camera filter include a square structure, a concave structure, a convex structure, a structure in which both the upper and lower portions are concave, and the like. The shape information of the single-camera filter includes, but is not limited to, one or more of convex width, convex height, concave width, concave height, width and height of the whole part, pixel accuracy and standard judgment value. The shape information of the dual-camera filter includes, but is not limited to, one or more of the width, height, and pixel size of the part.
For the single-camera optical filter, if the structure of the optical filter is a convex structure or a square structure, four side lines of the rectangle corresponding to the first outline do not need to be compensated. If the structure of the optical filter is a concave structure or a structure with both concave upper and lower sides, four side lines of the rectangle corresponding to the first contour need to be compensated. For the optical filter with the concave structure or the structure with concave upper and lower parts, the edge line of the black-white pixel edge point searched from the image to be detected is not the edge line of the rectangle corresponding to the external outline of the optical filter, namely not the edge line of the rectangle corresponding to the first outline, and the rectangular edge line corresponding to the first outline and the central point position of the first outline can be obtained only after compensation.
Specifically, the edge lines of the black-and-white pixel edge points found from the image to be detected can be compensated in the corresponding direction according to the upper concave width, the upper concave height, the lower concave width, the lower concave height, and the like in the shape information of the optical filter, so as to obtain four edge lines of the rectangle corresponding to the first contour. For example, if the direction of the depression of the filter having a recessed structure or a structure in which both the upper and lower portions are recessed is defined as the Y direction, the edge line of the found black-and-white pixel edge point is compensated in the Y direction.
As an embodiment of the present invention, in order to facilitate finding the contour edge of the optical filter in the image to be detected, a plurality of regions may be provided for optical filters of different structural types. For convenience of explanation, the upper, lower, left and right directions in the following description are referred to the part images in fig. 2. The single-camera optical filter has four structures. Taking the embossed structure as an example, the region of the uppermost protruded portion is set as a first region, the region on the right side of the part is set as a second region, the region below the part is set as a third region, and the region on the left side of the part is set as a fourth region. The region settings of the other three structures refer to the region settings of the embossed structure.
When the edge line of the edge point of the black and white pixel in the contour is searched, the four areas can be scanned respectively. Wherein, the first three areas adopt column scanning, and the second four areas adopt line scanning. And stopping scanning the current row or column when the pixel value of the scanned pixel point changes, continuing scanning the next row or column, and storing the coordinates of the point. And processing the saved point coordinates after the scanning of the four areas is finished. Arranging point coordinates obtained in the first three areas from big to small according to the Y coordinate, and excluding a part of points at the front and back of the Y coordinate; the point coordinates obtained in the second and fourth areas are arranged from large to small according to the X coordinate, and a part of points in front of and behind the X coordinate are excluded. And performing straight line fitting according to the searched point coordinates, and further solving four side lines of the rectangle corresponding to the external contour or the internal contour of the optical filter.
By setting the area, the finding efficiency of the side line of the rectangle corresponding to the outline in the image to be measured is higher, the processing speed of the image is improved, and the measuring speed of the concentricity of the optical filter is further improved.
In summary, the embodiments of the present invention have the following advantages, specifically: 1. the manufacturing procedure is simple; 2. the measurement precision is high and is 0.005 MM; 3. the measuring optical filters have various shapes and can adapt to various optical filters with different sizes; 4. the method is simple, convenient to maintain, capable of well adapting to the actual engineering environment and high in reliability. Therefore, the embodiment of the invention can effectively overcome the difficulty which is difficult to solve in the aspect of practical application in the prior art, and can really realize high-precision and high-efficiency measurement on the concentricity of the optical filter.
In addition, the embodiment of the invention utilizes the computer vision technology to truly apply the advanced image processing algorithm to the engineering practice aiming at the requirement of optical filter production quality detection, can realize high-precision measurement of the concentricity of the optical filter, has the advantages of simple and convenient maintenance and operation, strong reliability and the like, and can particularly meet the measurement requirement aiming at the optical filters with different specifications and types produced on a production line. The requirement of one set of measuring equipment for detecting the quality of a whole set of products is met.
The method and the device for detecting the optical filter contour of the image processing device process the initial image containing the optical filter, extract the target area image corresponding to the external contour of the optical filter as the image to be detected, and search the central point positions of the first contour and the second contour in the image to be detected. The first outline and the second outline respectively correspond to two outlines of the optical filter structure, so that the two found central point positions are the central point positions of the two outlines in the optical filter structure, and the concentricity of the optical filter can be measured by comparing the two central point positions. According to the embodiment of the invention, the concentricity of the optical filter is measured by an image processing method, so that the measurement precision of the concentricity of the optical filter can be improved, and the measurement efficiency is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 7 shows a schematic diagram of an optical filter concentricity measuring apparatus provided in an embodiment of the present invention, corresponding to the optical filter concentricity measuring method described in the above embodiment. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 7, the apparatus includes an acquisition module 71, an extraction module 72, a denoising module 73, and a calculation module 74.
And an acquiring module 71, configured to acquire an initial image including the optical filter.
An extracting module 72, configured to extract a target area image from the initial image, and use the target area image as an image to be detected; and the target area image is an image corresponding to the external contour of the optical filter in the initial image.
And the denoising module 73 is configured to perform denoising processing on the image to be detected.
A calculating module 74, configured to calculate center point positions of the first contour and the second contour in the image to be detected after the denoising processing, respectively; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
Preferably, the extraction module 72 is configured to:
determining an outer contour of a filter in the initial image; the outer contour is the contour of the outermost periphery of the optical filter;
positioning the optical filter according to the external contour to acquire the position information of the optical filter;
and extracting the target area image according to the position information, and taking the target area image as the image to be detected.
Preferably, the denoising module 73 is configured to:
carrying out binarization operation and negation operation on the image to be detected;
extracting each contour in the image to be detected after binarization operation and negation operation; each outline respectively encloses a certain area;
taking the outline with the preset number from large area to small area in each outline as a template;
and comparing the image to be detected with the template, and processing the image to be detected according to a comparison result.
Preferably, the calculation module 74 is configured to:
respectively searching four edge positions of a rectangle corresponding to the first outline and the second outline in the image to be detected;
respectively calculating four vertex positions of the rectangle corresponding to the first contour and the second contour according to the four edge positions;
and respectively calculating the central point positions of the rectangles corresponding to the first contour and the second contour according to the four vertex positions.
Preferably, the calculation module 74 is configured to:
and compensating the position of an edge line needing to be compensated in the four edge lines of the rectangle corresponding to the first outline or the second outline according to the shape information of the optical filter.
The method and the device for detecting the optical filter contour of the image processing device process the initial image containing the optical filter, extract the target area image corresponding to the external contour of the optical filter as the image to be detected, and search the central point positions of the first contour and the second contour in the image to be detected. The first outline and the second outline respectively correspond to two outlines of the optical filter structure, so that the two found central point positions are the central point positions of the two outlines in the optical filter structure, and the concentricity of the optical filter can be measured by comparing the two central point positions. According to the embodiment of the invention, the concentricity of the optical filter is measured by an image processing method, so that the measurement precision of the concentricity of the optical filter can be improved, and the measurement efficiency is improved.
Fig. 8 is a schematic diagram of a filter concentricity measurement terminal apparatus according to an embodiment of the present invention. As shown in fig. 8, the filter concentricity measurement terminal apparatus 8 of this embodiment includes: a processor 80, a memory 81, and a computer program 82, such as a filter concentricity measurement program, stored in the memory 81 and executable on the processor 80. The processor 80, when executing the computer program 82, implements the steps in the various filter concentricity measurement method embodiments described above, such as steps 101 to 104 shown in fig. 1. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 71 to 74 shown in fig. 7.
Illustratively, the computer program 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions for describing the execution process of the computer program 82 in the filter concentricity measurement terminal apparatus 8. For example, the computer program 82 may be divided into an acquisition module, an extraction module, a denoising module, and a calculation module, and each module has the following specific functions:
the acquisition module is used for acquiring an initial image containing the optical filter;
the extraction module is used for extracting a target area image from the initial image and taking the target area image as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
the de-noising module is used for de-noising the image to be detected;
the computing module is used for respectively computing the central point positions of the first contour and the second contour in the image to be detected after the denoising processing; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively.
The filter concentricity measurement terminal device 8 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The filter concentricity measurement terminal equipment may include, but is not limited to, a processor 80 and a memory 81. Those skilled in the art will appreciate that fig. 8 is merely an example of the filter concentricity measurement terminal apparatus 8, and does not constitute a limitation to the filter concentricity measurement terminal apparatus 8, and may include more or less components than those shown, or combine some components, or different components, for example, the filter concentricity measurement terminal apparatus may further include an input-output device, a network access device, a bus, or the like.
The Processor 80 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 81 may be an internal storage unit of the filter concentricity measurement terminal apparatus 8, such as a hard disk or a memory of the filter concentricity measurement terminal apparatus 8. The memory 81 may also be an external storage device of the filter concentricity measurement terminal device 8, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a flash Card (FlashCard), or the like provided on the filter concentricity measurement terminal device 8. Further, the memory 81 may also include both an internal storage unit and an external storage device of the filter concentricity measurement terminal apparatus 8. The memory 81 is used to store the computer program and other programs and data required by the filter concentricity measurement terminal apparatus. The memory 81 may also be used to temporarily store data that has been output or is to be output.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal device are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (6)

1. A method for measuring the concentricity of an optical filter is characterized by comprising the following steps:
acquiring an initial image containing an optical filter;
if the minimum circumscribed rectangle of the external outline of the optical filter in the initial image is completely positioned in the initial image, the initial image is a qualified image, a target area image is extracted from the qualified initial image, and the target area image is used as an image to be detected; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
after the extracted optical filter in the image to be detected is subjected to rotation correction, denoising processing is carried out on the image to be detected;
respectively calculating the central point positions of a first contour and a second contour in the image to be detected after the denoising treatment; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively;
wherein the denoising processing of the image to be detected comprises:
carrying out binarization operation and negation operation on the image to be detected;
extracting each contour in the image to be detected after binarization operation and negation operation; each outline respectively encloses a certain area;
taking the outline with the preset number from large area to small area in each outline as a template;
comparing the image to be detected with the template, and removing the contour which does not exist in the template in the image to be detected, so as to realize the denoising treatment of the image to be detected;
the calculating the central point positions of the first contour and the second contour in the image to be detected after the denoising processing respectively comprises:
respectively searching four edge positions of a rectangle corresponding to the first outline and the second outline in the image to be detected;
respectively calculating four vertex positions of the rectangle corresponding to the first contour and the second contour according to the four edge positions;
respectively calculating the central point positions of the rectangles corresponding to the first contour and the second contour according to the four vertex positions;
the respectively searching for the positions of the four edges of the rectangle corresponding to the first outline and the second outline in the image to be detected comprises:
according to the shape information of the optical filter, compensating the position of an edge line needing to be compensated in the four edge lines of the rectangle corresponding to the first outline or the second outline; the shape information includes: wide upper concave, high upper concave, wide lower concave and high lower concave.
2. The method according to claim 1, wherein the extracting a target area image from the initial image, and taking the target area image as an image to be measured comprises:
determining an outer contour of a filter in the initial image; the outer contour is the contour of the outermost periphery of the optical filter;
positioning the optical filter according to the external contour to acquire the position information of the optical filter;
and extracting the target area image according to the position information, and taking the target area image as the image to be detected.
3. An optical filter concentricity measuring apparatus, comprising:
the acquisition module is used for acquiring an initial image containing the optical filter;
the extraction module is used for extracting a target area image from the qualified initial image and taking the target area image as an image to be detected if the minimum circumscribed rectangle of the external outline of the optical filter in the initial image is completely positioned in the initial image; the target area image is an image corresponding to the external contour of the optical filter in the initial image;
the denoising module is used for performing denoising processing on the image to be detected after the extracted optical filter in the image to be detected is subjected to rotation correction;
the computing module is used for respectively computing the central point positions of the first contour and the second contour in the image to be detected after the denoising processing; the first and second profiles correspond to an outer profile and an inner profile of the filter, respectively;
wherein the denoising module is specifically configured to:
carrying out binarization operation and negation operation on the image to be detected;
extracting each contour in the image to be detected after binarization operation and negation operation; each outline respectively encloses a certain area;
taking the outline with the preset number from large area to small area in each outline as a template;
comparing the image to be detected with the template, and removing the contour which does not exist in the template in the image to be detected, so as to realize the denoising treatment of the image to be detected;
the calculation module is specifically configured to:
respectively searching four edge positions of a rectangle corresponding to the first outline and the second outline in the image to be detected;
respectively calculating four vertex positions of the rectangle corresponding to the first contour and the second contour according to the four edge positions; and
respectively calculating the central point positions of the rectangles corresponding to the first contour and the second contour according to the four vertex positions;
the respectively searching for the positions of the four edges of the rectangle corresponding to the first outline and the second outline in the image to be detected comprises:
according to the shape information of the optical filter, compensating the position of an edge line needing to be compensated in the four edge lines of the rectangle corresponding to the first outline or the second outline; the shape information includes: wide upper concave, high upper concave, wide lower concave and high lower concave.
4. The filter concentricity measurement apparatus of claim 3, wherein the extraction module is to:
determining an outer contour of a filter in the initial image; the outer contour is the contour of the outermost periphery of the optical filter;
positioning the optical filter according to the external contour to acquire the position information of the optical filter;
and extracting the target area image according to the position information, and taking the target area image as the image to be detected.
5. A filter concentricity measurement terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 2 when executing the computer program.
6. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 2.
CN201710494313.0A 2017-06-26 2017-06-26 Optical filter concentricity measuring method and terminal equipment Active CN107356213B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710494313.0A CN107356213B (en) 2017-06-26 2017-06-26 Optical filter concentricity measuring method and terminal equipment
PCT/CN2018/087482 WO2019001164A1 (en) 2017-06-26 2018-05-18 Optical filter concentricity measurement method and terminal device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710494313.0A CN107356213B (en) 2017-06-26 2017-06-26 Optical filter concentricity measuring method and terminal equipment

Publications (2)

Publication Number Publication Date
CN107356213A CN107356213A (en) 2017-11-17
CN107356213B true CN107356213B (en) 2020-08-18

Family

ID=60273007

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710494313.0A Active CN107356213B (en) 2017-06-26 2017-06-26 Optical filter concentricity measuring method and terminal equipment

Country Status (2)

Country Link
CN (1) CN107356213B (en)
WO (1) WO2019001164A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107356213B (en) * 2017-06-26 2020-08-18 精锐视觉智能科技(深圳)有限公司 Optical filter concentricity measuring method and terminal equipment
CN108389167B (en) * 2018-02-09 2020-04-21 广东天骄智能制造要素配置有限公司 Image processing method, image processing device, computer equipment and storage medium
CN108896278B (en) * 2018-05-23 2019-12-31 精锐视觉智能科技(深圳)有限公司 Optical filter silk-screen defect detection method and device and terminal equipment
CN108918093B (en) * 2018-05-23 2020-08-04 精锐视觉智能科技(深圳)有限公司 Optical filter mirror surface defect detection method and device and terminal equipment
CN109343037A (en) * 2018-11-27 2019-02-15 森思泰克河北科技有限公司 Optical detector installation error detection device, method and terminal device
CN114814425B (en) * 2022-04-22 2023-05-23 上海晶岳电子有限公司 Method for testing electromagnetic compatibility of power supply module by adopting power absorption pliers

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI269021B (en) * 2004-06-29 2006-12-21 Yeong-Shin Tarng A homocentric degree correcting apparatus and the method thereof
CN102183222A (en) * 2011-03-01 2011-09-14 杭州浙大精益机电技术工程有限公司 Dynamic quantitative measurement method and device for coaxiality and planeness of spiral conveying system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102519398B (en) * 2011-10-28 2013-08-28 广西师范大学 Optical fiber base pin concentricity measuring method based on visual measurement and system thereof
CN106022337B (en) * 2016-05-22 2019-10-15 复旦大学 A kind of planar target detection method based on continuous boundary feature
CN106596562A (en) * 2016-12-23 2017-04-26 广东锐视智能检测有限公司 Magnet ring appearance quality on-line detection apparatus based on machine visual sense and method thereof
CN107356213B (en) * 2017-06-26 2020-08-18 精锐视觉智能科技(深圳)有限公司 Optical filter concentricity measuring method and terminal equipment

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI269021B (en) * 2004-06-29 2006-12-21 Yeong-Shin Tarng A homocentric degree correcting apparatus and the method thereof
CN102183222A (en) * 2011-03-01 2011-09-14 杭州浙大精益机电技术工程有限公司 Dynamic quantitative measurement method and device for coaxiality and planeness of spiral conveying system

Also Published As

Publication number Publication date
CN107356213A (en) 2017-11-17
WO2019001164A1 (en) 2019-01-03

Similar Documents

Publication Publication Date Title
CN107356213B (en) Optical filter concentricity measuring method and terminal equipment
CN108921176B (en) Pointer instrument positioning and identifying method based on machine vision
US8422759B2 (en) Image processing method and image processing device
CN114494045B (en) Large spur gear geometric parameter measurement system and method based on machine vision
CN113146073B (en) Vision-based laser cutting method and device, electronic equipment and storage medium
CN114897864B (en) Workpiece detection and defect judgment method based on digital-analog information
CN110807807B (en) Monocular vision target positioning pattern, method, device and equipment
CN112577969B (en) Defect detection method and defect detection system based on machine vision
CN109427046B (en) Distortion correction method and device for three-dimensional measurement and computer readable storage medium
CN104075659A (en) Three-dimensional imaging recognition method based on RGB structure light source
CN109191516B (en) Rotation correction method and device of structured light module and readable storage medium
CN107230212B (en) Vision-based mobile phone size measuring method and system
JP2014203311A (en) Image processor, image processing method, and program
US9319666B1 (en) Detecting control points for camera calibration
CN117058411B (en) Method, device, medium and equipment for identifying edge appearance flaws of battery
CN110288655B (en) Method and device for automatically identifying position of test pattern in chart picture
CN112634259A (en) Automatic modeling and positioning method for keyboard keycaps
CN108564571B (en) Image area selection method and terminal equipment
CN116908185A (en) Method and device for detecting appearance defects of article, electronic equipment and storage medium
CN114998571B (en) Image processing and color detection method based on fixed-size markers
CN116524041A (en) Camera calibration method, device, equipment and medium
CN110610163A (en) Table extraction method and tool based on ellipse fitting in natural scene
CN113160259B (en) Edge detection method, edge detection device, computer equipment and storage medium
CN113538399A (en) Method for obtaining accurate contour of workpiece, machine tool and storage medium
CN111445431B (en) Image segmentation method, terminal equipment and computer readable 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
PP01 Preservation of patent right

Effective date of registration: 20201019

Granted publication date: 20200818

PP01 Preservation of patent right
PD01 Discharge of preservation of patent
PD01 Discharge of preservation of patent

Date of cancellation: 20201210

Granted publication date: 20200818

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240312

Address after: 503-2, 5th Floor, Transformation and Incubation Center, Building B, Science and Technology Innovation Building, No. 366 Huaguang Road, Fangzhen Town, Zhangdian District, Zibo City, Shandong Province, 255000

Patentee after: Shandong Zhihua Business Operation Service Co.,Ltd.

Country or region after: Zhong Guo

Address before: 518000, No. 409, Building A1, Fuhai Information Port, Qiaotou Community, Fuyong Street, Bao'an District, Shenzhen, Guangdong Province

Patentee before: RISEYE INTELLIGENT TECHNOLOGY (SHENZHEN) Co.,Ltd.

Country or region before: Zhong Guo

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240321

Address after: Room 505, 5th Floor, Building B, Science and Technology Innovation Building, No. 366 Huaguang Road, Fangzhen Town, Zhangdian District, Zibo City, Shandong Province, 255000

Patentee after: Shandong Luzhong Zhihua Information Technology Co.,Ltd.

Country or region after: Zhong Guo

Address before: 503-2, 5th Floor, Transformation and Incubation Center, Building B, Science and Technology Innovation Building, No. 366 Huaguang Road, Fangzhen Town, Zhangdian District, Zibo City, Shandong Province, 255000

Patentee before: Shandong Zhihua Business Operation Service Co.,Ltd.

Country or region before: Zhong Guo