Nothing Special   »   [go: up one dir, main page]

WO2019001164A1 - Optical filter concentricity measurement method and terminal device - Google Patents

Optical filter concentricity measurement method and terminal device Download PDF

Info

Publication number
WO2019001164A1
WO2019001164A1 PCT/CN2018/087482 CN2018087482W WO2019001164A1 WO 2019001164 A1 WO2019001164 A1 WO 2019001164A1 CN 2018087482 W CN2018087482 W CN 2018087482W WO 2019001164 A1 WO2019001164 A1 WO 2019001164A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
contour
filter
tested
target area
Prior art date
Application number
PCT/CN2018/087482
Other languages
French (fr)
Chinese (zh)
Inventor
孔庆杰
Original Assignee
精锐视觉智能科技(深圳)有限公司
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 精锐视觉智能科技(深圳)有限公司 filed Critical 精锐视觉智能科技(深圳)有限公司
Publication of WO2019001164A1 publication Critical patent/WO2019001164A1/en

Links

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

Definitions

  • the invention belongs to the technical field of industrial detection, and in particular relates to a method for measuring concentricity of a filter and a terminal device.
  • the filter is an optical device used to select the desired radiation band. It can be applied to a camera lens to filter out infrared light and trim incident light.
  • the application requirements of filters are constantly increasing, and the quality requirements for filters are becoming higher and higher.
  • Filter manufacturers continue to standardize the quality requirements of filters while improving the production process.
  • Concentricity is an important quality parameter for filters and needs to be measured during production. The existing concentricity measurement mainly relies on manual measurement. The manual measurement method often has high labor cost, low measurement efficiency, low measurement accuracy, and measurement annotation is not standardized.
  • the embodiments of the present invention provide a method for measuring concentricity of a filter and a terminal device, so as to solve the problem that the measurement accuracy of the concentricity of the filter is low and the measurement efficiency is low.
  • a first aspect of the embodiments of the present invention provides a method for measuring concentricity of a filter, including:
  • the center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
  • a second aspect of the embodiments of the present invention provides a filter concentricity measuring apparatus, including:
  • An acquisition module configured to acquire an initial image including a filter
  • An extraction module configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image;
  • a denoising module configured to perform denoising processing on the image to be tested
  • a calculation module configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer contour of the filter And internal contours.
  • a third aspect of an embodiment of the present invention provides a filter concentricity measuring terminal device including a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor
  • the steps of the method implemented when the computer program is executed include:
  • the center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
  • a fourth aspect of the embodiments of the present invention provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and the steps of the method implemented when the computer program is executed by the processor include:
  • the center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
  • the embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested.
  • the first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved.
  • the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the filter can be improved, and the measurement efficiency is improved.
  • FIG. 1 is a flowchart of implementing a method for measuring concentricity of a filter according to an embodiment of the present invention
  • FIG. 4 is a flowchart of implementing a target area in a method for measuring concentricity of a filter according to an embodiment of the present invention
  • FIG. 5 is a flowchart of implementing denoising processing on an image to be measured in a method for measuring concentricity of a filter according to an embodiment of the present invention
  • FIG. 6 is a flowchart showing an implementation of calculating a center point position of a first contour and a second contour in a method for measuring concentricity of a filter according to an embodiment of the present invention
  • FIG. 7 is a schematic diagram of a filter concentricity measuring device according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a filter concentricity measuring terminal device according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of implementing a method for measuring concentricity of a filter according to an embodiment of the present invention, which is described in detail as follows:
  • the filters include, but are not limited to, a single camera filter and a dual camera filter.
  • a single camera filter can be placed on a light-transmissive tool, and a backlight can be used to project from the tool to the back of the single-camera filter.
  • the single camera filter is collected at this time.
  • the filter portion of the image is black and the rest of the background is white.
  • the coaxial parallel light can be used for illumination.
  • the image of the dual camera filter is white in the filter and the other background is black.
  • Figure 2 shows an image of several different configurations of single camera filters.
  • Figure 3 shows an image of a dual camera filter.
  • the center of the single camera filter is measured and the center of the inner glass is concentric; for the dual camera filter concentricity measurement, the measured is a dual camera The center of the outer structure of the filter glass region and the concentricity of the center of the inner structure of the glass region.
  • the number of the filters in the initial image containing the filter may be one, two or more, which is not limited herein.
  • the following embodiments are exemplified by concentricity measurement of a single filter in an image. When two or more filters are included in one image, reference is made to the method of measuring the concentricity of a single filter. Measurements are not repeated.
  • a target area image is extracted from the initial image, and the target area image is taken as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image.
  • the obtained initial image containing the filter may include more background parts, and the filter occupies a smaller proportion of the entire image.
  • the processing will be performed. There is too much invalid background information in the image information, which affects the speed of image processing and the accuracy of concentricity measurement. Therefore, the target area image corresponding to the outer contour of the filter may be extracted from the acquired initial image containing the filter, and the target area image is taken as the image to be tested. Subsequent image processing is performed only for the image to be measured, thereby improving the speed of image processing and the measurement accuracy of concentricity.
  • the target area image can be extracted by locating the position of the filter in the image.
  • S102 can include the following steps:
  • an outer contour of the filter is determined in the initial image; the outer contour is an outermost contour of the filter.
  • the outer contour of the filter can be obtained by performing binarization processing on the acquired initial image.
  • the outer contour refers to the outermost contour of the filter as a whole and the background area, that is, the contour of the area enclosed by the image.
  • the initial image is binarized using a large law.
  • the filter is positioned according to the external contour to obtain position information of the filter.
  • the position of the smallest circumscribed rectangle of the outer contour is the position of the filter.
  • the position information of the filter can be obtained based on the position information of the outer contour.
  • the target area image is extracted according to the location information, and the target area image is used as the image to be tested.
  • the target area is appropriately larger than the position of the filter.
  • the background area of the preset range may be extended to the outside at the position of the filter, and the image to be tested is extracted according to the position of the expanded background area.
  • the filter may not be completely collected on the image in the initial image of the captured filter (for example, the position of the filter is shifted or the position of the image capturing device is shifted) Before extracting the image of the target area, it can be judged according to the outer contour of the filter. If the minimum circumscribed rectangle of the outer contour is all located in the initial image, the initial image is a qualified image, and subsequent image extraction of the target area is performed; if the minimum circumscribed rectangle of the outer contour is not all located in the initial image, the initial image is not The qualified image is deleted, and no subsequent processing is performed.
  • the filter in the extracted image to be tested may be rotated and corrected.
  • the step of the rotation correction is: first copying the obtained image to be tested, performing the binarization of the copied image to be tested, and then performing the inversion operation on the image to be tested; extracting each contour in the image to be tested, excluding the maximum Outline outside the contour; extract the minimum circumscribed rectangle for the largest contour, and get the angle and the center of the rectangle. If the angle is less than the preset range, for example, -45 degrees, then the correction angle is the angle plus 90 degrees; The angle and the center of the rectangle are rotated by the affine transformation of the image to be measured. The rotated image is a binarized image, and the image is inverted and returned, and the rotation correction is completed.
  • the image of the filter acquired in S101 may contain defects due to environmental factors or factors of the image acquisition device, etc., for example, black dot noise occurs in a region of a white background, or a black filter region White point noise or the like occurs, so that the subsequently extracted image to be tested also contains noise. Therefore, the image to be measured can be denoised to avoid the measurement accuracy of the concentricity of the filter due to noise.
  • S103 may include the following steps:
  • the binarization operation refers to expressing all pixels of an image by one of two pixel values.
  • the gray value of the pixel on the image is set to 0 or 255, that is, the entire image is presented with a distinct black and white visual effect.
  • the inverse operation is to change the gray value of the pixel from 0 to 255, or from 255 to 0. From the visual effect, the black area and the white area on the image are interchanged.
  • each contour in the image to be tested after the binarization operation and the negation operation is extracted; each contour encloses a certain area area.
  • the area enclosed by a certain area refers to the area of the area enclosed by the closed curve constituting the outline.
  • the image may contain white point noise or black point noise.
  • the area enclosed by the contour corresponding to the noise tends to be small, and the area enclosed by the contour corresponding to the filter is usually large, so the noise and the filtering can be distinguished by comparing the area enclosed by the contour. sheet.
  • the area enclosed by each contour is sorted from large to small. The area of the area with a larger area is the contour corresponding to the filter, and the area of the area with a smaller area is the contour corresponding to the noise.
  • the front preset number of contours in the area of each contour in each contour is used as a template.
  • the front predetermined number of contours of the area from large to small refers to a preset number of contours in which the area enclosed by the contour is large. For example, if the preset number is 2, the contour with the largest area of the area enclosed in each contour and the contour with the largest area of the surrounding area are included, and the images of the two contours are included as templates.
  • each contour can be sorted according to the area of the enclosed area, and the area enclosed by the smaller number of the outline is larger.
  • a profile that is less than or equal to the preset contour number is used as a template. For example, if the contour numbers are 1, 2, 3, ..., n in order, the area enclosed by the contour No. 1 is the largest. If the preset contour number is 2, the contours of the sequence numbers 3, 4, ..., n are removed, and only the contours with the sequence number 1 and the sequence number 2 are reserved as templates. Therefore, in this way, the contour corresponding to the noise is removed, only the contour corresponding to the filter is retained, and the contour containing the preset number is generated to generate a template for denoising comparison.
  • the template obtained by S503 is an image containing only the corresponding contour of the filter, and the image is subjected to the inversion operation, so the template is interchanged with the black area and the white area of the image to be tested.
  • the contours of the image to be tested that do not exist in the template are removed, and the denoising process of the image to be measured can be realized. Removing the contours can set the point pixel values of the regions within the contour to coincide with the values of the pixels near the outside of the contour.
  • the pixel values of the corresponding pixels in the image to be tested are inconsistent, the pixel values of the pixel in the image to be tested remain unchanged; if two images are in the image If the pixel values of the pixels are the same, the pixel value of the pixel in the image to be tested is inverted (for example, the white point is changed to a black point).
  • noise pixel points in the image to be tested can be reduced, thereby improving the measurement accuracy of the concentricity of the filter.
  • central point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour of the filter and Internal outline.
  • the structure of the filter includes an outer contour and an inner contour.
  • the first contour in the image to be tested corresponds to the outer contour of the filter
  • the second contour in the image to be tested corresponds to the inner contour of the filter. Since the image to be measured may contain contours such as noise, only the center point positions of the first contour and the second contour are calculated when performing the concentricity measurement.
  • the concentricity can be expressed by the distance between the center point of the outer contour of the filter and the center point of the inner contour, so that the filter can be realized by calculating the center point position of the first contour and the center point position of the second contour. Measurement of concentricity.
  • S104 may include the following steps:
  • 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.
  • the structures of the single camera filter and the dual camera filter respectively correspond to two rectangles inside and outside, so in the image to be tested, the first contour and the second contour respectively correspond to a rectangle, and the rectangle can be searched by The position of the four edges is to determine the position of the rectangle. Then, the four vertex positions of the rectangle are calculated by four edges, and the two vertices of the diagonal of the rectangle are connected into a diagonal line. The intersection position of the two diagonal lines of the rectangle is the center point position of the rectangle, so it can be separately obtained. The center point position of the first contour and the second contour.
  • the rectangle corresponding to the first contour may be a minimum circumscribed rectangle of the first contour, or may be a maximum inscribed rectangle of the first contour;
  • the rectangle corresponding to the second contour may be a minimum circumscribed rectangle of the second contour, or may be The maximum inscribed rectangle of the second contour; the specific setting can be selected according to the actual situation, which is not limited herein.
  • the position of the center point of the first contour may be calculated first, and then the center point position of the second contour may be calculated, or the center point position of the second contour may be calculated first, and then the center point position of the first contour may be calculated, or two center points may be separately calculated at the same time.
  • Location not limited here.
  • the following is an example of a single camera filter and a dual camera filter.
  • the size parameter range of the filter is not subjected to subsequent processing of the image to be measured, and an error message is returned; if the height and width of the rectangle corresponding to the second contour conform to the size parameter range of the preset filter, respectively Extract the area within the preset range near the four edges of the rectangle (for example, the area extracted from the upper line may be the area where the upper line is the center and the height is half the height of the rectangle; the area extracted from the left line may be the center of the left line, the height An area that is half the width of the rectangle). Find the edge points adjacent to the black and white pixels in the extracted area, and straighten the edge points to obtain the four edges of the rectangle corresponding to the second contour, and further determine the center of the rectangle corresponding to the second contour. Point location.
  • the least squares straight line fitting is used, and the fitting is performed twice in succession, and after the first straight line fitting, the point where the straight line distance of the first fitting is greater than the preset distance is deleted, and the remaining Click the second straight line to fit.
  • the line thus fitted is more accurate, thereby improving the accuracy of concentricity detection.
  • the filter concentricity measurement result is qualified; if the center point position of the first contour is If the difference between the center point positions of the two contours is greater than a preset value, the filter concentricity measurement result is acceptable; in addition, the value of the filter concentricity may be returned.
  • the first contour is first extracted, and the minimum circumscribed rectangle of the first contour is obtained according to the first contour to obtain the center point position of the minimum circumscribed rectangle.
  • Extending outward according to the center point position of the minimum circumscribed rectangle searching for four edges of the rectangle corresponding to the second contour, respectively extracting regions within a preset range near the four edges of the rectangle. Find the edge points adjacent to the black and white pixels in the extracted area, and straighten the edge points to obtain the four edges of the rectangle corresponding to the second contour, and further determine the center of the rectangle corresponding to the second contour. Point location.
  • the outer frame area of the dual camera filter is a rectangular area with the annular area formed by the middle rectangle removed.
  • the outer region is extended to find the annular region, and the edge points adjacent to the black and white pixel points are searched in the annular region, and the edge points are straight-line fitted to obtain the first
  • the four edges of the rectangle corresponding to the contour further determine the position of the center point of the rectangle corresponding to the first contour.
  • S401 may include: according to the shape information of the filter, The position of the edge of the four edges of the rectangle corresponding to the first contour or the second contour to be compensated is compensated.
  • the structure type of the single camera filter includes a square structure, a concave structure, a convex structure, a concave structure on the upper and lower sides, and the like.
  • the shape information of the single camera filter includes, but is not limited to, convex width, convex height, upper concave width, upper concave height, lower concave width, lower concave height, overall part width and height, pixel precision, and judgment standard value.
  • the shape information of the dual camera filter includes, but is not limited to, one or more of the width, height, and pixel dimensions of the part.
  • the structure of the filter is a convex structure or a square structure, it is not necessary to compensate for the four edges of the rectangle corresponding to the first contour. If the structure of the filter is a concave structure or a concave structure, the four edges of the rectangle corresponding to the first contour need to be compensated. Because of the filter of the concave structure or the concave structure of the upper and lower sides, the edge of the edge of the black and white pixel found from the image to be tested is not the edge of the rectangle corresponding to the outer contour of the filter, that is, not corresponding to the first contour. The edge of the rectangle can only be obtained by compensating the corresponding rectangular edge of the first contour, and then the center point position of the first contour.
  • the edge of the black-and-white pixel edge point found from the image to be tested may be compensated in the corresponding direction according to the information of the upper concave width, the upper concave height, the lower concave width, and the lower concave height in the shape information of the filter. , thereby obtaining the four edges of the rectangle corresponding to the first contour. For example, if the direction of the depression of the concave structure or the concave and convex structural filter is defined as the Y direction, the edge of the found black and white pixel edge point is compensated in the Y direction.
  • a plurality of regions may be provided for the filters of different structure types.
  • the upper, lower, left, and right directions in the directions indicated in the following description are referred to by the part image in FIG. 2.
  • Single camera filters have four configurations. Taking the embossed structure as an example, the area of the uppermost convex portion is set as the first area, the right side area of the part is set as the second area, and the lower area of the part is set as the third area, and the left side area of the part is set. Set to the fourth area.
  • the locale of the other three structures refers to the locale of the convex structure.
  • the edge of the rectangle corresponding to the contour in the image to be measured is searched more efficiently, and the processing speed of the image is improved, thereby improving the measurement speed of the concentricity of the filter.
  • the embodiments of the present invention have the following advantages, specifically: 1.
  • the production process is simple; 2.
  • the measurement accuracy is high, the measurement accuracy is 0.005MM; 3.
  • the measurement filter has many kinds of shapes, and can be adapted to a plurality of different sizes.
  • the filter 4.
  • the method is simple, easy to maintain, can adapt to the actual engineering environment, and has high reliability. Therefore, the embodiments of the present invention can effectively overcome the difficulty that the prior art is difficult to solve in practical applications, and can truly achieve high-accuracy and high-efficiency measurement of the concentricity of the filter.
  • the embodiments of the present invention are directed to the need for quality inspection of filter production, and the use of computer vision technology to apply advanced image processing algorithms to engineering practice, enabling high-precision measurement of filter concentricity with maintenance
  • the advantages of simple operation and high reliability, especially for different types of filters produced on the production line, can meet the measurement requirements.
  • the embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested.
  • the first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved.
  • the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the filter can be improved, and the measurement efficiency is improved.
  • FIG. 7 is a schematic diagram of the filter concentricity measuring device provided by the embodiment of the present invention. For the convenience of explanation, only the parts related to the present embodiment are shown.
  • the apparatus includes an acquisition module 71, an extraction module 72, a denoising module 73, and a calculation module 74.
  • the obtaining module 71 is configured to acquire an initial image including a filter.
  • the extracting module 72 is configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image in the initial image corresponding to an outer contour of the filter.
  • the denoising module 73 is configured to perform denoising processing on the image to be tested.
  • a calculation module 74 configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer portion of the filter Outline and internal contours.
  • the extraction module 72 is configured to:
  • the denoising module 73 is configured to:
  • each contour respectively encloses a certain area area
  • Pre-predetermined number of contours of the area in each contour from large to small as a template
  • the image to be tested is processed according to the comparison result.
  • the calculation module 74 is configured to:
  • the calculation module 74 is configured to:
  • the position of the edge of the four edges of the rectangle corresponding to the first contour or the second contour to be compensated is compensated according to the shape information of the filter.
  • the embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested.
  • the first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved.
  • the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the filter can be improved, and the measurement efficiency is improved.
  • FIG. 8 is a schematic diagram of a filter concentricity measuring terminal device according to an embodiment of the present invention.
  • the filter concentricity measuring terminal device 8 of this embodiment includes a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and operable on the processor 80, For example, the filter concentricity measurement program.
  • the processor 80 executes the computer program 82, the steps in the above embodiments of the respective filter concentricity measuring methods are implemented, such as steps 101 to 104 shown in FIG.
  • the processor 80 when executing the computer program 82, implements the functions of the modules/units in the various apparatus embodiments described above, such as the functions of the modules 71-74 shown in FIG.
  • the computer program 82 can be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to complete this invention.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 82 in the filter concentricity measurement terminal device 8.
  • the computer program 82 can be divided into an acquisition module, an extraction module, a denoising module, and a calculation module, and the specific functions of each module are as follows:
  • An acquisition module configured to acquire an initial image including a filter
  • An extraction module configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image;
  • a denoising module configured to perform denoising processing on the image to be tested
  • a calculation module configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer contour of the filter And internal contours.
  • the filter concentricity measuring terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the filter concentricity measuring terminal device may include, but is not limited to, a processor 80 and a memory 81. It will be understood by those skilled in the art that FIG. 8 is only an example of the filter concentricity measuring terminal device 8, and does not constitute a limitation of the filter concentricity measuring terminal device 8, and may include more or less than the illustration. Components, or combinations of certain components, or different components, such as the filter concentricity measurement terminal device may also include input and output devices, network access devices, buses, and the like.
  • the so-called processor 80 can be a central processing unit (Central Processing Unit, CPU), can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 81 may be an internal storage unit of the filter concentricity measuring terminal device 8, such as a hard disk or a memory of the filter concentricity measuring terminal device 8.
  • the memory 81 may also be an external storage device of the filter concentricity measuring terminal device 8, for example, a plug-in hard disk equipped with the filter concentricity measuring terminal device 8, and a smart memory card (Smart Media Card) , SMC), Secure Digital (SD) card, flash card (Flash Card) and so on.
  • the memory 81 may also include both the internal storage unit of the filter concentricity measuring terminal device 8 and an external storage device.
  • the memory 81 is used to store the computer program and other programs and data required for the filter concentricity measurement terminal device.
  • the memory 81 can also be used to temporarily store data that has been output or is about to be output.
  • each functional unit and module in the foregoing system may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application.
  • the disclosed apparatus/terminal device and method may be implemented in other manners.
  • the device/terminal device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units.
  • components may be combined or integrated into another system, or some features may be omitted or not performed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the 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, the present invention implements all or part of the processes in the foregoing embodiments, and may also be completed by a computer program to instruct related hardware.
  • the computer program may be stored in a computer readable storage medium. The steps of the various method embodiments described above may be implemented when the program is executed by the processor.
  • the computer program comprises computer program code, which may be in the form of source code, object code form, executable file or some intermediate form.
  • the computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read-Only) Memory), random access memory (RAM, Random) Access Memory), electrical carrier signals, telecommunications signals, and software distribution media.
  • ROM Read Only memory
  • RAM Random Access Memory
  • electrical carrier signals telecommunications signals
  • telecommunications signals and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Length Measuring Devices By Optical Means (AREA)
  • Image Analysis (AREA)

Abstract

The present solution is applied in the technical field of industrial inspection and provides an optical filter concentricity measurement method and a terminal device. The method comprises: obtaining an initial image comprising an optical filter; extracting a target area image in the initial image as an image to be tested, the target area image being an image corresponding to an outer outline of the optical filter in the initial image; performing denoising on the image to be tested; and respectively calculating positions of central points of a first outline and a second outline in the denoised image to be tested, the first outline and the second outline respectively corresponding to an outer outline and an inner outline of the optical filter. According to the present solution, the concentricity of an optical filter is measured by using an image processing method, measurement precision for the concentricity of optical filters is improved, and measurement efficiency is also improved.

Description

滤光片同心度测量方法及终端设备Filter concentricity measuring method and terminal device 技术领域Technical field
本发明属于工业检测技术领域,尤其涉及一种滤光片同心度测量方法及终端设备。The invention belongs to the technical field of industrial detection, and in particular relates to a method for measuring concentricity of a filter and a terminal device.
背景技术Background technique
滤光片是一种用来选取所需辐射波段的光学器件,应用广泛,例如可以应用在摄像机镜头中起到滤除红外光、修整入射光线等作用。目前,滤光片的应用需求不断提高,对滤光片的质量要求也越来越高。滤光片生产厂家在提高生产工艺的同时,不断规范滤光片的质量要求。同心度作为滤光片一项重要的质量参数,在生产过程中需要进行测量。现有的同心度测量主要依靠人工测量,人工测量的方式往往人力成本高,测量效率低,并且测量精度低,测量标注也不规范。The filter is an optical device used to select the desired radiation band. It can be applied to a camera lens to filter out infrared light and trim incident light. At present, the application requirements of filters are constantly increasing, and the quality requirements for filters are becoming higher and higher. Filter manufacturers continue to standardize the quality requirements of filters while improving the production process. Concentricity is an important quality parameter for filters and needs to be measured during production. The existing concentricity measurement mainly relies on manual measurement. The manual measurement method often has high labor cost, low measurement efficiency, low measurement accuracy, and measurement annotation is not standardized.
技术问题technical problem
有鉴于此,本发明实施例提供了一种滤光片同心度测量方法及终端设备,以解决目前对滤光片同心度的测量精度低,测量效率低的问题。In view of this, the embodiments of the present invention provide a method for measuring concentricity of a filter and a terminal device, so as to solve the problem that the measurement accuracy of the concentricity of the filter is low and the measurement efficiency is low.
技术解决方案Technical solution
本发明实施例的第一方面提供了一种滤光片同心度测量方法,包括:A first aspect of the embodiments of the present invention provides a method for measuring concentricity of a filter, including:
获取包含滤光片的初始图像;Obtain an initial image containing the filter;
从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;Extracting a target area image from the initial image, using the target area image as an image to be tested; the target area image being an image corresponding to an outer contour of the filter in the initial image;
对所述待测图像进行去噪处理;Denoising the image to be tested;
分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。The center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
本发明实施例的第二方面提供了一种滤光片同心度测量装置,包括:A second aspect of the embodiments of the present invention provides a filter concentricity measuring apparatus, including:
获取模块,用于获取包含滤光片的初始图像;An acquisition module, configured to acquire an initial image including a filter;
提取模块,用于从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;An extraction module, configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image;
去噪模块,用于对所述待测图像进行去噪处理;a denoising module, configured to perform denoising processing on the image to be tested;
计算模块,用于分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。a calculation module, configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer contour of the filter And internal contours.
本发明实施例的第三方面提供了一种滤光片同心度测量终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现的方法的步骤包括:A third aspect of an embodiment of the present invention provides a filter concentricity measuring terminal device including a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor The steps of the method implemented when the computer program is executed include:
获取包含滤光片的初始图像;Obtain an initial image containing the filter;
从所述初始图像中提取目标区域图像,将所述目标区域作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;Extracting a target area image from the initial image, using the target area as an image to be tested; the target area image being an image corresponding to an outer contour of the filter in the initial image;
对所述待测图像进行去噪处理;Denoising the image to be tested;
分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。The center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
本发明实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现的方法的步骤包括:A fourth aspect of the embodiments of the present invention provides a computer readable storage medium, where the computer readable storage medium stores a computer program, and the steps of the method implemented when the computer program is executed by the processor include:
获取包含滤光片的初始图像;Obtain an initial image containing the filter;
从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;Extracting a target area image from the initial image, using the target area image as an image to be tested; the target area image being an image corresponding to an outer contour of the filter in the initial image;
对所述待测图像进行去噪处理;Denoising the image to be tested;
分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。The center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
有益效果Beneficial effect
本发明实施例对包含滤光片的初始图像进行处理,提取滤光片外部轮廓对应的目标区域图像作为待测图像,在待测图像中查找第一轮廓和第二轮廓的中心点位置。第一轮廓和第二轮廓分别对应了滤光片结构的两个轮廓,因此查找到的两个中心点位置即为滤光片结构中两个轮廓的中心点位置,通过对比两个中心点位置即能实现对滤光片同心度的测量。本发明实施例通过图像处理方法对滤光片的同心度进行测量,能够提高滤光片同心度的测量精度,同时提高测量效率。The embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested. The first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved. In the embodiment of the invention, the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the 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 used in the embodiments or the description of the prior art will be briefly described below. It is obvious that the drawings in the following description are only the present invention. For some embodiments, other drawings may be obtained from those of ordinary skill in the art without departing from the drawings.
图1是本发明实施例提供的滤光片同心度测量方法的实现流程图;1 is a flowchart of implementing a method for measuring concentricity of a filter according to an embodiment of the present invention;
图2是本发明一个实施例提供的单摄像头滤光片的图像;2 is an image of a single camera filter provided by an embodiment of the present invention;
图3是本发明一个实施例提供的双摄像头滤光片的图像;3 is an image of a dual camera filter provided by an embodiment of the present invention;
图4是本发明实施例提供的滤光片同心度测量方法中提出目标区域的实现流程图;4 is a flowchart of implementing a target area in a method for measuring concentricity of a filter according to an embodiment of the present invention;
图5是本发明实施例提供的滤光片同心度测量方法中对待测图像进行去噪处理的实现流程图;FIG. 5 is a flowchart of implementing denoising processing on an image to be measured in a method for measuring concentricity of a filter according to an embodiment of the present invention; FIG.
图6是本发明实施例提供的滤光片同心度测量方法中计算第一轮廓和第二轮廓的中心点位置的实现流程图;6 is a flowchart showing an implementation of calculating a center point position of a first contour and a second contour in a method for measuring concentricity of a filter according to an embodiment of the present invention;
图7是本发明实施例提供的滤光片同心度测量装置的示意图;7 is a schematic diagram of a filter concentricity measuring device according to an embodiment of the present invention;
图8是本发明实施例提供的滤光片同心度测量终端设备的示意图。FIG. 8 is a schematic diagram of a filter concentricity measuring terminal device according to an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本发明实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本发明。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本发明的描述。In the following description, for purposes of illustration and description However, it will be apparent to those skilled in the art that the present invention may be practiced in other embodiments without 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 invention.
为了说明本发明所述的技术方案,下面通过具体实施例来进行说明。In order to explain the technical solution described in the present invention, the following description will be made by way of specific embodiments.
图1为本发明实施例提供的滤光片同心度测量方法的实现流程图,详述如下:FIG. 1 is a flowchart of implementing a method for measuring concentricity of a filter according to an embodiment of the present invention, which is described in detail as follows:
在S101中,获取包含滤光片的初始图像。In S101, an initial image containing a filter is acquired.
在本实施例中,滤光片包括但不限于单摄像头滤光片和双摄像头滤光片。对于单摄像头滤光片的图像采集,可以将单摄像头滤光片防置在透光的冶具上,使用背光从冶具投射到单摄像头滤光片的背面,此时所采集到的单摄像头滤光片的图像中滤光片部分为黑色,其余背景为白色。对于双摄像头滤光片的图像采集,可以使用同轴平行光进行照射,此时所采集到的双摄像头滤光片的图像中滤光片中玻璃部分为白色,其余背景为黑色。图2所示为几种不同结构的单摄像头滤光片的图像。图3所示为双摄像头滤光片的图像。In this embodiment, the filters include, but are not limited to, a single camera filter and a dual camera filter. For image capture of a single camera filter, a single camera filter can be placed on a light-transmissive tool, and a backlight can be used to project from the tool to the back of the single-camera filter. The single camera filter is collected at this time. The filter portion of the image is black and the rest of the background is white. For the image acquisition of the dual camera filter, the coaxial parallel light can be used for illumination. In this case, the image of the dual camera filter is white in the filter and the other background is black. Figure 2 shows an image of several different configurations of single camera filters. Figure 3 shows an image of a dual camera filter.
对于单摄像头滤光片进行同心度测量,所测量的为单摄像头滤光片外部结构的中心和内部玻璃的中心的同心度;对于双摄像头滤光片进行同心度测量,所测量的为双摄像头滤光片玻璃区域的外部结构的中心和玻璃区域的内部结构的中心的同心度。For concentricity measurement of a single camera filter, the center of the single camera filter is measured and the center of the inner glass is concentric; for the dual camera filter concentricity measurement, the measured is a dual camera The center of the outer structure of the filter glass region and the concentricity of the center of the inner structure of the glass region.
容易想到地,获取到的包含滤光片的初始图像中滤光片的个数可以为一个、两个或多个,在此不作限定。后面的实施例均是以对图像中单个滤光片进行同心度测量来举例说明,当一幅图像中包含有两个或多个滤光片时,参照对单个滤光片同心度测量的方法进行测量,不再赘述。It is to be understood that the number of the filters in the initial image containing the filter may be one, two or more, which is not limited herein. The following embodiments are exemplified by concentricity measurement of a single filter in an image. When two or more filters are included in one image, reference is made to the method of measuring the concentricity of a single filter. Measurements are not repeated.
在S102中,从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像。In S102, a target area image is extracted from the initial image, and the target area image is taken as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image.
在本实施例中,获取到的包含滤光片的初始图像中可能包括的背景部分较多,而滤光片所占整幅图像的比例较小,此时如果直接进行图像处理,会使处理的图像信息中无效的背景信息太多,影响图像处理的速度以及同心度测量的精度。因此,可以先从获取到的包含滤光片的初始图像中提取出滤光片外部轮廓对应的目标区域图像,将目标区域图像作为待测图像。后续的图像处理仅仅针对待测图像进行,从而提高图像处理的速度和同心度的测量精度。In this embodiment, the obtained initial image containing the filter may include more background parts, and the filter occupies a smaller proportion of the entire image. At this time, if the image processing is directly performed, the processing will be performed. There is too much invalid background information in the image information, which affects the speed of image processing and the accuracy of concentricity measurement. Therefore, the target area image corresponding to the outer contour of the filter may be extracted from the acquired initial image containing the filter, and the target area image is taken as the image to be tested. Subsequent image processing is performed only for the image to be measured, thereby improving the speed of image processing and the measurement accuracy of concentricity.
作为本发明的一个实施例,可以通过对滤光片在图像中的位置进行定位,来提取目标区域图像。如图4所示,S102可以包括以下步骤:As an embodiment of the present invention, the target area image can be extracted by locating the position of the filter in the image. As shown in FIG. 4, S102 can include the following steps:
在S401中,在所述初始图像中确定滤光片的外部轮廓;所述外部轮廓为滤光片的最外围的轮廓。In S401, an outer contour of the filter is determined in the initial image; the outer contour is an outermost contour of the filter.
在本实施例中,可以通过对获取到的初始图像进行二值化处理,来获取滤光片的外部轮廓。其中,外部轮廓是指滤光片整体与背景区分开的最外围的轮廓,也就是图像中所围区域面积最大的轮廓。优选地,采用大律法对初始图像进行二值化处理。In this embodiment, the outer contour of the filter can be obtained by performing binarization processing on the acquired initial image. The outer contour refers to the outermost contour of the filter as a whole and the background area, that is, the contour of the area enclosed by the image. Preferably, the initial image is binarized using a large law.
在S402中,根据所述外部轮廓对滤光片进行定位,获取滤光片的位置信息。In S402, the filter is positioned according to the external contour to obtain position information of the filter.
在本实施例中,外部轮廓的最小外接矩形的位置即是滤光片的位置。根据外部轮廓的位置信息可以能得到滤光片的位置信息。In this embodiment, the position of the smallest circumscribed rectangle of the outer contour is the position of the filter. The position information of the filter can be obtained based on the position information of the outer contour.
在S403中,根据所述位置信息提取所述目标区域图像,将所述目标区域图像作为所述待测图像。In S403, the target area image is extracted according to the location information, and the target area image is used as the image to be tested.
在本实施例中,由于后续需要对待测图像进行旋转等处理,因此目标区域要适当大于滤光片的位置。可以在滤光片的位置上向外侧扩充预设范围的背景区域,根据所扩充的背景区域的位置提取待测图像。In this embodiment, since the image to be measured is subsequently subjected to rotation or the like, the target area is appropriately larger than the position of the filter. The background area of the preset range may be extended to the outside at the position of the filter, and the image to be tested is extracted according to the position of the expanded background area.
优选地,由于拍摄到的滤光片的初始图像中可能出现滤光片未能完整的采集到图像上的情况(例如滤光片摆放位置偏移或图像采集装置的位置偏移等情况),在提取目标区域图像前,可以根据滤光片的外部轮廓进行判断。若外部轮廓的最小外接矩形全部位于初始图像内,则该初始图像为合格的图像,进行后续的目标区域图像提取;若外部轮廓的最小外接矩形没有全部位于初始图像内,则该初始图像为不合格的图像,将该初始图像进行删除,不进行后续处理。Preferably, due to the fact that the filter may not be completely collected on the image in the initial image of the captured filter (for example, the position of the filter is shifted or the position of the image capturing device is shifted) Before extracting the image of the target area, it can be judged according to the outer contour of the filter. If the minimum circumscribed rectangle of the outer contour is all located in the initial image, the initial image is a qualified image, and subsequent image extraction of the target area is performed; if the minimum circumscribed rectangle of the outer contour is not all located in the initial image, the initial image is not The qualified image is deleted, and no subsequent processing is performed.
优选地,为便于后续处理,可以对提取到的待测图像中的滤光片进行旋转矫正。旋转矫正的步骤是:先将获得的待测图像复制一份,对复制的待测图像进行大津法二值化,随后对待测图像进行取反操作;提取待测图像中的各个轮廓,排除最大轮廓以外的轮廓;对最大的轮廓提取最小外接矩形,可以得到一个角度和矩形的中心,若角度小于预设范围的时候例如-45度,那么矫正角度就是该角度加上90度;根据获取到的角度和矩形中心用仿射变换对待测图像进行旋转,旋转的图像是二值化后的图像,对得到图像再进行取反,返回该图像,旋转矫正就完成了。Preferably, in order to facilitate subsequent processing, the filter in the extracted image to be tested may be rotated and corrected. The step of the rotation correction is: first copying the obtained image to be tested, performing the binarization of the copied image to be tested, and then performing the inversion operation on the image to be tested; extracting each contour in the image to be tested, excluding the maximum Outline outside the contour; extract the minimum circumscribed rectangle for the largest contour, and get the angle and the center of the rectangle. If the angle is less than the preset range, for example, -45 degrees, then the correction angle is the angle plus 90 degrees; The angle and the center of the rectangle are rotated by the affine transformation of the image to be measured. The rotated image is a binarized image, and the image is inverted and returned, and the rotation correction is completed.
在S103中,对所述待测图像进行去噪处理。In S103, the image to be tested is subjected to denoising processing.
在本实施例中,由于环境因素或图像采集装置的自身因素等,S101中获取到的滤光片的图像可能包含瑕疵点,例如白色背景的区域出现黑点噪声,或者黑色的滤光片区域出现白点噪声等,致使后续提取到的待测图像同样包含噪声。因此可以对待测图像进行去噪处理,避免因噪声影响滤光片同心度的测量精度。In this embodiment, the image of the filter acquired in S101 may contain defects due to environmental factors or factors of the image acquisition device, etc., for example, black dot noise occurs in a region of a white background, or a black filter region White point noise or the like occurs, so that the subsequently extracted image to be tested also contains noise. Therefore, the image to be measured can be denoised to avoid the measurement accuracy of the concentricity of the filter due to noise.
作为本发明的一个实施例,可以通过将待测图像与经过二值化处理和取反处理的图像模板进行对比,根据对比结果对所述待测图像进行去噪。如图5所示,S103可以包括以下步骤:As an embodiment of the present invention, the image to be tested is compared with the image template subjected to the binarization processing and the inverse processing, and the image to be tested is denoised according to the comparison result. As shown in FIG. 5, S103 may include the following steps:
在S501中,对所述待测图像进行二值化操作和取反操作。In S501, a binarization operation and a negation operation are performed on the image to be tested.
在本实施例中,二值化操作是指将图像所有像素采用两个像素值中的一种来表示。例如将图像上的像素点的灰度值设置为0或255,也就是将整个图像呈现出明显的只有黑和白的视觉效果。取反操作是将像素点的灰度值由0变为255,或由255变为0,从视觉效果上看是将图像上的黑色区域和白色区域互换颜色。In the present embodiment, the binarization operation refers to expressing all pixels of an image by one of two pixel values. For example, the gray value of the pixel on the image is set to 0 or 255, that is, the entire image is presented with a distinct black and white visual effect. The inverse operation is to change the gray value of the pixel from 0 to 255, or from 255 to 0. From the visual effect, the black area and the white area on the image are interchanged.
在S502中,提取经过二值化操作和取反操作后的待测图像中的各个轮廓;各个轮廓分别围成一定的区域面积。In S502, each contour in the image to be tested after the binarization operation and the negation operation is extracted; each contour encloses a certain area area.
在本实施例中,轮廓围成一定的区域面积是指由构成轮廓的闭合曲线所围成的区域的面积。待测图像进行二值化和取反操作后,图像中可能包含白点噪声或黑点噪声。其中,噪声对应的轮廓所围成的区域面积往往较小,而滤光片对应的轮廓所围成的区域面积通常较大,因此可以通过比较轮廓所围成的区域面积区分出噪声和滤光片。对各个轮廓分别围成的面积按从大到小进行排序,面积较大的区域轮廓为滤光片对应的轮廓,面积较小的的区域轮廓为噪声对应的轮廓。In the present embodiment, the area enclosed by a certain area refers to the area of the area enclosed by the closed curve constituting the outline. After the image to be tested is binarized and inverted, the image may contain white point noise or black point noise. Wherein, the area enclosed by the contour corresponding to the noise tends to be small, and the area enclosed by the contour corresponding to the filter is usually large, so the noise and the filtering can be distinguished by comparing the area enclosed by the contour. sheet. The area enclosed by each contour is sorted from large to small. The area of the area with a larger area is the contour corresponding to the filter, and the area of the area with a smaller area is the contour corresponding to the noise.
在S503中,将各个轮廓中区域面积由大到小的前预设个数轮廓作为模板。In S503, the front preset number of contours in the area of each contour in each contour is used as a template.
在本实施例中,区域面积由大到小的前预设个数轮廓是指轮廓中所围成的区域面积较大的预设个数的轮廓。例如预设个数为2,则是将各个轮廓中所围区域面积最大的轮廓和所围区域面积次最大的轮廓,包含这两个轮廓的图像作为模板。In the present embodiment, the front predetermined number of contours of the area from large to small refers to a preset number of contours in which the area enclosed by the contour is large. For example, if the preset number is 2, the contour with the largest area of the area enclosed in each contour and the contour with the largest area of the surrounding area are included, and the images of the two contours are included as templates.
作为本发明的一个实施示例,可以将各个轮廓按照所围成的区域面积进行排序,序号较小的轮廓所围成的区域面积较大。将小于等于预设轮廓号的轮廓作为模板。例如,若轮廓序号依次为1,2,3,……,n,则1号轮廓所围成的区域面积最大。若预设轮廓号为2,则将序号为3,4,……,n的轮廓进行去除,仅保留序号为1和序号为2的轮廓作为模板。因此,通过此方式将噪声对应的轮廓进行去除,仅保留滤光片对应的轮廓,将包含前预设个数的轮廓生成用于去噪对比的模板。As an embodiment of the present invention, each contour can be sorted according to the area of the enclosed area, and the area enclosed by the smaller number of the outline is larger. A profile that is less than or equal to the preset contour number is used as a template. For example, if the contour numbers are 1, 2, 3, ..., n in order, the area enclosed by the contour No. 1 is the largest. If the preset contour number is 2, the contours of the sequence numbers 3, 4, ..., n are removed, and only the contours with the sequence number 1 and the sequence number 2 are reserved as templates. Therefore, in this way, the contour corresponding to the noise is removed, only the contour corresponding to the filter is retained, and the contour containing the preset number is generated to generate a template for denoising comparison.
在S504中,对比所述待测图像和所述模板,根据对比结果处理所述待测图像。In S504, comparing the image to be tested and the template, the image to be tested is processed according to the comparison result.
在本实施例中,由S503所得到的模板为仅包含滤光片对应轮廓的图像,且图像经过取反操作,所以模板与待测图像的黑色区域和白色区域互换。通过对比待测图像和模板,将待测图像中不存在于模板中的轮廓进行去除,可以实现对待测图像的去噪处理。将轮廓去除可以将轮廓内区域的点像素值设置成与轮廓外附近的像素点的值一致。具体地,分别对比待测图像和模板中对应像素点的像素值,若两幅图像中像素点的像素值不一致,则待测图像中该像素点的像素值保持不变;若两幅图像中像素点的像素值一致,则待测图像中该像素点的像素值进行取反(例如将白点变为黑点)。In this embodiment, the template obtained by S503 is an image containing only the corresponding contour of the filter, and the image is subjected to the inversion operation, so the template is interchanged with the black area and the white area of the image to be tested. By comparing the image to be tested and the template, the contours of the image to be tested that do not exist in the template are removed, and the denoising process of the image to be measured can be realized. Removing the contours can set the point pixel values of the regions within the contour to coincide with the values of the pixels near the outside of the contour. Specifically, comparing the pixel values of the corresponding pixels in the image to be tested and the template respectively, if the pixel values of the pixels in the two images are inconsistent, the pixel values of the pixel in the image to be tested remain unchanged; if two images are in the image If the pixel values of the pixels are the same, the pixel value of the pixel in the image to be tested is inverted (for example, the white point is changed to a black point).
通过对待测图像进行去噪处理,能够减少待测图像中的噪声像素点,从而提高滤光片同心度的测量精度。By performing denoising processing on the image to be measured, noise pixel points in the image to be tested can be reduced, thereby improving the measurement accuracy of the concentricity of the filter.
在S104中,分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。In S104, central point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour of the filter and Internal outline.
在本实施例中,滤光片的结构包括外部轮廓和内部轮廓。待测图像中的第一轮廓对应于滤光片的外部轮廓,待测图像中第二轮廓对应于滤光片的内部轮廓。由于待测图像中可能包含噪声等的轮廓,因此在进行同心度测量时只计算第一轮廓和第二轮廓的中心点位置。同心度可以通过滤光片外部轮廓的中心点和内部轮廓的中心点之间的距离来表示,因此通过计算得出第一轮廓的中心点位置和第二轮廓的中心点位置可以实现滤光片同心度的测量。In this embodiment, the structure of the filter includes an outer contour and an inner contour. The first contour in the image to be tested corresponds to the outer contour of the filter, and the second contour in the image to be tested corresponds to the inner contour of the filter. Since the image to be measured may contain contours such as noise, only the center point positions of the first contour and the second contour are calculated when performing the concentricity measurement. The concentricity can be expressed by the distance between the center point of the outer contour of the filter and the center point of the inner contour, so that the filter can be realized by calculating the center point position of the first contour and the center point position of the second contour. Measurement of concentricity.
作为本发明的一个实施例,可以查找第一轮廓和第二轮廓对应的矩形的四条边线位置,并通过矩形的四条位置确定矩形的中心点位置,如图6所示,S104可以包括以下步骤:As an embodiment of the present invention, the four edge positions of the rectangle corresponding to the first contour and the second contour may be searched, and the center point position of the rectangle is determined by the four positions of the rectangle. As shown in FIG. 6, S104 may include the following steps:
在S601中,分别查找所述待测图像中所述第一轮廓和所述第二轮廓对应的矩形的四条边线位置。In S601, four edge positions of the rectangle corresponding to the first contour and the second contour in the image to be tested are respectively searched.
在S602中,根据所述四条边线位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的四个顶点位置。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.
在S603中,根据所述四个顶点位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的中心点位置。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 filter and the dual camera filter respectively correspond to two rectangles inside and outside, so in the image to be tested, the first contour and the second contour respectively correspond to a rectangle, and the rectangle can be searched by The position of the four edges is to determine the position of the rectangle. Then, the four vertex positions of the rectangle are calculated by four edges, and the two vertices of the diagonal of the rectangle are connected into a diagonal line. The intersection position of the two diagonal lines of the rectangle is the center point position of the rectangle, so it can be separately obtained. The center point position of the first contour and the second contour.
其中,第一轮廓对应的矩形可以是第一轮廓的最小外接矩形,也可以是第一轮廓的最大内接矩形;第二轮廓对应的矩形可以是第二轮廓的最小外接矩形,也可以是第二轮廓的最大内接矩形;具体设置可以根据实际情况进行选择,在此不作限定。The rectangle corresponding to the first contour may be a minimum circumscribed rectangle of the first contour, or may be a maximum inscribed rectangle of the first contour; the rectangle corresponding to the second contour may be a minimum circumscribed rectangle of the second contour, or may be The maximum inscribed rectangle of the second contour; the specific setting can be selected according to the actual situation, which is not limited herein.
可以先计算第一轮廓的中心点位置再计算第二轮廓的中心点位置,也可以先计算第二轮廓的中心点位置再计算第一轮廓的中心点位置,或者同时分别计算两个中心点的位置,在此不作限定。The position of the center point of the first contour may be calculated first, and then the center point position of the second contour may be calculated, or the center point position of the second contour may be calculated first, and then the center point position of the first contour may be calculated, or two center points may be separately calculated at the same time. Location, not limited here.
下面分别用以单摄像头滤光片和双摄像头滤光片为例进行说明。The following is an example of a single camera filter and a dual camera filter.
对于单摄像头滤光片,首先提取第二轮廓,判断第二轮廓所对应的矩形的高和宽是否符合滤光片的尺寸参数,若第二轮廓所对应的矩形的高和宽不符合预设的滤光片的尺寸参数范围,则不对待测图像进行后续处理,同时返回错误提示信息;若第二轮廓所对应的矩形的高和宽符合预设的滤光片的尺寸参数范围,则分别提取矩形的四条边线附近预设范围内的区域(例如对上边线提取的区域可以为以上边线为中央,高度为矩形高度一半的区域;对左边线提取的区域可以为以左边线为中央,高度为矩形宽度一半的区域)。查找提取到的区域中黑白像素点相邻的边缘点,对这些边缘点进行直线拟合,可以得到第二轮廓所对应的矩形的四条边线,再进一步求出第二轮廓所对应的矩形的中心点位置。For the single camera filter, first extracting the second contour, determining whether the height and width of the rectangle corresponding to the second contour conform to the size parameter of the filter, and if the height and width of the rectangle corresponding to the second contour do not meet the preset The size parameter range of the filter is not subjected to subsequent processing of the image to be measured, and an error message is returned; if the height and width of the rectangle corresponding to the second contour conform to the size parameter range of the preset filter, respectively Extract the area within the preset range near the four edges of the rectangle (for example, the area extracted from the upper line may be the area where the upper line is the center and the height is half the height of the rectangle; the area extracted from the left line may be the center of the left line, the height An area that is half the width of the rectangle). Find the edge points adjacent to the black and white pixels in the extracted area, and straighten the edge points to obtain the four edges of the rectangle corresponding to the second contour, and further determine the center of the rectangle corresponding to the second contour. Point location.
优选地,采用最小二乘直线拟合,先后进行两次拟合,在第一次直线拟合后将与第一次拟合出的直线距离大于预设距离的点删除,再利用剩下的点第二次进行直线拟合。由此拟合得到的直线更为准确,从而提高同心度检测精度。Preferably, the least squares straight line fitting is used, and the fitting is performed twice in succession, and after the first straight line fitting, the point where the straight line distance of the first fitting is greater than the preset distance is deleted, and the remaining Click the second straight line to fit. The line thus fitted is more accurate, thereby improving the accuracy of concentricity detection.
根据第二轮廓所对应的矩形的中心点位置向外查找第一轮廓对应的矩形的四条边线,分别提取矩形的四条边线附近预设范围内的区域。查找提取到的区域中黑白像素点相邻的边缘点,对这些边缘点进行直线拟合,可以得到第一轮廓所对应的矩形的四条边线,再进一步求出第一轮廓所对应的矩形的中心点位置。Finding four edges of the rectangle corresponding to the first contour outward according to the center point position of the rectangle corresponding to the second contour, respectively extracting regions within a preset range near the four edges of the rectangle. Find the edge points adjacent to the black and white pixels in the extracted area, and straighten the edge points to obtain the four edges of the rectangle corresponding to the first contour, and further find the center of the rectangle corresponding to the first contour. Point location.
若第一轮廓的中心点位置和第二轮廓的中心点位置之间的差值小于或等于预设值,则该滤光片同心度测量结果为合格;若第一轮廓的中心点位置和第二轮廓的中心点位置之间的差值大于预设值,则该滤光片同心度测量结果为合格;此外也可以返回滤光片同心度的值。If the difference between the center point position of the first contour and the center point position of the second contour is less than or equal to a preset value, the filter concentricity measurement result is qualified; if the center point position of the first contour is If the difference between the center point positions of the two contours is greater than a preset value, the filter concentricity measurement result is acceptable; in addition, the value of the filter concentricity may be returned.
对于双摄像头滤光片,首先提取第一轮廓,根据第一轮廓获取第一轮廓的最小外接矩形,得出最小外接矩形的中心点位置。根据最小外接矩形的中心点位置向外延伸,查找第二轮廓对应的矩形的四条边线,分别提取矩形的四条边线附近预设范围内的区域。查找提取到的区域中黑白像素点相邻的边缘点,对这些边缘点进行直线拟合,可以得到第二轮廓所对应的矩形的四条边线,再进一步求出第二轮廓所对应的矩形的中心点位置。For the dual camera filter, the first contour is first extracted, and the minimum circumscribed rectangle of the first contour is obtained according to the first contour to obtain the center point position of the minimum circumscribed rectangle. Extending outward according to the center point position of the minimum circumscribed rectangle, searching for four edges of the rectangle corresponding to the second contour, respectively extracting regions within a preset range near the four edges of the rectangle. Find the edge points adjacent to the black and white pixels in the extracted area, and straighten the edge points to obtain the four edges of the rectangle corresponding to the second contour, and further determine the center of the rectangle corresponding to the second contour. Point location.
如图3所示,双摄像头滤光片的外部框架区域,是一个矩形区域去掉了中间的矩形所形成的环状区域。可以根据第二轮廓所对应的矩形的中心点位置,向外延伸,查找到环状区域,在环状区域查找黑白像素点相邻的边缘点,对这些边缘点进行直线拟合,可以得到第一轮廓所对应的矩形的四条边线,再进一步求出第一轮廓所对应的矩形的中心点位置。As shown in Fig. 3, the outer frame area of the dual camera filter is a rectangular area with the annular area formed by the middle rectangle removed. According to the position of the center point of the rectangle corresponding to the second contour, the outer region is extended to find the annular region, and the edge points adjacent to the black and white pixel points are searched in the annular region, and the edge points are straight-line fitted to obtain the first The four edges of the rectangle corresponding to the contour further determine the position of the center point of the rectangle corresponding to the first contour.
作为本发明的一个实施例,由于滤光片零件的形状有多种,对于某些结构滤光片在待测图像中的矩形需要进行补偿,S401可以包括:根据滤光片的形状信息,对所述第一轮廓或所述第二轮廓对应的矩形的四条边线中需要进行补偿的边线的位置进行补偿。As an embodiment of the present invention, since there are various shapes of the filter parts, for some structures, the rectangular shape of the filter in the image to be tested needs to be compensated, and S401 may include: according to the shape information of the filter, The position of the edge of the four edges of the rectangle corresponding to the first contour or the second contour to be compensated is compensated.
在本实施例中,如图2所示,单摄像头滤光片的结构种类包括方形结构、凹字结构、凸字结构、上下都凹的结构等。单摄像头滤光片的形状信息包括但不限于凸宽、凸高、上凹宽、上凹高、下凹宽、下凹高、整体零件的宽和高、象元精度和判断标准值中的一种或多种。双摄像头滤光片的形状信息包括但不限于零件的宽、高和像元尺寸中的一个或多个。In the present embodiment, as shown in FIG. 2, the structure type of the single camera filter includes a square structure, a concave structure, a convex structure, a concave structure on the upper and lower sides, and the like. The shape information of the single camera filter includes, but is not limited to, convex width, convex height, upper concave width, upper concave height, lower concave width, lower concave height, overall part width and height, pixel precision, and judgment standard value. One or more. The shape information of the dual camera filter includes, but is not limited to, one or more of the width, height, and pixel dimensions of the part.
对于单摄像头滤光片,若滤光片的结构为凸字结构或方形结构,则不需要对第一轮廓对应的矩形的四条边线进行补偿。若滤光片的结构为凹字结构或上下都凹的结构,则需要对第一轮廓对应的矩形的四条边线进行补偿。因为对于凹字结构或上下都凹的结构的滤光片,从待测图像中查找到的黑白像素边缘点的边线并不是滤光片外部轮廓对应的矩形的边线,即不是第一轮廓对应的矩形的边线,只有通过补偿后才能得出第一轮廓的对应的矩形边线、进而得出第一轮廓的中心点位置。For a single camera filter, if the structure of the filter is a convex structure or a square structure, it is not necessary to compensate for the four edges of the rectangle corresponding to the first contour. If the structure of the filter is a concave structure or a concave structure, the four edges of the rectangle corresponding to the first contour need to be compensated. Because of the filter of the concave structure or the concave structure of the upper and lower sides, the edge of the edge of the black and white pixel found from the image to be tested is not the edge of the rectangle corresponding to the outer contour of the filter, that is, not corresponding to the first contour. The edge of the rectangle can only be obtained by compensating the corresponding rectangular edge of the first contour, and then the center point position of the first contour.
具体地,可以根据滤光片的形状信息中的上凹宽、上凹高、下凹宽、下凹高等信息对从待测图像中查找到的黑白像素边缘点的边线进行相应方向上的补偿,从而得出第一轮廓对应的矩形的四条边线。例如,若将凹字结构或上下都凹的结构滤光片的凹陷的方向定义为Y方向,则对查找到的黑白像素边缘点的边线在Y方向进行补偿。Specifically, the edge of the black-and-white pixel edge point found from the image to be tested may be compensated in the corresponding direction according to the information of the upper concave width, the upper concave height, the lower concave width, and the lower concave height in the shape information of the filter. , thereby obtaining the four edges of the rectangle corresponding to the first contour. For example, if the direction of the depression of the concave structure or the concave and convex structural filter is defined as the Y direction, the edge of the found black and white pixel edge point is compensated in the Y direction.
作为本发明的一个实施例,为便于查找待测图像中滤光片的轮廓边缘,可以对不同结构类型的滤光片设置多个区域。为便于说明,以下叙述中所指的方向上的上、下、左、右均以图2中的零件图像为参照。单摄像头滤光片共有四种结构。以凸字结构为例,将最上方凸出部分的区域设置为第一区域,将零件的右侧区域设置为第二区域,将零件的下方区域设置为第三区域,将零件的左侧区域设置为第四区域。其他三种结构的区域设置参照凸字结构的区域设置。As an embodiment of the present invention, in order to facilitate finding the contour edge of the filter in the image to be tested, a plurality of regions may be provided for the filters of different structure types. For convenience of explanation, the upper, lower, left, and right directions in the directions indicated in the following description are referred to by the part image in FIG. 2. Single camera filters have four configurations. Taking the embossed structure as an example, the area of the uppermost convex portion is set as the first area, the right side area of the part is set as the second area, and the lower area of the part is set as the third area, and the left side area of the part is set. Set to the fourth area. The locale of the other three structures refers to the locale of the convex structure.
在查找轮廓中黑白像素边缘点的边线时,可以分别对四个区域进行扫描。其中,一三区域采用列扫描,二四区域采用行扫描。当扫描到像素点的像素值变化时就停止当前行或列的扫描,并继续进行下一行或列的扫描,并将该点坐标进行保存。当四个区域的扫描完成后,对保存的点坐标进行处理。一三区域得到的点坐标按照Y坐标进行从大到小的顺序排列,并排除Y坐标靠前和靠后的一部分点;二四区域得到的点坐标按照X坐标进行从大到小排列,并排除X坐标靠前和靠后的一部分点。根据查找的点坐标可以进行直线拟合,进而求出滤光片外部轮廓或内部轮廓对应的矩形的四条边线。When you find the edge of a black and white pixel edge point in the outline, you can scan the four areas separately. Among them, one or three areas use column scanning, and the second and fourth areas use line scanning. When the pixel value of the scanned pixel changes, the current row or column scan is stopped, and the next row or column scan is continued, and the coordinates of the point are saved. When the scanning of the four areas is completed, the saved point coordinates are processed. The point coordinates obtained by one or three regions are arranged in descending order according to the Y coordinate, and some points before and after the Y coordinate are excluded; the point coordinates obtained by the second and fourth regions are arranged in accordance with the X coordinate from large to small, and Exclude a portion of the X coordinate front and back. According to the coordinates of the found points, a straight line fit can be performed to find the four edges of the rectangle corresponding to the outer contour or the inner contour of the filter.
通过设置区域,使对待测图像中轮廓对应的矩形的边线查找效率更高,提高图像的处理速度,进而提高滤光片同心度的测量速度。By setting the area, the edge of the rectangle corresponding to the contour in the image to be measured is searched more efficiently, and the processing speed of the image is improved, thereby improving the measurement speed of the concentricity of the filter.
综上所述,本发明实施例具有以下优点,具体为:1. 制作程序简单;2. 测量精度高,测量精度为0.005MM;3. 测量滤光片形状种类多,可以适应多种不同尺寸的滤光片;4. 方法简单,维护方便,能很好适应实际工程环境,具有较高可靠性。因此,本发明实施例能够有效克服现有技术在实际应用方面难以解决的困难,可以真正实现对滤光片同心度的高精度高效率测量。In summary, the embodiments of the present invention have the following advantages, specifically: 1. The production process is simple; 2. The measurement accuracy is high, the measurement accuracy is 0.005MM; 3. The measurement filter has many kinds of shapes, and can be adapted to a plurality of different sizes. The filter; 4. The method is simple, easy to maintain, can adapt to the actual engineering environment, and has high reliability. Therefore, the embodiments of the present invention can effectively overcome the difficulty that the prior art is difficult to solve in practical applications, and can truly achieve high-accuracy and high-efficiency measurement of the concentricity of the filter.
另外,本发明实施例针对滤光片生产质量检测的需要,利用计算机视觉技术,将先进的图像处理算法真正的应用于工程实践中,能够实现对滤光片同心度的高精度测量,具有维护操作简便、可靠性强等优点,特别是针对生产线上生产的不同规格类型的滤光片,都可以满足测量要求。实现一套测量设备,对全套产品质量检测的需求。In addition, the embodiments of the present invention are directed to the need for quality inspection of filter production, and the use of computer vision technology to apply advanced image processing algorithms to engineering practice, enabling high-precision measurement of filter concentricity with maintenance The advantages of simple operation and high reliability, especially for different types of filters produced on the production line, can meet the measurement requirements. A set of measuring equipment to meet the needs of a full set of product quality testing.
本发明实施例对包含滤光片的初始图像进行处理,提取滤光片外部轮廓对应的目标区域图像作为待测图像,在待测图像中查找第一轮廓和第二轮廓的中心点位置。第一轮廓和第二轮廓分别对应了滤光片结构的两个轮廓,因此查找到的两个中心点位置即为滤光片结构中两个轮廓的中心点位置,通过对比两个中心点位置即能实现对滤光片同心度的测量。本发明实施例通过图像处理方法对滤光片的同心度进行测量,能够提高滤光片同心度的测量精度,同时提高测量效率。The embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested. The first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved. In the embodiment of the invention, the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the filter can be improved, and the measurement efficiency is improved.
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本发明实施例的实施过程构成任何限定。It should be understood that the size of the sequence of the steps in the above embodiments does not imply a sequence of executions, and the order of execution of the processes should be determined by its function and internal logic, and should not be construed as limiting the implementation of the embodiments of the present invention.
对应于上文实施例所述的滤光片同心度测量方法,图7示出了本发明实施例提供的滤光片同心度测量装置的示意图。为了便于说明,仅示出了与本实施例相关的部分。Corresponding to the filter concentricity measuring method described in the above embodiments, FIG. 7 is a schematic diagram of the filter concentricity measuring device provided by the embodiment of the present invention. For the convenience of explanation, only the parts related to the present embodiment are shown.
参照图7,该装置包括获取模块71、提取模块72、去噪模块73和计算模块74。Referring to FIG. 7, the apparatus includes an acquisition module 71, an extraction module 72, a denoising module 73, and a calculation module 74.
获取模块71,用于获取包含滤光片的初始图像。The obtaining module 71 is configured to acquire an initial image including a filter.
提取模块72,用于从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像。The extracting module 72 is configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image in the initial image corresponding to an outer contour of the filter.
去噪模块73,用于对所述待测图像进行去噪处理。The denoising module 73 is configured to perform denoising processing on the image to be tested.
计算模块74,用于分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。a calculation module 74, configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer portion of the filter Outline and internal contours.
优选地,所述提取模块72用于:Preferably, the extraction module 72 is configured to:
在所述初始图像中确定滤光片的外部轮廓;所述外部轮廓为滤光片的最外围的轮廓;Determining an outer contour of the filter in the initial image; the outer contour being an outermost contour of the filter;
根据所述外部轮廓对滤光片进行定位,获取滤光片的位置信息;Positioning the filter according to the outer contour to obtain position information of the filter;
根据所述位置信息提取所述目标区域图像,将所述目标区域图像作为所述待测图像。Extracting the target area image according to the location information, and using the target area image as the image to be tested.
优选地,所述去噪模块73用于:Preferably, the denoising module 73 is configured to:
对所述待测图像进行二值化操作和取反操作;Performing a binarization operation and a negation operation on the image to be tested;
提取经过二值化操作和取反操作后的待测图像中的各个轮廓;各个轮廓分别围成一定的区域面积;Extracting each contour in the image to be tested after the binarization operation and the inversion operation; each contour respectively encloses a certain area area;
将各个轮廓中区域面积由大到小的前预设个数轮廓作为模板;Pre-predetermined number of contours of the area in each contour from large to small as a template;
对比所述待测图像和所述模板,根据对比结果处理所述待测图像。Comparing the image to be tested and the template, the image to be tested is processed according to the comparison result.
优选地,所述计算模块74用于:Preferably, the calculation module 74 is configured to:
分别查找所述待测图像中所述第一轮廓和所述第二轮廓对应的矩形的四条边线位置;Searching, respectively, four edge positions of the rectangle corresponding to the first contour and the second contour in the image to be tested;
根据所述四条边线位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的四个顶点位置;Calculating four vertex positions of the rectangle corresponding to the first contour and the second contour according to the four edge positions;
根据所述四个顶点位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的中心点位置。Calculating a center point position of the rectangle corresponding to the first contour and the second contour according to the four vertex positions.
优选地,所述计算模块74用于:Preferably, the calculation module 74 is configured to:
根据滤光片的形状信息,对所述第一轮廓或所述第二轮廓对应的矩形的四条边线中需要进行补偿的边线的位置进行补偿。The position of the edge of the four edges of the rectangle corresponding to the first contour or the second contour to be compensated is compensated according to the shape information of the filter.
本发明实施例对包含滤光片的初始图像进行处理,提取滤光片外部轮廓对应的目标区域图像作为待测图像,在待测图像中查找第一轮廓和第二轮廓的中心点位置。第一轮廓和第二轮廓分别对应了滤光片结构的两个轮廓,因此查找到的两个中心点位置即为滤光片结构中两个轮廓的中心点位置,通过对比两个中心点位置即能实现对滤光片同心度的测量。本发明实施例通过图像处理方法对滤光片的同心度进行测量,能够提高滤光片同心度的测量精度,同时提高测量效率。The embodiment of the present invention processes the initial image including the filter, extracts the image of the target area corresponding to the outer contour of the filter as the image to be tested, and searches for the center point position of the first contour and the second contour in the image to be tested. The first contour and the second contour respectively correspond to the two contours of the filter structure, so the two center point positions found are the center point positions of the two contours in the filter structure, by comparing the two center point positions That is, the measurement of the concentricity of the filter can be achieved. In the embodiment of the invention, the concentricity of the filter is measured by the image processing method, and the measurement precision of the concentricity of the filter can be improved, and the measurement efficiency is improved.
图8是本发明一实施例提供的滤光片同心度测量终端设备的示意图。如图8所示,该实施例的滤光片同心度测量终端设备8包括:处理器80、存储器81以及存储在所述存储器81中并可在所述处理器80上运行的计算机程序82,例如滤光片同心度测量程序。所述处理器80执行所述计算机程序82时实现上述各个滤光片同心度测量方法实施例中的步骤,例如图1所示的步骤101至104。或者,所述处理器80执行所述计算机程序82时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块71至74的功能。FIG. 8 is a schematic diagram of a filter concentricity measuring terminal device according to an embodiment of the present invention. As shown in FIG. 8, the filter concentricity measuring terminal device 8 of this embodiment includes a processor 80, a memory 81, and a computer program 82 stored in the memory 81 and operable on the processor 80, For example, the filter concentricity measurement program. When the processor 80 executes the computer program 82, the steps in the above embodiments of the respective filter concentricity measuring methods are implemented, such as steps 101 to 104 shown in FIG. Alternatively, the processor 80, when executing the computer program 82, implements the functions of the modules/units in the various apparatus embodiments described above, such as the functions of the modules 71-74 shown in FIG.
示例性的,所述计算机程序82可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器81中,并由所述处理器80执行,以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序82在所述滤光片同心度测量终端设备8中的执行过程。例如,所述计算机程序82可以被分割成获取模块、提取模块、去噪模块和计算模块,各模块具体功能如下:Illustratively, the computer program 82 can be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80 to complete this invention. The one or more modules/units may be a series of computer program instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 82 in the filter concentricity measurement terminal device 8. . For example, the computer program 82 can be divided into an acquisition module, an extraction module, a denoising module, and a calculation module, and the specific functions of each module are as follows:
获取模块,用于获取包含滤光片的初始图像;An acquisition module, configured to acquire an initial image including a filter;
提取模块,用于从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中滤光片外部轮廓对应的图像;An extraction module, configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image;
去噪模块,用于对所述待测图像进行去噪处理;a denoising module, configured to perform denoising processing on the image to be tested;
计算模块,用于分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。a calculation module, configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer contour of the filter And internal contours.
所述滤光片同心度测量终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述滤光片同心度测量终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是滤光片同心度测量终端设备8的示例,并不构成对滤光片同心度测量终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述滤光片同心度测量终端设备还可以包括输入输出设备、网络接入设备、总线等。The filter concentricity measuring terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server. The filter concentricity measuring terminal device may include, but is not limited to, a processor 80 and a memory 81. It will be understood by those skilled in the art that FIG. 8 is only an example of the filter concentricity measuring terminal device 8, and does not constitute a limitation of the filter concentricity measuring terminal device 8, and may include more or less than the illustration. Components, or combinations of certain components, or different components, such as the filter concentricity measurement terminal device may also include input and output devices, network access devices, buses, and the like.
所称处理器80可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器 (Digital Signal Processor,DSP)、专用集成电路 (Application Specific Integrated Circuit,ASIC)、现成可编程门阵列 (Field-Programmable Gate Array,FPGA) 或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The so-called processor 80 can be a central processing unit (Central Processing Unit, CPU), can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
所述存储器81可以是所述滤光片同心度测量终端设备8的内部存储单元,例如滤光片同心度测量终端设备8的硬盘或内存。所述存储器81也可以是所述滤光片同心度测量终端设备8的外部存储设备,例如所述滤光片同心度测量终端设备8上配备的插接式硬盘,智能存储卡(Smart Media Card, SMC),安全数字(Secure Digital, SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器81还可以既包括所述滤光片同心度测量终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机程序以及所述滤光片同心度测量终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经输出或者将要输出的数据。The memory 81 may be an internal storage unit of the filter concentricity measuring terminal device 8, such as a hard disk or a memory of the filter concentricity measuring terminal device 8. The memory 81 may also be an external storage device of the filter concentricity measuring terminal device 8, for example, a plug-in hard disk equipped with the filter concentricity measuring terminal device 8, and a smart memory card (Smart Media Card) , SMC), Secure Digital (SD) card, flash card (Flash Card) and so on. Further, the memory 81 may also include both the internal storage unit of the filter concentricity measuring terminal device 8 and an external storage device. The memory 81 is used to store the computer program and other programs and data required for the filter concentricity measurement terminal device. The memory 81 can also be used to temporarily store data that has been output or is about to be output.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上描述的全部或者部分功能。实施例中的各功能单元、模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中,上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。另外,各功能单元、模块的具体名称也只是为了便于相互区分,并不用于限制本申请的保护范围。上述系统中单元、模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。It will be clearly understood by those skilled in the art that, for convenience and brevity of description, only the division of each functional unit and module described above is exemplified. In practical applications, the above functions may be assigned to different functional units according to needs. The module is completed by dividing the internal structure of the device into different functional units or modules to perform all or part of the functions described above. Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware. Formal implementation can also be implemented in the form of software functional units. In addition, the specific names of the respective functional units and modules are only for the purpose of facilitating mutual differentiation, and are not intended to limit the scope of protection of the present application. For the specific working process of the unit and the module in the foregoing system, reference may be made to the corresponding process in the foregoing method embodiment, and details are not described herein again.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述或记载的部分,可以参见其它实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the parts that are not detailed or described in the specific embodiments may be referred to the related descriptions of other embodiments.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
在本发明所提供的实施例中,应该理解到,所揭露的装置/终端设备和方法,可以通过其它的方式实现。例如,以上所描述的装置/终端设备实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口,装置或单元的间接耦合或通讯连接,可以是电性,机械或其它的形式。In the embodiments provided by the present invention, it should be understood that the disclosed apparatus/terminal device and method may be implemented in other manners. For example, the device/terminal device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units. Or components may be combined or integrated into another system, or some features may be omitted or not performed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实现上述实施例方法中的全部或部分流程,也可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一计算机可读存储介质中,该计算机程序在被处理器执行时,可实现上述各个方法实施例的步骤。其中,所述计算机程序包括计算机程序代码,所述计算机程序代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括是电载波信号和电信信号。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, the present invention implements all or part of the processes in the foregoing embodiments, and may also be completed by a computer program to instruct related hardware. The computer program may be stored in a computer readable storage medium. The steps of the various method embodiments described above may be implemented when the program is executed by the processor. Wherein, the computer program comprises computer program code, which may be in the form of source code, object code form, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard drive, a magnetic disk, an optical disk, a computer memory, a read only memory (ROM, Read-Only) Memory), random access memory (RAM, Random) Access Memory), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.
以上所述实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围,均应包含在本发明的保护范围之内。The embodiments described above are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that The technical solutions described in the examples are modified, or some of the technical features are equivalently replaced; and the modifications or substitutions do not deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in Within the scope of protection of the present invention.

Claims (10)

  1. 一种滤光片同心度测量方法,其特征在于,包括:A method for measuring concentricity of a filter, comprising:
    获取包含滤光片的初始图像;Obtain an initial image containing the filter;
    从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;Extracting a target area image from the initial image, using the target area image as an image to be tested; the target area image being an image corresponding to an outer contour of the filter in the initial image;
    对所述待测图像进行去噪处理;Denoising the image to be tested;
    分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。The center point positions of the first contour and the second contour in the image to be tested subjected to the denoising process are respectively calculated; the first contour and the second contour respectively correspond to an outer contour and an inner contour of the filter.
  2. 如权利要求1所述的滤光片同心度测量方法,其特征在于,所述从所述初始图像中提出目标区域图像,将所述目标区域图像作为待测图像包括:The filter concentricity measuring method according to claim 1, wherein the presenting the target area image from the initial image, and using the target area image as the image to be tested comprises:
    在所述初始图像中确定滤光片的外部轮廓;所述外部轮廓为滤光片的最外围的轮廓;Determining an outer contour of the filter in the initial image; the outer contour being an outermost contour of the filter;
    根据所述外部轮廓对滤光片进行定位,获取滤光片的位置信息;Positioning the filter according to the outer contour to obtain position information of the filter;
    根据所述位置信息提取所述目标区域图像,将所述目标区域图像作为所述待测图像。Extracting the target area image according to the location information, and using the target area image as the image to be tested.
  3. 如权利要求1所述的滤光片同心度测量方法,其特征在于,所述对所述待测图像进行去噪处理包括:The filter concentricity measuring method according to claim 1, wherein the performing denoising processing on the image to be tested comprises:
    对所述待测图像进行二值化操作和取反操作;Performing a binarization operation and a negation operation on the image to be tested;
    提取经过二值化操作和取反操作后的待测图像中的各个轮廓;各个轮廓分别围成一定的区域面积;Extracting each contour in the image to be tested after the binarization operation and the inversion operation; each contour respectively encloses a certain area area;
    将各个轮廓中区域面积由大到小的前预设个数轮廓作为模板;Pre-predetermined number of contours of the area in each contour from large to small as a template;
    对比所述待测图像和所述模板,根据对比结果处理所述待测图像。Comparing the image to be tested and the template, the image to be tested is processed according to the comparison result.
  4. 如权利要求1-3任一项所述的滤光片同心度测量方法,其特征在于,所述分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置包括:The filter concentricity measuring method according to any one of claims 1 to 3, wherein the calculating a center point position of the first contour and the second contour in the image to be tested subjected to the denoising processing, respectively include:
    分别查找所述待测图像中所述第一轮廓和所述第二轮廓对应的矩形的四条边线位置;Searching, respectively, four edge positions of the rectangle corresponding to the first contour and the second contour in the image to be tested;
    根据所述四条边线位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的四个顶点位置;Calculating four vertex positions of the rectangle corresponding to the first contour and the second contour according to the four edge positions;
    根据所述四个顶点位置分别计算所述第一轮廓和所述第二轮廓对应的矩形的中心点位置。Calculating a center point position of the rectangle corresponding to the first contour and the second contour according to the four vertex positions.
  5. 如权利要求4所述的滤光片同心度测量方法,其特征在于,所述分别查找所述待测图像中所述第一轮廓和所述第二轮廓对应的矩形的四条边线位置包括:The filter concentricity measuring method according to claim 4, wherein the searching for the four edge positions of the rectangle corresponding to the first contour and the second contour in the image to be tested respectively comprises:
    根据滤光片的形状信息,对所述第一轮廓或所述第二轮廓对应的矩形的四条边线中需要进行补偿的边线的位置进行补偿。The position of the edge of the four edges of the rectangle corresponding to the first contour or the second contour to be compensated is compensated according to the shape information of the filter.
  6. 一种滤光片同心度测量装置,其特征在于,包括:A filter concentricity measuring device, comprising:
    获取模块,用于获取包含滤光片的初始图像;An acquisition module, configured to acquire an initial image including a filter;
    提取模块,用于从所述初始图像中提取目标区域图像,将所述目标区域图像作为待测图像;所述目标区域图像为所述初始图像中与滤光片外部轮廓对应的图像;An extraction module, configured to extract a target area image from the initial image, and use the target area image as an image to be tested; the target area image is an image corresponding to an outer contour of the filter in the initial image;
    去噪模块,用于对所述待测图像进行去噪处理;a denoising module, configured to perform denoising processing on the image to be tested;
    计算模块,用于分别计算经过所述去噪处理的待测图像中第一轮廓和第二轮廓的中心点位置;所述第一轮廓和所述第二轮廓分别对应于滤光片的外部轮廓和内部轮廓。a calculation module, configured to separately calculate a center point position of the first contour and the second contour in the image to be tested subjected to the denoising process; the first contour and the second contour respectively correspond to an outer contour of the filter And internal contours.
  7. 如权利要求6所述的滤光片同心度测量装置,其特征在于,所述提取模块用于:The filter concentricity measuring apparatus according to claim 6, wherein the extraction module is configured to:
    在所述初始图像中确定滤光片的外部轮廓;所述外部轮廓为滤光片的最外围的轮廓;Determining an outer contour of the filter in the initial image; the outer contour being an outermost contour of the filter;
    根据所述外部轮廓对滤光片进行定位,获取滤光片的位置信息;Positioning the filter according to the outer contour to obtain position information of the filter;
    根据所述位置信息提取所述目标区域图像,将所述目标区域图像作为所述待测图像。Extracting the target area image according to the location information, and using the target area image as the image to be tested.
  8. 如权利要求6所述的滤光片同心度测量装置,其特征在于,所述去噪模块用于:The filter concentricity measuring device according to claim 6, wherein the denoising module is configured to:
    对所述待测图像进行二值化操作和取反操作;Performing a binarization operation and a negation operation on the image to be tested;
    提取经过二值化操作和取反操作后的待测图像中的各个轮廓;各个轮廓分别围成一定的区域面积;Extracting each contour in the image to be tested after the binarization operation and the inversion operation; each contour respectively encloses a certain area area;
    将各个轮廓中区域面积由大到小的前预设个数轮廓作为模板;Pre-predetermined number of contours of the area in each contour from large to small as a template;
    对比所述待测图像和所述模板,根据对比结果处理所述待测图像。Comparing the image to be tested and the template, the image to be tested is processed according to the comparison result.
  9. 一种滤光片同心度测量终端设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1至5任一项所述方法的步骤。A filter concentricity measuring terminal device comprising a memory, a processor, and a computer program stored in the memory and operable on the processor, wherein when the processor executes the computer program The steps of the method of any one of claims 1 to 5.
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现如权利要求1至5任一项所述方法的步骤。A computer readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the steps of the method of any one of claims 1 to 5.
PCT/CN2018/087482 2017-06-26 2018-05-18 Optical filter concentricity measurement method and terminal device WO2019001164A1 (en)

Applications Claiming Priority (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
CN201710494313.0 2017-06-26

Publications (1)

Publication Number Publication Date
WO2019001164A1 true WO2019001164A1 (en) 2019-01-03

Family

ID=60273007

Family Applications (1)

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

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
CN108918093B (en) * 2018-05-23 2020-08-04 精锐视觉智能科技(深圳)有限公司 Optical filter mirror surface defect detection method and device and terminal equipment
CN108896278B (en) * 2018-05-23 2019-12-31 精锐视觉智能科技(深圳)有限公司 Optical filter silk-screen defect detection method and device and terminal equipment
CN109343037B (en) * 2018-11-27 2024-06-21 森思泰克河北科技有限公司 Device and method for detecting installation error of optical detector and terminal equipment
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
CN106022337A (en) * 2016-05-22 2016-10-12 复旦大学 Planar object detection method based on continuous edge characteristic
CN107356213A (en) * 2017-06-26 2017-11-17 精锐视觉智能科技(深圳)有限公司 Optical filter concentricity measuring method and terminal device

Family Cites Families (4)

* 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
CN102183222B (en) * 2011-03-01 2012-06-27 杭州浙大精益机电技术工程有限公司 Dynamic quantitative measurement method and device for coaxiality and planeness of spiral conveying system
CN102519398B (en) * 2011-10-28 2013-08-28 广西师范大学 Optical fiber base pin concentricity measuring method based on visual measurement and system thereof
CN106596562A (en) * 2016-12-23 2017-04-26 广东锐视智能检测有限公司 Magnet ring appearance quality on-line detection apparatus based on machine visual sense and method thereof

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106022337A (en) * 2016-05-22 2016-10-12 复旦大学 Planar object detection method based on continuous edge characteristic
CN107356213A (en) * 2017-06-26 2017-11-17 精锐视觉智能科技(深圳)有限公司 Optical filter concentricity measuring method and terminal device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU, KEWEN ET AL.: "Measurement of Circular Ring Parts's Form and Position Size base on Machine Vision", INDUSTRIAL CONTROL COMPUTER, vol. 23, no. 7, 25 July 2010 (2010-07-25), pages 1 - 3, ISSN: 1001-182X *

Also Published As

Publication number Publication date
CN107356213B (en) 2020-08-18
CN107356213A (en) 2017-11-17

Similar Documents

Publication Publication Date Title
WO2019001164A1 (en) Optical filter concentricity measurement method and terminal device
EP3309703B1 (en) Method and system for decoding qr code based on weighted average grey method
CN107228860B (en) Gear defect detection method based on image rotation period characteristics
CN114549835B (en) Pointer instrument correction identification method and device based on deep learning
WO2019041794A1 (en) Distortion correction method and apparatus for three-dimensional measurement, and terminal device and storage medium
CN105989588B (en) Special-shaped material cutting image correction method and system
WO2015132817A1 (en) Edge detection device, edge detection method, and program
CN112017232A (en) Method, device and equipment for positioning circular pattern in image
WO2023284712A1 (en) Defect detection model training method, defect detection method and electronic device
CN110866949A (en) Center point positioning method and device, electronic equipment and storage medium
CN114998571B (en) Image processing and color detection method based on fixed-size markers
WO2023060927A1 (en) 3d grating detection method and apparatus, computer device, and readable storage medium
US9319666B1 (en) Detecting control points for camera calibration
Zhang et al. A new algorithm for accurate and automatic chessboard corner detection
JP2014203311A (en) Image processor, image processing method, and program
CN115564723A (en) Wafer defect detection method and application
CN116681879B (en) Intelligent interpretation method for transition position of optical image boundary layer
CN113538399A (en) Method for obtaining accurate contour of workpiece, machine tool and storage medium
CN112634259A (en) Automatic modeling and positioning method for keyboard keycaps
CN104655041A (en) Industrial part contour line multi-feature extracting method with additional constraint conditions
CN115546016B (en) Method for acquiring and processing 2D (two-dimensional) and 3D (three-dimensional) images of PCB (printed Circuit Board) and related device
CN108564571B (en) Image area selection method and terminal equipment
CN111445431B (en) Image segmentation method, terminal equipment and computer readable storage medium
CN110889875A (en) Binocular camera calibration method based on partial corner points
CN118411402B (en) Method, device and system for positioning curved-surface dot matrix map of curved-surface screen and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18824007

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18824007

Country of ref document: EP

Kind code of ref document: A1