CN114742752A - Method and device for detecting printing quality of contact lens casting mold - Google Patents

Method and device for detecting printing quality of contact lens casting mold Download PDF

Info

Publication number
CN114742752A
CN114742752A CN202210200267.XA CN202210200267A CN114742752A CN 114742752 A CN114742752 A CN 114742752A CN 202210200267 A CN202210200267 A CN 202210200267A CN 114742752 A CN114742752 A CN 114742752A
Authority
CN
China
Prior art keywords
image
color
mold
color difference
area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210200267.XA
Other languages
Chinese (zh)
Inventor
刘学谨
蔡仲伦
陈岳
代通
卢发报
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Square Harmony Beijing Technology Co ltd
Original Assignee
Square Harmony Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Square Harmony Beijing Technology Co ltd filed Critical Square Harmony Beijing Technology Co ltd
Priority to CN202210200267.XA priority Critical patent/CN114742752A/en
Publication of CN114742752A publication Critical patent/CN114742752A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T7/001Industrial image inspection using an image reference approach
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8806Specially adapted optical and illumination features
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N21/00Investigating or analysing materials by the use of optical means, i.e. using sub-millimetre waves, infrared, visible or ultraviolet light
    • G01N21/84Systems specially adapted for particular applications
    • G01N21/88Investigating the presence of flaws or contamination
    • G01N21/8851Scan or image signal processing specially adapted therefor, e.g. for scan signal adjustment, for detecting different kinds of defects, for compensating for structures, markings, edges
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/344Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30144Printing quality
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Biochemistry (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Geometry (AREA)
  • Image Analysis (AREA)

Abstract

The present disclosure relates to methods and apparatus for detecting contact lens mold print quality. The detection of defects including printing offset, integral chromatic aberration and monochromatic chromatic aberration, ink deficiency, stains and the like is achieved by performing edge detection and monochromatic separation extraction on the casting mold image and comparing the casting mold image with the template image. According to the method, the printing quality of the contact lens casting mold is automatically detected, the disadvantage of manual detection is avoided, the false detection caused by artificial subjective factors is reduced, the production efficiency is improved, and the labor demand is reduced.

Description

Method and device for detecting printing quality of contact lens casting mold
Technical Field
The disclosure relates to the technical field of optical detection, in particular to a method and a device for detecting printing quality of a contact lens casting mold.
Background
At present, the mode of detecting the printing quality of the color contact lens casting mold is basically a manual subjective visual method, and the printing problem of the casting mold is checked by a production line worker trained for 3-6 months under a specific illumination environment by eyes or a microscope. The detection mode has the following defects: the subjective impression of people is taken as a detection standard, so that detection conclusions of different people may have differences and are difficult to unify, and the defects of theoretical basis exist; fatigue is caused by manual long-time detection, and error judgment is easy to generate; the detection efficiency is low.
There are also systems and methods for detecting color defects of contact lenses, but they do not detect the mold, resulting in high rejection rate, and they can only detect a single color defect, which is a limitation.
Disclosure of Invention
The present disclosure presents methods and apparatus for detecting contact lens mold print quality.
In a first aspect, the present disclosure provides a method for detecting printing quality of a contact lens mold, comprising: acquiring a casting mold image; performing edge detection on the mold image, determining the edge of the mold and the edge of a printing area on the mold, and detecting whether printing deviation exists; carrying out monochrome separation extraction on the casting mould image, comparing the extracted monochrome information with the monochrome information of the template image, and detecting whether monochrome color difference or integral color difference exists; and registering the casting mold image with the template image, and detecting whether the printing area of the casting mold image has ink shortage or dirt.
In some optional embodiments, the acquiring the casting mold image comprises: acquiring color images of the casting mold under different illumination conditions, and fusing the acquired multi-frame color images to obtain a casting mold image to be detected; and generating a gray image of the mold image by performing graying and filtering processing.
In some optional embodiments, the determining an edge of a mold and an edge of a print zone on the mold, detecting whether a print offset is present, comprises: determining the edge of the casting mold by using a binarization method, fitting a minimum circumscribed circle, and determining the circle center of the minimum circumscribed circle as the circle center of the casting mold; an algorithm for extracting color points in a color multi-channel enhancing mode is utilized, a minimum circumscribed circle (namely the excircle of the printing area) of the outer contour of the printing area is obtained through fitting, and the circle center of the minimum circumscribed circle is determined to be the circle center of the excircle of the printing area; whether printing offset exists or not and indicating the offset direction are judged by judging whether the distance between the center of the mold circle and the center of the excircle of the printing area exceeds a threshold value or not and calculating the offset direction through a vector included angle.
In some alternative embodiments, the printed region is centrally disposed with an optical region, the method further comprising: and further fitting to obtain a minimum inscribed circle (namely the inner circle of the printing area) of the inner contour of the printing area so as to extract the color ring of the printing area according to the fitted outer circle of the printing area and the fitted inner circle of the printing area, and preliminarily judging whether the color spot pollution and other stains are generated in the optical area on the casting mould by comparing the diameter value of the inner circle of the printing area with the diameter value of the optical area.
In some optional embodiments, the performing of the monochrome separation extraction on the casting mold image includes: carrying out single-color separation and extraction on the casting mold image by using a clustering method or an index image method, and further obtaining color values of each color space; and determining the color center to which each color point belongs by a color range screening method, and counting the number and the area of the color points corresponding to each single color.
In some optional embodiments, the comparing the extracted monochrome information with the monochrome information of the template image to detect whether there is monochrome color difference or overall color difference includes: weighting and integrating the color difference index of the color, the histogram deviation, the color point quantity difference and the area difference into a comprehensive color difference index by using the monochromatic information of the template image and the extracted monochromatic information of the casting mold image, and judging the monochromatic color difference and the integral color difference; and correcting the color difference detection result when the monochromatic color difference and the integral color difference are inconsistent.
In some alternative embodiments, the determining whether the printed area of the mold image is free of ink or stain comprises: and calculating a difference image of the mold image and the template image by using a Gaussian blur and image feature point matching algorithm or a template matching algorithm, and detecting whether the printing area of the mold image has ink shortage or stain or not based on the difference image.
In a second aspect, the present disclosure provides an apparatus for detecting printing quality of a contact lens mold, comprising: the image acquisition module is used for acquiring a casting mould image; the offset detection module is used for carrying out edge detection on the casting mould image, determining the edge of the casting mould and the edge of a printing area on the casting mould and detecting whether printing offset exists or not; the color difference detection module is used for carrying out monochrome separation extraction on the casting mould image, comparing the extracted monochrome information with the monochrome information of the template image and detecting whether monochrome color difference or integral color difference exists or not; and the printing area detection module is used for registering the casting mold image and the template image and detecting whether the printing area of the casting mold image has ink shortage or dirt.
In a third aspect, the present disclosure provides a computer device comprising: one or more processors; a storage device having one or more programs stored thereon which, when executed by the one or more processors, cause the one or more processors to implement the method of detecting contact lens mold print quality as described in the first aspect.
In a fourth aspect, the present disclosure is a computer readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements the method for detecting print quality of a contact lens mold according to the first aspect.
As described above, in order to solve many problems of manual detection of printing quality of contact lens molds, the present disclosure provides a method and an apparatus for detecting printing quality of contact lens molds, which obtains a mold image through a machine vision scheme, and implements a one-time detection of defects including printing offset, integral chromatic aberration, monochromatic chromatic aberration, ink deficiency, stains, etc. in cooperation with edge detection and monochromatic separation extraction through a digital image analysis processing method and comparison with a template image. Technical effects achieved by the present disclosure include, but are not limited to: through the automatic detection of the printing quality of the contact lens casting mold, the disadvantage of manual detection is avoided, the false detection caused by artificial subjective factors is reduced, the production efficiency is improved, and the labor demand is reduced.
Drawings
Other features, objects and advantages of the present disclosure will become more apparent upon reading of the detailed description of non-limiting embodiments made with reference to the following drawings:
FIG. 1 is a schematic view of a contact lens mold;
FIG. 2 is a schematic flow chart diagram of a method for detecting the print quality of a contact lens mold according to an embodiment of the disclosure;
FIG. 3 is a schematic structural diagram of a machine vision imaging module of an embodiment of the present disclosure;
FIG. 4 is a flow chart of a detection algorithm of an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a contact lens mold print quality detection device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure.
Detailed Description
The present disclosure is described in further detail below with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
In the description of the present disclosure, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships and are only used for convenience in describing the present disclosure and simplifying the description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation, and be operated, and thus should not be construed as limiting the present disclosure. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present disclosure, it is to be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and the like are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present disclosure can be understood by those of ordinary skill in the art as appropriate.
In the description of the present disclosure, it should be noted that the embodiments and features of the embodiments in the present disclosure may be combined with each other without conflict.
In order to solve the problems of manually detecting the printing quality of a colored contact lens mold, the present disclosure provides a method and an apparatus for detecting the printing quality of a contact lens mold.
Referring to fig. 1, fig. 1 is a schematic view of a contact lens mold. A contact lens mold is a mold for manufacturing a contact lens, and as can be seen in the figure, a circular mold is printed with a pattern, which may be colored, and the area of the printed pattern is called a printing area; there is also a clear area in the center of the mold and this area is surrounded by a printed area, which is called the optical zone. Possible print quality problems with contact lens molds include: print offset, monochromatic and global color difference, ink starvation or missing print, optical zone stains, print zone stains, and the like.
Referring to fig. 2, fig. 2 is a schematic flow chart of a method for detecting print quality of a contact lens mold according to an embodiment of the present disclosure. As shown in fig. 2, a method for detecting printing quality of a contact lens mold according to an embodiment of the present disclosure includes the following steps:
step 11: an image of the mold is acquired.
In this step, the mold product may be imaged by the machine vision imaging module to obtain a mold image. The acquired mold image is typically required to be a color image.
In some optional embodiments, in order to improve the accuracy and repeatability of detection and enhance the dynamic range of image colors, so that the color effect of an image is closer to the appearance of human eyes, it is preferable to adopt a multi-image fusion imaging scheme, that is, color images of a mold under different illumination conditions are obtained, for example, color images of a mold when a light source is located at different heights, and then the obtained multi-frame color images are fused, and the color image obtained after fusion is the mold image to be detected.
In some optional embodiments, to facilitate subsequent processing, the step further performs preprocessing on the acquired mold image, including: graying and filtering processing are performed to generate a grayscale image of the mold image.
In some optional embodiments, after acquiring the casting mold image, the method further comprises: determining whether the mold image is set as a template image, if so, executing a step of setting the mold image as the template image; if not, a subsequent detection step is executed to detect the printing quality of the mold image.
Step 12: edge detection is performed on the mold image, the edge of the mold and the edge of the printing area on the mold are determined, and whether printing deviation exists or not is judged.
This step identifies the printed area on the mold by edge detection and determines if there is a print offset.
In some optional embodiments, the edge of the casting mold can be determined by using a binarization method, and a minimum circumscribed circle is fitted to determine that the center of the minimum circumscribed circle is the center of the casting mold; an algorithm for extracting color points in a color multi-channel enhancing mode can be utilized, a minimum circumscribed circle (namely the excircle of the printing area) of the outer contour of the printing area is obtained through fitting, and the circle center of the minimum circumscribed circle is determined to be the circle center of the excircle of the printing area; whether printing deviation exists or not and indicating the deviation direction can be judged by judging whether the distance between the center of the mold and the center of the excircle of the printing area exceeds a threshold value or not and calculating the deviation direction through the vector included angle.
In some alternative embodiments, a minimum inscribed circle of the contour in the printing area (i.e., the inner circle of the printing area) is further fitted to extract the color ring of the printing area according to the fitted outer circle of the printing area and the fitted inner circle of the printing area, and the diameter value of the inner circle of the printing area is compared with the diameter value of the optical area to preliminarily determine whether stains such as color spot contamination exist in the optical area on the mold.
Step 13: and (3) carrying out monochrome separation extraction on the casting mould image, comparing the extracted monochrome information with the monochrome information of the template image, and detecting whether monochrome color difference or integral color difference exists.
In the step, color difference judgment is carried out, wherein the color difference comprises monochrome color difference and integral color difference, the judgment method is to obtain monochrome information through monochrome separation and extraction, and then the extracted monochrome information is compared with the monochrome information of the template image. The template image is preset, and a qualified mold image without defects can be preset as the template image.
In some optional embodiments, the monochrome separation extraction of the mold image comprises: the method of clustering or indexing the images can be used for carrying out single-color separation extraction on the casting mold images, and further obtaining color values of various color spaces such as RGB, HSV, Hunter LAB, CIE XYZ and the like; and determining the color center to which each color point belongs by a color range screening method, and counting the number and the area of the color points corresponding to each single color.
In some optional embodiments, the determining whether the monochromatic color difference or the overall color difference exists comprises: weighting and integrating the color self color difference index, the histogram deviation, the color point quantity difference and the area difference into a comprehensive color difference index by utilizing the monochromatic information of the template image and the extracted monochromatic information of the casting mold image, and judging the monochromatic color difference and the integral color difference; and correcting the color difference judgment result when the monochromatic color difference and the integral color difference are in contradiction.
The histogram deviation can be obtained by acquiring histogram data of the mold image and comparing the histogram data with histogram data of the template image.
The difference of the colors of the casting mould image and the template image can be calculated by adopting a general CIE DeltaE color difference calculation method, and a CIE DeltaE color difference index is obtained and used as the color difference index of the colors. Among them, the index of the delta E (Δ E) color difference is an international standard proposed by CIE (international commission on illumination).
Wherein, correcting the color difference detection result may include: and taking the result of the integral chromatic aberration as a standard, if the integral chromatic aberration is detected but the monochromatic chromatic aberration is not detected, correcting the color with the highest printing density into the monochromatic chromatic aberration, otherwise, if the integral chromatic aberration is smaller than the set lower limit of the threshold value of the integral chromatic aberration, correcting the monochromatic chromatic aberration into no chromatic aberration, and otherwise, correcting the integral chromatic aberration into chromatic aberration if the monochromatic chromatic aberration is detected.
Step 14: and registering the mold image with the template image, and detecting whether the printing area of the mold image has ink shortage or dirt.
In some alternative embodiments, a difference image between the mold image and the template image may be obtained by using a gaussian blur and image feature point matching or template matching algorithm, and whether the printing area of the mold image has ink shortage or dirt may be detected based on the difference image.
In the above, a method for detecting the printing quality of a contact lens mold according to the embodiment of the present disclosure is described. The method utilizes an edge detection method to judge whether defects such as printing offset, optical region stains and the like exist, and utilizes a mode of comparing with a template image to detect whether defects such as single color, integral chromatic aberration, ink shortage or missing prints, printing region stains and the like exist.
In some optional embodiments, the process of setting the mold image as the template image in the embodiments of the present disclosure includes the following steps:
step 21, carrying out edge detection on the mold image, acquiring edge detection data, and identifying a printing area and an optical area of the mold;
step 22, carrying out monochrome separation and extraction on the casting mould image to obtain monochrome information data;
step 23, performing histogram processing on the casting mould image to obtain histogram data;
step 24, the mold image is set as a template image, and the edge detection data, the monochrome information data, and the histogram data are stored together as template information.
In order to facilitate understanding and implementing the technical solution of the present disclosure, the following is further described with reference to an application scenario embodiment.
In order to adapt to the printed patterns of different features, considering the variety of patterns, textures and colors of colored contact lenses, the detection scheme of the embodiment comprises the following steps: the casting mold product is imaged through a machine vision imaging module consisting of a camera, a lens and a light source, and is detected through a machine vision software module consisting of a background algorithm module and front-end user interaction software. The detection process may include: firstly, establishing a template image of a qualified mold product, extracting and storing relevant information, and then calculating and comparing the mold image to be detected with the template image, thereby realizing different types of printing quality detection requirements by using a digital image analysis processing method. In order to improve the accuracy and repeatability of detection and enhance the dynamic range of image colors, so that the color effect of an image is closer to the impression of human eyes, a multi-image fusion imaging scheme is preferably adopted.
In some embodiments, referring to fig. 3, a machine vision imaging module may comprise: camera 6 and its lens 5, light source 4, mechanical transmission module and electric control module. Wherein: mechanical transmission module includes horizontal module 1 and rotation module 11 and vertical module 2, and rotation module 11 is used for placing and waits to detect the mould and rotatable, but is provided with rotation module 11 and horizontal migration on the horizontal module 1, and light source 4 sets up on vertical module 2 and is used for shining the mould. The electric control module comprises a controller, a control button 10 of the controller and a motor set 3, the controller is used for controlling the motor set, and the motor set 3 is used for driving the horizontal movement of the horizontal module, the rotation of the rotating module and the vertical movement of the vertical module. Alternatively, the integral housing of the machine vision imaging module may be a cabinet structure having a base 9, a cabinet wall 8 and a protective cover 7. The horizontal module 1 may be arranged on the base 9 and the camera 6 and the vertical module 2 may be arranged on the cabinet wall 8. The machine vision imaging module can be used to take images of the mold under different conditions, such as color images with the light source at different heights, and images of the mold at different angles of rotation.
In some embodiments, the machine vision software module may be deployed in a computer device, include a front-end user interaction software module and a back-end algorithm module, and be coupled to the machine vision imaging module. The front-end user interaction software module provides functions of camera configuration, triggering a camera to collect images and the like to drive the machine vision module, provides a user interaction interface, comprises image and detection result display, provides an interface for a user to adjust detection parameters and triggers a calling algorithm, and can also store detection historical data so as to facilitate backtracking and query. The background algorithm module provides functions of image fusion, image preprocessing, detection algorithms aiming at various printing qualities of the casting mold and the like, and finally the detection results can be output to the front-end user interaction software module.
The detection algorithm can realize the detection functions of three major types of defects, including:
(1) detecting printing offset;
(2) detecting chromatic aberration;
(3) missing printing and printing stain detection.
Referring to the detection items shown in table 1, a detection algorithm may be used to detect all or some of the three detection items shown in the table.
TABLE 1 test items
Figure BDA0003529085130000081
Referring to fig. 4, the overall flow of the detection algorithm is as follows:
(one) acquiring an image
(1.1) fusing images
Inputting data: the method comprises four parameters, namely a single-frame color image of a casting mold, a name of the casting mold, whether the casting mold is a template image or not, meta-group data including a task Identifier (ID) and a request ID, wherein the single-frame color image of the casting mold is shot when a light source is positioned at different heights;
the processing logic: calling a multi-image fusion function, obtaining a fusion image by a method of averaging multi-frame images, wherein the fusion image has a higher dynamic range and colors closer to the impression of human eyes, and naturally, the method also comprises the special condition that the number of the multi-images is 1 frame, and returning to the image;
outputting data: and if the accumulated image quantity does not reach the set multi-image quantity, returning to wait for the image signal, otherwise, returning to the fused image after multi-image averaging and the image acquisition finishing signal.
(1.2) pretreatment
Inputting data: fusing images and detecting a parameter configuration file;
the processing logic: calling a preprocessing function, converting the RGB color image into a gray image, and then performing median filtering and Gaussian filtering processing to achieve the purpose of reducing image noise interference and avoid subsequent repeated calculation of the gray image;
outputting data: the filtered gray level image has public configuration parameter and private configuration parameter data and initialized parameters.
(1.3) determination of whether to detect
Inputting data: whether the template image is the template image or not, public configuration parameter data, private configuration parameter data and initialization parameters;
the processing logic: if the template image is the template image, calling a template generating function, otherwise, calling a detection function;
outputting data: and detecting results and labeling information.
(II) the flow of generating the template function is as follows:
(2.1) edge detection
Inputting data: the method comprises the following steps of (1) obtaining an original image, a filtered gray image, public configuration parameter data and private configuration parameter data;
the processing logic: calling an edge detection function to acquire the areas of the mold printing area and the optical area of the template image, and simultaneously using the optical area for subsequent targeted detection and analysis;
outputting data: template edge detection data.
(2.2) color extraction
Inputting data: edge detection data, the number of colors of the casting mould, public configuration parameters and private configuration parameter data;
the processing logic: calling a color extraction function to separate a single color from a multi-color overprinted pattern so as to be convenient for analyzing the single color difference, so that a feedback guidance production line adjusts the single color ink, for a template image, the average value of the background color of a non-color point area of the casting mold is calculated and stored, and when a sample is detected, the parameter is used for calling, so that the error caused by the influence of the color difference of the color point on the background color is avoided;
outputting data: the template monochromatic information data and the background color mean value of the non-color point area of the template.
(2.3) histogram processing
Inputting data: fitting an LAB image of a polygonal ROI in a template printing area, a mask binary image of the template printing area, common configuration parameter data and the number of colors of a histogram;
the processing logic: calling and calculating an LAB image histogram function, and aiming at obtaining histogram data of a template image for comparing with the histogram data of a sample and analyzing chromatic aberration;
outputting data: histogram data of the template.
(2.4) generating the template
Inputting data: the method comprises the following steps of (1) casting mould name, edge detection data, monochromatic information data, casting mould non-color point area background color mean value and template histogram data;
the processing logic: calling a template information storage function to store the template information data obtained by calculation in the step into a local hard disk of an industrial personal computer, so that subsequent calling and comparison analysis of a sample are facilitated;
outputting data: and generating a result of whether the template is successful or not.
(III) the flow of the detection function is as follows:
(3.1) reading the template
Inputting data: a mold name;
the processing logic: calling a function for reading corresponding template information, and reading template information data from a hard disk and storing the template information data into a specific variable;
outputting data: if the reading is successful, returning the template information data, otherwise, returning the result of the failure of the reading, and exiting the program.
(3.2) edge detection
Inputting data: the method comprises the following steps of (1) obtaining an original image, a filtered gray image, public configuration parameter data and private configuration parameter data;
the processing logic: calling an edge detection function to obtain the mold printing area and the optical area of the sample image, and simultaneously using the optical area for subsequent targeted detection and analysis;
outputting data: sample edge detection data.
(3.3) color extraction
Inputting data: edge detection data, the number of the colors of the mold, the background color mean value of a non-color point area of the corresponding template mold, public configuration parameters and private configuration parameter data;
the processing logic: calling a color extraction function, aiming at separating a single color from a multi-color overprinted pattern, and conveniently analyzing single color aberration, so as to feed back and guide a production line to adjust the single color ink, wherein in the logic of detecting a sample, a non-color point region background color mean value parameter of a corresponding template needs to be called without recalculating the parameter, thereby avoiding the error caused by the influence of color point aberration on the background color;
outputting data: and (4) sample monochromatic information data.
(3.4) chromatic aberration calculation
Inputting data: template information data, sample monochromatic information data, sample edge detection data, public configuration parameters and private configuration parameter data;
the processing logic: calling a color difference detection function to compare and analyze the color information of the template and the sample so as to analyze the conditions of integral color difference and monochromatic color difference;
outputting data: and the color difference result and various color difference data indexes are the sample monochromatic data after the sample monochromatic data is sequenced according to the template monochromatic sequence.
(3.5) print area detection
Inputting data: a template ROI image, sample edge detection data, public configuration parameters and private configuration parameter data;
the processing logic: calling a printing area detection function to detect defects such as ink shortage or stains in a printing area after registering the sample and the template image;
outputting data: and detecting the printing area and related flaw information of the printing area.
The processing flow of each subfunction in the detection function is as follows:
(A) edge detection function
(A1) Edge positioning
Inputting data: filtered gray level images, public configuration parameter data, private configuration parameter data and initialization parameters;
the processing logic: calling an edge positioning function of the upper surface of the casting mold, carrying out self-adaptive binarization operation on the filtered gray level image, and carrying out morphological closing operation, opening operation and Gaussian filtering to connect edges and remove edge burrs, then carrying out contour extraction operation on the obtained processed binary image, screening out candidate casting mold contours by utilizing upper and lower limits of a casting mold area threshold value, selecting one contour with the largest area in the candidate contours, solving the smallest circumscribed circle of the selected contour, obtaining the edge of the upper surface of the casting mold, and drawing the mark of the circle;
outputting data: if the positioning is successful, outputting the information data of the edge of the casting mould, wherein the information data comprises the circle center and the radius of the circumscribed circle of the casting mould and a binary image of a mask of the casting mould, otherwise, outputting a positioning failure result, and prompting the information that the edge of the casting mould is not found, and exiting the program.
(A2) Print zone inside and outside contour detection
Inputting data: original image, edge detection data and public configuration parameter data;
the processing logic: calling the inner and outer contour detection functions of the mold printing area, in order to adapt to mold patterns with different colors, only considering the brightness information can result in imperfect adaptation to all products, so that the color information of the image needs to be fully utilized for positioning, and the method F1 'an algorithm for extracting color points by utilizing a color multi-channel enhancement mode' is provided: considering that the printing region extraction operation is performed in the HSV color space, where H represents hue, S represents saturation, and V represents brightness, considering that the hues of various inks are very different, but the S, V channel of the S, V channel is significantly different from that of the uncolored region because the uncolored region itself is close to white, but the color of the undercolor region is affected during the printing process due to the color difference of the color point, for example, if a pink color point is printed, the undercolor region around the color point is also biased to be pale pink, but the S value is small and the V value is large regardless of the color bias of the undercolor, according to which the uncolored region image can be first screened out and inverted, and the color point grayscale image with highlighted color points can be obtained. And then calculating a binary image, searching the outline, setting the upper limit and the lower limit of an outline area threshold value, and finding an inner outline and an outer outline for a casting mould with a printing area being a closed color ring pattern, but only detecting one outline for the non-closed pattern. Meanwhile, in the process of searching the outline of the printing area, in order to prevent the searching failure of the method F1, secondary searching is carried out, and after a binary image is obtained by utilizing a brightness image, the outline searching is carried out.
Outputting data: if the positioning is successful, outputting the detected number of the outlines and the information data of the edges of the casting mould, wherein the data comprises the circle center and the radius of the circumscribed circle of the printing area, the area of the circumscribed circle of the printing area, the color ring mask binary image of the printing area, the mask binary image of the fitting polygon of the printing area, the color ROI (region of interest) image of the printing area and the x and y offset of the ROI, otherwise, outputting a positioning failure result, prompting information that the edges of the printing area are not found, and exiting the program.
(A3) Print zone inscribed circle profile detection
Inputting data: the method comprises the following steps of (1) obtaining an original image, a filtered gray image, edge detection data and public configuration parameter data;
the processing logic: calling an inscribed circle detection function of a mold printing area to calculate an inscribed circle of a color ring of the printing area so as to perform subsequent optical area stain detection, wherein the detection method of the maximum inscribed circle is as follows: firstly, the minimum circumcircle of the inner contour of the color ring is obtained, the circle center of the circumcircle is taken as the circle center of the inscribed circle, then the distance from each point on the inner contour to the circle center is calculated, and the minimum distance is taken as the diameter of the inscribed circle;
outputting data: if the positioning is successful, outputting casting mould edge information data which comprises the circle center and the radius of an inscribed circle of the printing area, a mask binary image of a color ring of the printing area, the area of the color ring, the total area of color dots, a mask binary image of a color ring fitting polygon of the printing area and an ROI image of the color ring of the printing area, otherwise, outputting a positioning failure result and prompting information that the edge of the printing area is not found, and exiting the program.
(A4) Optical zone stain detection
Inputting data: filtered gray level image, edge information data, public configuration parameter and private configuration parameter data;
the processing logic: calling an optical area stain detection function to detect stains in the optical area, wherein the size of the optical area is usually set by a customer and is concentric with a casting mold, the diameter of the optical area is smaller than the diameter of an inner ring of a printing area, namely, a printed color point cannot fall into the optical area, otherwise, the optical area is regarded as a defective product, therefore, firstly, the two diameter values are compared to preliminarily judge whether the color point in the optical area is polluted or not, then, the optical area is extracted through a mask, and the dark stain is further detected by using a self-adaptive binarization and contour searching method;
outputting data: if optical area dirt is detected, outputting a result code of the optical area dirt and a dirt label, otherwise, outputting a qualified result code.
(A5) Print offset detection
Inputting data: edge information data, public configuration parameters and private configuration parameter data;
the processing logic: a printing offset detection function is called, so that printing offset is detected, integral offset can be detected, and obvious single-color offset (slight single-color offset is detected through color difference detection) can be detected, the distance between the center of the minimum circumscribed circle of the casting mould and the center of the minimum circumscribed circle of the printing area is calculated and compared with the upper limit of an offset threshold, if the distance exceeds the upper limit, the printing offset is judged to exist, the offset direction is obtained by calculating the included angle between vectors, a unit vector Q1 in the horizontal direction is used as a reference vector, and a unit vector Q2 in the offset direction is obtained through calculation, the offset angle can be obtained by calculating the inverse cosine value obtained by multiplying the unit vector Q1 and a unit vector Q2 point, the value range [0,180 degrees ], and the specific direction is indicated by an arrow mark;
outputting data: and outputting an absolute value of the offset, an indication arrow of the offset angle and the direction, if the printing offset is detected, outputting a result code of the printing offset and a red arrow label, otherwise, outputting a qualified result code and a green arrow label.
(B) Color extraction function
(B1) Color extraction pre-processing
Inputting data: edge information data;
the processing logic: calling a color extraction preprocessing function to perform corrosion operation on the mask image of the color point so as to remove color errors caused by dispersion at the edge of the color point as much as possible;
outputting data: the printing area is fitted with a polygonal ROI color image, and the corroded printing area is fitted with a polygonal mask binary image.
(B2) Calculating a monochrome color center
Inputting data: a color extraction method (index image method or clustering method);
the processing logic: calling and calculating a monochromatic color center function to extract monochromatic information from aliasing colors;
outputting data: monochrome information data.
The function can select any scheme as follows:
(01) method for indexing images
Inputting data: the printing area is fitted with a polygonal ROI color image, and public configuration parameters and private configuration parameter data are obtained;
the processing logic: calling an index image obtaining function, aiming at extracting colors by using an image palette, wherein the principle of the method is that a palette with fixed colors is given, a sequence for storing color index values can be obtained and corresponds to each pixel in an image, so that the color of each pixel of the image can be mapped to the fixed color in the palette, and the effect of reducing the number of the colors of the image is achieved;
outputting data: index color, number of color points.
(02) Clustering method
Inputting data: fitting a polygonal ROI color image in a printing area, fitting a polygonal mask binary image in the printing area after corrosion treatment, edge information data, a bottom color mean value of a non-color point area of a template mold, public configuration parameters and private configuration parameter data;
the processing logic: calling a color clustering function, wherein the purpose is to take the color value of each pixel of the image as a data sequence, the number of classes is the total number of printing colors input by a user, the color center of each single color is obtained by a clustering method, before the clustering method is applied, a method F1 needs to be called to extract color points, and the image for clustering is a color image in an LAB color space, because the color space can separate the brightness L from the color AB and is more suitable for the color impression of human eyes;
outputting data: the mold uncolored dot area background color mean value, the monochromatic information, which includes the monochromatic LAB values, the number of color dots per class, the total number of color dots.
(B3) Monochromatic region segmentation
Inputting data: the printing area is fitted with a polygonal ROI color image and monochromatic information;
the processing logic: calling a monochromatic area segmentation function, aiming at obtaining color values of each color space (such as RGB, HSV, Hunter LAB, CIE LAB and CIE XYZ) for reference of a user, more accurately obtaining distribution conditions of monochromatic color points and the number of pixels occupied by each monochromatic color at the same time so as to perform subsequent color difference analysis, setting L, A, B upper and lower limit thresholds of the range from the color center of three channels, respectively obtaining mask binary images corresponding to each monochromatic color, performing AND operation with an original image to obtain the distribution of a monochromatic area, determining the color center to which each monochromatic color point belongs, and obtaining the number and area of the monochromatic color points, namely printing density information, by counting the number of non-zero pixels of the mask images;
outputting data: and monochrome information, which comprises monochrome color values of HSV, RGB, HunterLAB and CIELAB space, the number of monochrome color points, the area of the monochrome color points, monochrome RGB labeling color blocks and monochrome highlight area labeling.
(C) Color difference calculation function
(C1) Histogram processing
Inputting data: fitting an LAB image of a polygonal ROI in a sample printing area, a mask binary image of the sample printing area, common configuration parameter data and the number of colors of a histogram;
the processing logic: calling and calculating a histogram function of the LAB image so as to obtain histogram information of the sample LAB image;
outputting data: LAB histogram data for the samples.
(C2) Integral chromatic aberration calculation
Inputting data: template histogram data, sample histogram data, public configuration parameter data and private configuration parameter data;
the processing logic: calling an integral chromatic aberration calculation function, aiming at judging the integral chromatic aberration by comparing the difference between the image histograms of the template and the sample, and providing a method for judging the integral chromatic aberration: the influence on the overall color impression after multi-color overprinting can be embodied by a color histogram, firstly, the correlation coefficient of a template and a sample histogram is calculated, the value range [0,1] represents that the similarity is higher if the value range is larger, then the sum of Euclidean distances of A, B channels of the two histograms is calculated, namely the histogram deviation is obtained, finally, the overall color difference judgment and reason analysis are carried out, if the correlation coefficient value is smaller than the set correlation coefficient threshold lower limit, the color difference caused by the correlation coefficient deviation is judged to exist, if the histogram deviation value is larger than the set deviation threshold lower limit, the color difference caused by the histogram deviation is judged to exist, and meanwhile, the similarity index obtained by weighting the correlation coefficient and the deviation can also be calculated;
outputting data: and the color difference information comprises an integral color difference result code, a histogram correlation coefficient, a histogram deviation value and an integral similarity index of the sample and the template.
(C3) Monochromatic color difference calculation
Inputting data: the method comprises the following steps of (1) obtaining template monochromatic information, sample monochromatic information, chromatic aberration information, public configuration parameters and private configuration parameter data;
the processing logic: the method comprises the following steps of calling a monochromatic color difference calculation function, aiming at obtaining the color difference condition of each color ink, wherein the judgment mechanism of human eyes for macroscopic color difference is complex, on one hand, the difference of hue, saturation or brightness exists between colors, and on the other hand, the density degree of printing is also serious, and the human eyes are required to judge the color difference, so that the color difference judgment index comprehensively considering the color and the color point density is provided, the difference of the color can be obtained by a universal CIE DeltaE color difference calculation method, but the final color difference index is obtained by weighting the brightness difference, the color point density difference, the histogram deviation and the CIE DeltaE color difference value together, and if one of the following conditions is met: (1) the color difference index exceeds the set upper limit of the monochromatic difference threshold, (2) the color difference index exceeds the set lower limit of the monochromatic difference threshold and the CIE DeltaE color difference value is greater than the set upper limit of the color difference value, and then the color is judged to have color difference;
outputting data: the sample monochromatic information and the color difference information after sequencing according to the template monochromatic sequence comprise color difference result codes of each monochromatic, monochromatic color difference indexes, the number ratio difference of monochromatic color points between the sample and the template, the monochromatic brightness difference between the sample and the template, the area difference and the area ratio difference of the monochromatic color points between the sample and the template, and CIE DeltaE color difference values.
(C4) Comprehensively judge color difference
Inputting data: color difference information;
the processing logic: comprehensively judging a color difference function according to the integral color difference and the monochromatic color difference, aiming at correcting the color difference result when the integral color difference and the monochromatic color difference result have contradiction conflict, wherein the correction logic is based on the integral color difference result as a standard, if the integral color difference is detected but the monochromatic color difference is not detected, correcting the color with the highest printing density into the monochromatic color difference, otherwise, if the integral color difference is less than the set lower limit of the integral color difference threshold, correcting the monochromatic color difference into no color difference, otherwise, correcting the integral color difference into chromatic color difference if the monochromatic color difference is detected;
outputting data: if the result of the corrected integral and monochrome color difference result codes is that color difference exists, outputting 'color difference' prompt information beside a color block with the color difference, and ending the program, otherwise, entering a printing area detection function.
(D) Printed area detection function
(D1) Ink starvation detection
Inputting data: the method comprises the following steps that a template printing area is circumscribed circle surrounding area ROI color image, a sample printing area is circumscribed circle surrounding area ROI color image, sample edge information data, public configuration parameters and private configuration parameter data;
the processing logic: calling an ink-lacking detection function, aiming at detecting ink-lacking or missing printing flaws in a sample printing area, wherein the texture patterns of a casting mould are different, and irregular or asymmetric gaps often exist in the patterns, so that the ink-lacking flaws can be accurately detected only by comparing the patterns with the patterns of a standard template without causing a large amount of misjudgment, and because the angle is arbitrary when the casting mould is placed, the sample image and the template image must be registered at first, the method for matching characteristic points (including but not limited to SIFT, SURF, ORB and other algorithms) is provided by the disclosure, or a linear image of the printing area is obtained by polar coordinate expansion, then the image is registered by using the template matching method, the template image is transformed to the condition corresponding to the sample image (or the sample image is transformed to the template image) by transform, and then the difference image of the sample image and the template image after Gaussian blur is obtained, extracting an ink lacking area;
outputting data: and detecting a result code and printing area information data, wherein the result code comprises a template printing area circumcircle surrounding area ROI grayscale image after image registration, the maximum ink-lacking area, the total area of the ink-lacking area and the label of the ink-lacking area.
(D2) Print zone stain detection
Inputting data: sample edge information data, printing area information data, public configuration parameters and private configuration parameter data;
the processing logic: calling a stain detection function of a printing area to detect stains or multiple prints and other defects in the sample printing area, and extracting a stain area by obtaining a difference image of a template image after Gaussian blur and a sample image because the image is registered in the previous step;
outputting data: and the detection result code and the printing area information data comprise the maximum dirt area, the total dirt area and the mark of the dirt area.
The detection algorithms comprise a printing deviation detection algorithm, a monochromatic separation extraction algorithm, a monochromatic color difference and integral color difference judgment algorithm, an ink shortage or missing print detection algorithm, an optical area stain and printing area stain detection algorithm and the like, can realize the detection functions of three types of stains, and comprise: (1) detecting printing offset; (2) detecting chromatic aberration; (3) missing printing and printing stain detection.
The beneficial effects achieved by the embodiments of the present disclosure include, but are not limited to:
(1) the method for automatically detecting the printing quality of the contact lens casting mold is realized, the color imaging effect is very close to the visual perception of human eyes, the color information of a printed pattern can be really presented, various defects including printing deviation, single color, integral chromatic aberration, ink shortage, stains in various areas and the like can be detected, and the purpose of covering all manual quality inspection links is realized;
(2) the numerical quantification standard for scientifically measuring the printing quality of the casting mold is established, and false detection caused by human subjective factors is reduced;
(3) the method has the characteristics of high detection result accuracy, high repeatability, low omission factor and low false judgment rate, can be adapted to contact lens casting molds of various specifications and models, and effectively reduces the labor cost;
(4) the input qualified product template data is stored in a local hard disk of the industrial personal computer, so that the qualified product template data can be easily backtracked and exported by one key, and the detection related data is stored in a database and can be backtracked and searched, so that a user is effectively guided to improve the process and improve the productivity.
Referring to fig. 5, the disclosed embodiments also provide an apparatus 500 for detecting the printing quality of a contact lens mold, the apparatus 500 comprising:
an image acquisition module 51 for acquiring a mold image;
an offset detection module 52 for performing edge detection on the mold image, determining the edge of the mold and the edge of the print area on the mold, and detecting whether there is a print offset;
the color difference detection module 53 is configured to separate and extract a single color of the mold image, compare the extracted single color information with the single color information of the template image, and determine whether a single color difference or an entire color difference exists;
and a printing area detection module 54 for registering the mold image with the template image and detecting whether the printing area of the mold image has ink shortage or dirt.
Referring to fig. 6, an embodiment of the present disclosure also provides a computer device 600, including:
one or more processors 601;
a memory 602 having one or more programs 603 stored thereon;
components such as the processor 601 and the memory 602 may be coupled together by a bus system 604; the bus system 604 is used to enable connection communication between these components;
the one or more programs 603, when executed by the one or more processors 601, cause the one or more processors 601 to implement a method of detecting contact lens mold print quality as disclosed in the above method embodiments.
The bus system 604 may include a power bus, a control bus, and a status signal bus, in addition to a data bus. The memory 602 may be either volatile memory or nonvolatile memory, and may also include both volatile and nonvolatile memory. The Processor 601 may be an integrated circuit chip with Signal processing capabilities, and may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like.
The disclosed embodiments also provide a computer-readable storage medium having stored thereon a computer program, which when executed by one or more processors, implements the method for detecting the print quality of a contact lens mold as disclosed in the above method embodiments.
The present disclosure is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be understood that the terms "system" and "network" are often used interchangeably herein in this disclosure. The term "and/or" in the present disclosure is only one kind of association relationship describing the association object, and means that there may be three kinds of relationships, for example, a and/or B, and may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
The above description is only exemplary of the present disclosure and should not be taken as limiting the scope of the present disclosure, which is intended to cover any variations, modifications, equivalents, and improvements made within the spirit and scope of the present disclosure.

Claims (10)

1. A method for detecting the print quality of a contact lens mold, comprising:
acquiring a casting mold image;
performing edge detection on the mold image, determining the edge of the mold and the edge of a printing area on the mold, and detecting whether printing deviation exists;
carrying out monochrome separation extraction on the casting mould image, comparing the extracted monochrome information with the monochrome information of the template image, and detecting whether monochrome color difference or integral color difference exists;
and registering the casting mold image with the template image, and detecting whether the printing area of the casting mold image has ink shortage or dirt.
2. The method of claim 1, the acquiring a mold image comprising:
acquiring color images of the casting mold under different illumination conditions, and fusing the acquired multi-frame color images to obtain a casting mold image to be detected; and generating a gray image of the mold image by performing graying and filtering processing.
3. The method of claim 1, wherein the determining edges of a mold and edges of a print zone on the mold, detecting whether a print offset is present, comprises:
determining the edge of the casting mold by using a binarization method, fitting a minimum circumscribed circle, and determining the circle center of the minimum circumscribed circle as the circle center of the casting mold;
an algorithm for extracting color points in a color multi-channel enhancing mode is utilized, a minimum circumscribed circle of the outer contour of the printing area is obtained through fitting, and the circle center of the minimum circumscribed circle is determined to be the circle center of the excircle of the printing area;
whether printing deviation exists or not and indicating the deviation direction are judged by judging whether the distance between the center of the mold and the center of the excircle of the printing area exceeds a threshold value or not and calculating the deviation direction through the vector included angle.
4. The method of claim 3, the printed region having an optical region disposed in a center thereof, the method further comprising:
and further fitting to obtain a minimum inscribed circle of the inner contour of the printing area, and judging whether the optical area is stained or not by comparing the diameter of the minimum inscribed circle with the diameter of the optical area.
5. The method of claim 1, wherein the monochrome separation extraction of the casting mold image comprises:
carrying out single-color separation extraction on the casting mould image by using a clustering method or an index image method, and further obtaining color values of each color space; and determining the color center to which each color point belongs by a color range screening method, and counting the number and the area of the color points corresponding to each single color.
6. The method of claim 1, wherein the comparing the extracted monochrome information with the monochrome information of the template image to detect whether monochrome color difference or global color difference exists comprises:
weighting and integrating the color self color difference index, the histogram deviation, the color point quantity difference and the area difference into a comprehensive color difference index by utilizing the monochrome information of the template image and the extracted monochrome information of the casting mold image, and judging the monochrome color difference and the integral color difference;
and correcting the color difference detection result when the monochromatic color difference and the integral color difference are in contradiction.
7. The method of claim 1, wherein the determining whether the printed area of the mold image is clear or dirty comprises:
and calculating a difference image of the mold image and the template image by using a Gaussian blur and image feature point matching algorithm or a template matching algorithm, and detecting whether the printing area of the mold image has ink shortage or stain or not based on the difference image.
8. An apparatus for detecting the print quality of a contact lens mold, comprising:
the image acquisition module is used for acquiring a casting mould image;
the offset detection module is used for carrying out edge detection on the casting mould image, determining the edge of the casting mould and the edge of a printing area on the casting mould and detecting whether printing offset exists or not;
the color difference detection module is used for carrying out monochrome separation extraction on the casting mould image, comparing the extracted monochrome information with the monochrome information of the template image and detecting whether monochrome color difference or integral color difference exists or not;
and the printing area detection module is used for registering the casting mold image and the template image and detecting whether the printing area of the casting mold image has ink shortage or dirt.
9. A computer device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement a method for detecting contact lens mold print quality as recited in any one of claims 1-7.
10. A computer readable storage medium having stored thereon a computer program which, when executed by one or more processors, implements a method of detecting contact lens mold print quality according to any one of claims 1-7.
CN202210200267.XA 2022-03-02 2022-03-02 Method and device for detecting printing quality of contact lens casting mold Pending CN114742752A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210200267.XA CN114742752A (en) 2022-03-02 2022-03-02 Method and device for detecting printing quality of contact lens casting mold

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210200267.XA CN114742752A (en) 2022-03-02 2022-03-02 Method and device for detecting printing quality of contact lens casting mold

Publications (1)

Publication Number Publication Date
CN114742752A true CN114742752A (en) 2022-07-12

Family

ID=82275958

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210200267.XA Pending CN114742752A (en) 2022-03-02 2022-03-02 Method and device for detecting printing quality of contact lens casting mold

Country Status (1)

Country Link
CN (1) CN114742752A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117269179A (en) * 2023-11-23 2023-12-22 平方和(北京)科技有限公司 High-precision detection method and system for edge defects of contact lens based on machine vision
CN117849072A (en) * 2024-01-15 2024-04-09 平方和(北京)科技有限公司 Contact lens casting mold printing defect detection method and system
CN118010759A (en) * 2024-04-08 2024-05-10 青岛天仁微纳科技有限责任公司 Detection method of nanoimprint image

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117269179A (en) * 2023-11-23 2023-12-22 平方和(北京)科技有限公司 High-precision detection method and system for edge defects of contact lens based on machine vision
CN117269179B (en) * 2023-11-23 2024-02-02 平方和(北京)科技有限公司 High-precision detection method and system for edge defects of contact lens based on machine vision
CN117849072A (en) * 2024-01-15 2024-04-09 平方和(北京)科技有限公司 Contact lens casting mold printing defect detection method and system
CN118010759A (en) * 2024-04-08 2024-05-10 青岛天仁微纳科技有限责任公司 Detection method of nanoimprint image

Similar Documents

Publication Publication Date Title
CN114742752A (en) Method and device for detecting printing quality of contact lens casting mold
TWI467515B (en) Multi-color dropout for scanned document
EP2359313B1 (en) Method and system for item identification
CN109507192B (en) Magnetic core surface defect detection method based on machine vision
US5751450A (en) Method and system for measuring color difference
CN111242896A (en) Color printing label defect detection and quality rating method
KR101776355B1 (en) Apparatus and methods for setting up optical inspection parameters
CN111028209B (en) Telephone silk-screen quality detection method and system
EP3896650A1 (en) Quality control system for series production
CN106650611B (en) Method and device for recognizing color of vehicle body
CN111122590A (en) Ceramic surface defect detection device and detection method
CN111766248A (en) Steel seal on-line detection system and method based on color CCD
CN109461156A (en) The threaded closure plug assembly and detection method of view-based access control model
CN115880297A (en) Quilt cover dyeing quality evaluation method based on machine vision
JP5727709B2 (en) Residue measuring method and residue measuring apparatus
CN114581536B (en) Image color difference detection method based on feature perception and multi-channel learning
Ouji et al. Chromatic/achromatic separation in noisy document images
Cui et al. Automated pattern recognition and defect inspection system
US10083516B2 (en) Method for segmenting a color image and digital microscope
JP6543845B2 (en) Color discrimination method and color discrimination device
JP4392268B2 (en) Surface inspection device
JP4961370B2 (en) Inspection method and inspection apparatus
CN110378403B (en) Wire spool classification and identification method and system
US20230038244A1 (en) Device for analysing a set of food particles and method thereof
CN109087289A (en) A kind of plate visual pattern detection algorithm under grid background

Legal Events

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