CN112215828B - Automatic mask cutting position adjusting method and system based on intelligent visual detection - Google Patents

Automatic mask cutting position adjusting method and system based on intelligent visual detection Download PDF

Info

Publication number
CN112215828B
CN112215828B CN202011125412.XA CN202011125412A CN112215828B CN 112215828 B CN112215828 B CN 112215828B CN 202011125412 A CN202011125412 A CN 202011125412A CN 112215828 B CN112215828 B CN 112215828B
Authority
CN
China
Prior art keywords
contour
mask
image
detected
obtaining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011125412.XA
Other languages
Chinese (zh)
Other versions
CN112215828A (en
Inventor
梁盛潮
李景全
位华伟
谢义亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Gaozhen Intelligent Equipment Co ltd
Original Assignee
Guangdong Gaozhen Intelligent Equipment 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 Guangdong Gaozhen Intelligent Equipment Co ltd filed Critical Guangdong Gaozhen Intelligent Equipment Co ltd
Priority to CN202011125412.XA priority Critical patent/CN112215828B/en
Publication of CN112215828A publication Critical patent/CN112215828A/en
Application granted granted Critical
Publication of CN112215828B publication Critical patent/CN112215828B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • G06T3/02
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/181Segmentation; Edge detection involving edge growing; involving edge linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20024Filtering details
    • 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

Abstract

The invention discloses a mask cutting position automatic adjusting method and system based on intelligent visual detection, which comprises an image acquisition unit, an image processing unit, an image marking unit, an analysis and calculation unit, an image judgment unit, an execution adjusting unit and a driving control unit, wherein the analysis and calculation unit is used for obtaining the center point coordinate and the contour direction of a contour in a mask contour set and obtaining a left deviation value and a right deviation value of a mask to be detected; the execution adjusting unit is used for operating the offset of the mask to be detected; the drive control unit is used for controlling the execution adjusting unit. According to the invention, the produced mask is detected in real time, so that a circle set and a fishtail folding part outline set are obtained, whether the left deviation value and the right deviation value of the mask to be detected meet the preset length deviation is judged, and finally, when the number of unqualified masks to be detected meets the preset detection condition, the adjustment shaft is controlled to adjust the cutting position of the mask to be detected according to the adjustment value.

Description

Automatic mask cutting position adjusting method and system based on intelligent visual detection
Technical Field
The invention relates to the technical field of mask production detection, in particular to a mask cutting position automatic adjusting method and system based on intelligent visual detection.
Background
In KF94 gauze mask production, when production speed changes or production material changes, the position of the relative ear area solder joint of cutting position of gauze mask may produce and change, all is debugging personnel on-the-spot observation now, and the cutting position when discovering the gauze mask is not to the right, adjusts through artifical rotation adjustment axle.
The method has the disadvantages that personnel is required to check the produced mask in real time, and when the cutting position is not aligned, the mask can be cut normally by manually rotating the adjusting shaft. The method requires that personnel have longer working experience and corresponding debugging skills, and also requires that the personnel have judgment for identifying the mask cutting position, needs the personnel to observe the production process of the mask machine in real time and manually rotate the adjusting wheel, greatly wastes manpower resources, and is not beneficial to popularization of automatic production.
Disclosure of Invention
Based on this, it is necessary to provide a mask cutting position automatic adjustment method and system based on intelligent visual detection aiming at the defects of the prior art, the mask cutting position is automatically detected, the labor cost is reduced, and meanwhile, the adjustment wheel can be automatically adjusted, so that the automatic production is realized.
In order to solve the technical problems, the technical scheme adopted by the invention is as follows: a mask cutting position automatic adjusting method based on intelligent visual detection comprises the following steps:
(1) acquiring an initial image Img1 of the mask to be detected;
(2) establishing an image coordinate system, and carrying out binarization processing on the initial image Img1 according to a fixed threshold algorithm to obtain an initial binarized image Img 2;
(3) constructing a circular structural element, and performing morphological closing processing on the initial binary image Img2 to obtain a closed-operation binary image Img 3;
(4) constructing a circular structural element, and performing morphological opening processing on the binary image Img3 subjected to the closing operation to obtain an opening operation binary image Img 4;
(5) judging the connected domain of the binary image Img4 subjected to the opening operation by a Two-Pass algorithm, acquiring all the connected domains in the binary image Img4 subjected to the opening operation, and judging the connected domain according to the opening operationFinding out the corresponding Contour of the connected domain in the binarized image Img4 from the connected domain in the computed binarized image Img4 to obtain an initial mask Contour set Contours
(6) According to the preset perimeter L of the maskmsBy the formula
Figure BDA0002733452370000021
Calculating initial mask Contour set ContoursThe number of contours meeting the requirements in the mask Contour set is obtainedm(ii) a Wherein, the preset perimeter L of the maskmsCL, the standard mask perimeter that has been converted to pixel lengthmSet Contour for initial mask ContoursThe contour length corresponding to the middle connected domain;
(7) and determining mask Contour set ContourmIf mask Contour set ContourmIf the number of the contours in the sequence is 0 or more than 1, then the step (29) is carried out; if mask Contour set ContourmIf the number of the contours in the step (5) is 1, then the step (8) is carried out;
(8) acquiring mask Contour set ContourmObtaining a mask Contour set Contour according to the corresponding space momentmCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcb(ii) a Set Contour according to mask outlinemCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcbObtaining the X-axis coordinate X of the central point of the mask to be detectedcbCenter point Y-axis coordinate YcbAnd the direction Phi of the contour in the image coordinate systemcb
(9) Constructing a transformation matrix McAccording to the constructed transformation matrix McAnd (4) obtaining the coordinates (X) of the center point of the mask to be detected in the image coordinate system in the step (8)cb,Ycb) Carrying out affine transformation to obtain the center point coordinate (X) of the mask to be detected after affine transformationcf,Ycf) (ii) a The initial image Img1 obtained in the step (1) is processedAffine transformation is carried out to obtain an image Img5 after affine transformation; carrying out affine transformation on the binary image Img4 subjected to the opening operation in the step (5) to obtain an affine-transformed image Img4 a;
(10) and generating an outer region rectangle Ro of the mask detection with the length Lr1 and the width Wr1, wherein the center point coordinate of the outer region rectangle Ro is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf) (ii) a Generating an inner area rectangle Ri with the length Lr2 and the width Wr2 for mask detection, wherein the center point coordinate of the inner area rectangle Ri is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf);
(11) Carrying out region subtraction on an outer region rectangle Ro detected by the mask and an inner region rectangle Ri detected by the mask to obtain a region Rt where the tail of the fish is located, and then setting the gray value of pixel points of an image region except the region Rt where the tail of the fish is located in the image Img5 or the image Img4a to be 0 to obtain an image Img5a or an image Img4b corresponding to the region Rt where the tail of the fish is located;
(12) judging the connected domains of the image Img4b through a Two-Pass algorithm, acquiring all the connected domains in the image Img4b, finding out the corresponding outline of the connected domains in the image Img4b according to the connected domains in the image Img4b, and obtaining an outline set Contour of the initial fish tailt
(13) According to the preset contour length L of the tail part of the fishnsBy the formula
Figure BDA0002733452370000031
Computing Contour set Contour of initial fish tailtThe number of Contour meeting the requirement in the middle is obtained, and the Contour set Contour of the fish tail is obtainedn(ii) a Wherein the preset contour length L of the fish tail partnsFor the contour length of a standard fish tail, CL, converted into pixel lengthsContour set Contour for initial fish tailtThe contour length corresponding to the middle connected domain;
(14) judging the Contour set Contour of the fish tailnThe number of contours in (1), if the set of contours at the tail of a fish is ContournIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fish tailnIf the number of the contours in the step (2) is equal to 2, then the step (15) is carried out;
(15) contour set according to the fish tailnCircle set to be synthesizedt
(16) Carrying out mean value filtering processing on the image Img5a to obtain a mean value filtering image Img5 b;
(17) performing linear transformation on the mean value filtering image Img5b to obtain an enhanced image Img5c, and obtaining a gray value corresponding to a pixel point in the enhanced image Img5 c;
(18) carrying out binarization processing on the enhanced image Img5c according to a fixed threshold algorithm to obtain a binarized image Img 6;
(19) constructing a circular structural element, and performing morphological closing processing on the binary image Img6 to obtain a closed-operation binary image Img6 a;
(20) constructing a circular structural element, and performing morphological opening processing on the binary image Img6a subjected to the closing operation to obtain an opening operation binary image Img6 b;
(21) judging the connected domains of the binary image Img6b subjected to the opening operation by a Two-Pass algorithm, acquiring all the connected domains in the binary image Img6b subjected to the opening operation, finding out the corresponding contours of the connected domains in the binary image Img6b according to the connected domains in the binary image Img6b subjected to the opening operation, and obtaining an initial fishtail folding part Contour set Contourd
(22) According to the preset contour length L of the fishtail folding partneBy the formula
Figure BDA0002733452370000041
Calculating initial fishtail folding part Contour set ContourdObtaining Contour set Contour of fishtail folding part according to the required Contour numbere(ii) a Wherein, the preset contour length L of the fishtail folding partneFor the contour length of the standard fishtail fold converted into pixel length, CLeSet Contour for initial fishtail fold ContourdThe contour length corresponding to the middle connected domain;
(23) judging the Contour set Contour of the fishtail folding parteIf the fishtail folding part Contour set ContoureIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fishtail folding parteIf the number of the contours in the step (2) is equal to 2, then the step (24) is carried out;
(24) obtaining the Contour set Contour of the fishtail folding parteTwo corresponding space moments to obtain a fishtail folding part Contour set ContoureCenter point coordinates (X) of two contourscd,Ycd)、(Xce,Yce);
(25) According to the X-axis coordinate value X of the center point of the mask to be detected after affine transformationcfCircle set CircletContour set Contour of fishtail folding parteThe two outlines in the middle are left and right distinguished to obtain a left circle, a right circle, a left outline and a right outline;
(26) obtaining the left Contour Contour according to the distance formula between the two pointsdlDistance Ll from center point to center of left circle, right ContourdrThe distance from the central point to the center of the right circle is Lr;
(27) obtaining a left deviation value Tl-dd and a right deviation value Tr-Lr-dd of the mask to be detected, and comparing the left deviation value Tl and the right deviation value Tr with a preset length deviation dr to judge whether the mask to be detected is qualified or not, wherein dd is a preset length standard value;
(28) if the number of unqualified to-be-detected masks meets the preset detection condition, adjusting the cutting position of the to-be-detected mask;
(29) and judging that the mask to be detected is a defective product, and conveying the mask to be detected to a product failing area.
Automatic mask cutting position adjusting system based on intelligent visual detection comprises
The image acquisition unit is used for acquiring an initial image Img1 of the mask to be detected;
obtaining an initial binary image Img2 and a binary image Img6 by a fixed threshold algorithm, obtaining binary images Img3 and Img6a which are closed by morphological closing processing, obtaining binary images Img4 and Img6b which are opened by morphological opening processing, obtaining an image Img3a by processing the binary image Img4 which is opened, obtaining an image Img5 and an image Img4a which are affine transformed by affine transformation, obtaining an image Img5a or an image Img4b which correspond to a region Rt where a tail of a fish is located, obtaining a mean filtering image Img5b by mean filtering processing, and obtaining an enhanced image Img5c by linear transformation;
an image marking unit for judging the connected domain of the binary image Img4 subjected to the binary operation by the Two-Pass algorithm to obtain the mask Contour set ContourmAnd judging a connected domain of the image Img4b to obtain a Contour set Contour of the fish tailnContour set according to the fish tailnCircle set to be synthesizedtAnd judging a connected domain of the binary image Img6b subjected to the run-on operation to obtain a fishtail folding part Contour set Contoure
An image determination unit for determining mask Contour set ContourmThe number of the outlines in the fish and the outline set Contour for judging the tail of the fishnThe number of the Contour in (1) and the Contour set Contour of the fishtail folding parteThe number of contours in (a);
an analysis and calculation unit for obtaining mask Contour set ContourmCenter point coordinate (X) of middle contourcb,Ycb) And the direction Phi of the contour in the image coordinate systemcbObtaining a left deviation value Tl and a right deviation value Tr of the mask to be detected;
the execution adjusting unit is used for operating the offset of the mask to be detected;
and the driving control unit is used for controlling the execution adjusting unit.
In summary, the automatic mask cutting position adjusting method and system based on intelligent visual detection provided by the invention can be used for detecting the produced masks in real time to obtain the Circle set CircletAnd the Contour set Contour of the fishtail folding parteAnd judging whether the left deviation value Tl and the right deviation value Tr of the mask to be detected meet the preset lengthAnd (5) degree deviation dr, and finally, when the number of unqualified masks to be detected meets a preset detection condition, controlling and adjusting the adjusting shaft according to the adjusting value da to finish the adjustment of the cutting position of the masks to be detected.
Drawings
FIG. 1 is a schematic structural diagram of the vision system for capturing an initial image of a mask to be detected by photographing;
FIG. 2 is a schematic structural diagram of an automatic mask cutting position adjustment system based on intelligent visual inspection according to the present invention;
FIG. 3 is a schematic diagram of an adjusting unit according to the present invention.
Detailed Description
For further understanding of the features and technical means of the present invention, as well as the specific objects and functions attained by the present invention, the present invention will be described in further detail with reference to the accompanying drawings and detailed description.
The invention relates to a mask cutting position automatic adjusting method based on intelligent visual detection, which comprises the following steps of:
(1) the vision system photographs the cut mask to be detected and collects an initial image Img1 of the mask to be detected, as shown in FIG. 1;
(2) establishing an image coordinate system, and carrying out binarization processing on the initial image Img1 according to a fixed threshold algorithm to obtain an initial binarized image Img2, wherein the fixed threshold algorithm formula is as follows:
Figure BDA0002733452370000061
wherein src (x, y) is a gray value of a pixel point of the initial image Img1 at (x, y), dst (x, y) is a gray value of a pixel point of the initial binarized image Img2 at (x, y), thresh and maxval are preset mask extraction gray values, in this embodiment, thresh is set to 230, maxval is set to 255, that is, when the initial image Img1 is binarized according to a fixed threshold algorithm, dst (x, y) in the initial binarized image Img2 is 0 when src (x, y) > thresh, and dst (x, y) in the binarized image Img2 is maxval when src (x, y) is not more than thresh; in the initial binary image Img2, the gray value of the pixel point at (x, y) is only 0 or 255.
(3) Constructing a circular structural element with the radius of 11.5 pixels, wherein the center of the circular structural element is positioned at the center of the circle of the circular structural element, and performing morphological closing processing on the initial binary image Img2 to fill small holes and bright interference points at a welding point on the initial binary image Img2 to obtain a closed binary image Img 3; the morphological close processing method is an operation method of firstly expanding and then corroding the initial binary image Img2, wherein expanded circular structural elements and corroded circular structural elements are used for processing the initial binary image Img2, the corroded circular structural elements and the expanded circular structural elements are set to be in a solid circular shape, and the radius of the solid circle is set to be 11.5 pixels in length.
(4) Constructing a circular structural element with the radius of 73.5 pixels, wherein the center of the circular structural element is positioned at the center of the circle of the circular structural element, and performing morphological opening processing on the binary image Img3 subjected to the closed operation to obtain an opening operation binary image Img4, wherein the opening operation binary image Img4 is used for removing the interference effect of an ear belt and a background conveying belt in the binary image Img3 subjected to the closed operation; the morphological opening processing method is an operation method of firstly corroding and then expanding the binary image Img3 subjected to the closing operation, wherein corroded circular structural elements and expanded circular structural elements are used for processing the binary image Img3 subjected to the closing operation, the corroded rectangular structural elements and the expanded circular structural elements are set to be in a solid circular shape, and the radius of the solid circle is set to be 73.5 pixels.
(5) Judging the connected domains of the binary image Img4 subjected to the open operation by a Two-Pass algorithm to obtain all the connected domains in the binary image Img4 subjected to the open operation, finding out the corresponding outline of the connected domains in the binary image Img4 according to the connected domains in the binary image Img4 subjected to the open operation, and obtaining an initial mask outline set ContoursThe contour corresponding to the connected component in the binary image Img4 obtained by the division operation is a curve composed of a plurality of pixel points, and the contour length corresponding to the connected component is obtained according to the number of the pixel points on the curve, for example, the contour length corresponding to the connected component is 100, that is, the contour length corresponding to the connected component is 100The outline representing the correspondence of the connected domain is composed of 100 pixel points. The Two-pass algorithm is a known technique, and is not described herein in detail.
(6) According to the preset perimeter L of the maskmsBy the formula
Figure BDA0002733452370000071
Calculating initial mask Contour set ContoursThe number of contours meeting the requirements in the mask Contour set is obtainedm(ii) a Wherein, the preset perimeter L of the maskmsCL, the standard mask perimeter that has been converted to pixel lengthmSet Contour for initial mask ContoursThe contour length corresponding to the middle connected domain; in this embodiment, taking millimeters as a unit, the preset perimeter of the mask is converted into the pixel length, i.e. the number of pixels, and the conversion formula is as follows:
Lpixel=Lreal/Rptr
in the embodiment, a calibration plate printed with two black dots is placed under a camera to take a picture to obtain a calibration image, wherein the radius of the black dots on the calibration plate is 6mm, the distance between the two black dots is 80mm, and the actual ratio Rptr of the pixels is calculated according to the calibration image.
(7) And determining mask Contour set ContourmIf mask Contour set ContourmIf the number of the contours in the sequence is 0 or more than 1, then the step (29) is carried out; if mask Contour set ContourmIf the number of contours in (1) is 1, go to step (8).
(8) And integrating the mask Contour set in a binary image Img4mSetting the gray value of the pixel point of the image area outside the middle outline to be 0 to obtain an image Img3a, and obtaining the image Img3a through a formula
Figure BDA0002733452370000081
Mask Contour set Contour acquisition methodmCorresponding spatial moment, wherein mjiSet Contour for maskmCorresponding space moment, array (x, y) is the gray value of the image Img3a at (x, y), j is 0-3, i is 0-3, and then mask Contour set Contour is obtainedmCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcb(ii) a Set Contour according to mask outlinemCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcbObtaining the X-axis coordinate of the central point of the mask to be detected
Figure BDA0002733452370000082
Y-axis coordinate of center point
Figure BDA0002733452370000083
Contour directions Phi in the image coordinate systemcb=-0.5atan2(2m11,m02-m20) The algorithm of the spatial moment is a known technique, and need not be described herein, and in this embodiment, only m in the spatial moment is used10、m01、m00、、m11、m20、m02Correspondingly, j is 1, i is 0; j is 0, i is 1; j is 0, i is 0; j is 1, i is 1; j is 2, i is 0; j is 0 and i is 2.
(9) Constructed with coordinates (X)cb,Ycb) Centered at PhicbTransformation matrix M for rotation anglecAccording to the constructed transformation matrix McAnd (4) obtaining the coordinates (X) of the center point of the mask to be detected in the image coordinate system in the step (8)cb,Ycb) Carrying out affine transformation to obtain the center point coordinate (X) of the mask to be detected after affine transformationcf,Ycf) (ii) a Carrying out affine transformation on the initial image Img1 obtained in the step (1) to obtain an affine-transformed image Img 5; carrying out affine transformation on the binary image Img4 subjected to the opening operation in the step (5) to obtain an affine transformed binary imageChanged image Img4 a; wherein, the established transformation matrix and the affine transformation are known in the prior art, which need not be described in detail herein, and the general matrix M of affine transformationafIs composed of
Figure BDA0002733452370000084
(tx,ty) Indicating the amount of translation, a1、a2、a3、a4Reflecting changes such as image rotation, zooming, etc., in the present embodiment, a1=cos(Phicb),a2=-sin(Phicb),a3=sin(Phicb),a4=cos(Phicb),tx=Xcb,ty=YcbI.e. matrices of affine transformations in the present embodiment
Figure BDA0002733452370000085
Figure BDA0002733452370000086
Affine transformation formula as
Figure BDA0002733452370000091
(X, Y) is the image pixel coordinates before affine transformation, and (X ', Y') is the image pixel coordinates after affine transformation.
(10) And generating an outer region rectangle Ro of the mask detection with the length Lr1 and the width Wr1, wherein the center point coordinate of the outer region rectangle Ro is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf) The setting value of Lr1 is 1100, the setting value of Wr1 is 60, the length of the standard mask is 1000, and the length of Lr1 is 100 pixels longer than that of the standard mask; generating an inner area rectangle Ri with the length Lr2 and the width Wr2 for mask detection, wherein the center point coordinate of the inner area rectangle Ri is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf) The setting value of Lr2 is 830, the setting value of Wr2 is 60, and the above numerical units are pixel lengths.
As shown in fig. 1, the external area rectangle Ro detected by the mask and the internal area rectangles Ri detected by the mask are Lr1, Lr2, Wr1 and Wr2 which provide the above set values, so as to mainly facilitate the extraction of the areas where the fish tail a and the fish tail folding part B are located, wherein the fish tail a is the tail positions of both ends of the KF94 mask in the length direction, and the fish tail folding part B is the diamond position of the fish tail folding part.
In this embodiment, the mask-detected outer region rectangle Ro and the mask-detected inner region rectangle Ri may be generated in the affine-transformed image Img5 or Img4 a.
(11) Carrying out region subtraction on an outer region rectangle Ro detected by the mask and an inner region rectangle Ri detected by the mask to obtain a region Rt where the tail of the fish is located, and then setting the gray value of pixel points of an image region except the region Rt where the tail of the fish is located in the image Img5 or the image Img4a to be 0 to obtain an image Img5a or an image Img4b corresponding to the region Rt where the tail of the fish is located;
(12) judging the connected domains of the image Img4b through a Two-Pass algorithm, acquiring all the connected domains in the image Img4b, finding out the corresponding outline of the connected domains in the image Img4b according to the connected domains in the image Img4b, and obtaining an outline set Contour of the initial fish tailtThe outline corresponding to the connected domain in the image Img4b is a curve composed of a plurality of pixel points, and the length of the outline corresponding to the connected domain is obtained according to the number of the pixel points on the curve, for example, the length of the outline corresponding to the connected domain is 100, that is, the outline corresponding to the connected domain is composed of 100 pixel points.
(13) According to the preset contour length L of the tail part of the fishnsBy the formula
Figure BDA0002733452370000101
Computing Contour set Contour of initial fish tailtThe number of Contour meeting the requirement in the middle is obtained, and the Contour set Contour of the fish tail is obtainedn(ii) a Wherein the preset contour length L of the fish tail partnsFor the contour length of a standard fish tail, CL, converted into pixel lengthsContour set Contour for initial fish tailtThe contour length corresponding to the middle connected domain; in this embodiment, the preset contour length of the fish tail is converted in millimetersThe length of the imaging pixel.
(14) Judging the Contour set Contour of the fish tailnThe number of contours in (1), if the set of contours at the tail of a fish is ContournIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fish tailnIf the number of contours in (1) is equal to 2, then step (15) is performed.
(15) Contour set according to the fish tailnCircle set to be synthesizedtThe algorithm for fitting the contours into the circle is known in the art, and need not be described herein.
(16) And carrying out mean value filtering processing on the image Img5a according to a formula
Figure BDA0002733452370000102
Obtaining a mean value filtering image Img5b, where src1(x, y) is a gray value of a pixel point of the image Img5a at (x, y), dst1(x, y) is a gray value of a pixel point of the image Img5b at (x, y), h (k, l) is a filtering kernel, k, l represent the size of the filtering kernel, k and l are both odd numbers, and in this embodiment, k and l both take the value of 7.
(17) Performing linear transformation on the mean value filtering image Img5b to enhance the contrast, obtaining an enhanced image Img5c, and obtaining a gray value corresponding to a pixel point in the enhanced image Img5 c; in this embodiment, the method for performing linear transformation on the mean filtered image Img5b to obtain an enhanced image Img5c and obtaining a gray value corresponding to a pixel point in the enhanced image Img5c includes the following steps:
by linear transformation of the formula Pixeln=3*Pixelo+0 traversal of the Pixel points in the mean-filtered image Img5c, where PixeloIs the gray value, Pixel, of the Pixel point in the mean filtered image Img5bn0 is an offset value for the gray value corresponding to the pixel point in the enhanced image Img5 c;
obtaining gray value Pixel corresponding to Pixel point in the enhanced image Img5cnIf PixelnIf greater than 255, Pixeln255; if PixelnLess than 0, Pixeln0; if PixelnBetween 0 and 255, then PixelnEqual to 3 pixelso+0。
(18) And performing binarization processing on the enhanced image Img5c according to a fixed threshold algorithm to obtain a binarized image Img 6.
(19) Constructing a circular structural element with the radius of 9.5 pixels, wherein the center of the circular structural element is positioned at the center of the circle of the circular structural element, and performing morphological closing processing on the binary image Img6 to obtain a closed-operation binary image Img6 a; wherein, the corroded circular structural element and the expanded circular structural element are both set to be solid circles, and the radius of each solid circle is set to be 9.5 pixels in length.
(20) Constructing a circular structural element with the radius of 15.5 pixels, wherein the center of the circular structural element is positioned at the center of the circle of the circular structural element, and performing morphological opening processing on the binary image Img6a subjected to the closed operation to obtain an opening operation binary image Img6 b; wherein, the corroded rectangular structural element and the expanded circular structural element are both set to be in the shape of a solid circle, and the radius of the solid circle is set to be 15.5 pixels in length.
(21) Judging the connected domains of the binary image Img6b subjected to the opening operation by a Two-Pass algorithm, acquiring all the connected domains in the binary image Img6b subjected to the opening operation, finding out the corresponding contours of the connected domains in the binary image Img6b according to the connected domains in the binary image Img6b subjected to the opening operation, and obtaining an initial fishtail folding part Contour set Contourd
(22) According to the preset contour length L of the fishtail folding partneBy the formula
Figure BDA0002733452370000111
Calculating initial fishtail folding part Contour set ContourdObtaining Contour set Contour of fishtail folding part according to the required Contour numbere(ii) a Wherein, the preset contour length L of the fishtail folding partneFor the contour length of the standard fishtail fold converted into pixel length, CLeSet Contour for initial fishtail fold ContourdThe contour length corresponding to the middle connected domain.
(23) Judging the folding of the fish tailPart Contour set ContoureIf the fishtail folding part Contour set ContoureIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fishtail folding parteIf the number of contours in (1) is equal to 2, the process proceeds to step (24).
(24) Obtaining the Contour set Contour of the fishtail folding part through an algorithm of the space momenteCorresponding two space moments, thereby obtaining a Contour set Contour of the fishtail folding parteCenter point coordinates (X) of two contourscd,Ycd)、(Xce,Yce)。
(25) According to the X-axis coordinate value X of the center point of the mask to be detected after affine transformation in the step (9)cfCircle set CircletContour set Contour of fishtail folding parteThe two outlines in the middle are left and right distinguished to obtain a left circle, a right circle, a left outline and a right outline.
Circle set CircletThe coordinate value of the center of the circle on the X axis is less than XcfThe Circle of (A) is a left CircletlCircle set CircletThe coordinate value of the center of the circle on the X axis is larger than XcfThe Circle of (A) is a right Circletr(ii) a Wherein, the CircletlThe corresponding center coordinates are (Xcil, Ycil), CircletrThe corresponding circle center is (Xcir, Ycir).
Similarly, the Contour set Contour of the fishtail foldeThe central point X-axis coordinate value is less than XcfIs the left ContourdlContour set Contour of fishtail foldeThe central point X-axis coordinate value is greater than XcfIs the right ContourdrWherein ContourdlThe coordinates of the center point of the corresponding Contour are (Xcol, Ycol), ContourdrThe corresponding circle center is (Xcor, Ycor).
(26) Obtaining the left Contour Contour according to the distance formula between the two pointsdlDistance Ll from center point to center of left circle, right ContourdrThe distance from the center point to the center of the right circle is Lr.
(27) Obtaining a left deviation value Tl-dd and a right deviation value Tr-Lr-dd of the mask to be detected, and comparing the left deviation value Tl and the right deviation value Tr with a preset length deviation dr to judge whether the mask to be detected is qualified, wherein dd is a preset length standard value, if the Tl | > dr or the Tr | > dr is judged, the mask to be detected is unqualified, and particularly, folding positions corresponding to upper and lower diamond edges of the outline of the mask are unqualified; if the absolute Tl is less than or equal to dr and the absolute Tr is less than or equal to dr, the mask to be detected is qualified.
(28) If unqualified treat that the gauze mask quantity satisfies and predetermine the detection condition, then treat the position of cutting that detects the gauze mask and adjust, treat that the gauze mask cuts before treating promptly, the control adjusting spindle rotates and accomplishes the skew operation of treating the detection gauze mask to make the left deviation value Tl and the right deviation value Tr of treating the gauze mask after cutting satisfy and treat the qualified condition of detection gauze mask.
Wherein, unqualified gauze mask quantity satisfies predetermineeing the detection condition, include:
continuously detecting that the number of unqualified masks to be detected exceeds a number set value or detecting a preset number of masks to be detected, and detecting that the number percentage of unqualified masks to be detected exceeds a number percentage set value.
In this embodiment, the number setting value may be 30, the preset number is 100, and the number percentage setting value is 50%, specifically, when the number of unqualified masks to be detected exceeds 30, the cutting position of the mask to be detected is automatically adjusted; or when the percentage of the number of unqualified masks to be detected exceeds 50% in 100 masks to be detected, the cutting position of the masks to be detected is automatically adjusted.
Specifically, in the step (28), if the number of unqualified masks to be detected meets the preset detection condition, the method for adjusting the cutting position of the masks to be detected specifically comprises the following steps:
and obtaining an adjusting value da, wherein the adjusting value da can be obtained through the average value of all the deviation values Tl exceeding the left side and the right side in the unqualified mask to be detected, and can also be obtained through the middle value of all the deviation values Tl exceeding the left side and the right side in the unqualified mask to be detected.
And controlling and adjusting the adjusting shaft according to the adjusting value da, so that the offset of the mask to be detected is operated, the adjustment of the cutting position of the mask to be detected is completed, and the left deviation value Tl and the right deviation value Tr of the cut mask to be detected meet the qualification conditions of the mask to be detected.
And (3) repeating the steps (1) to (28) after the adjustment operation on the adjustment shaft is finished, and sending an alarm to perform manual intervention when the adjustment operation on the adjustment shaft is continuously performed for a number of times which exceeds a set value but does not reach a desired adjustment result.
(29) And judging that the mask to be detected is a defective product, and conveying the mask to be detected to a product failing area.
As shown in fig. 2, according to the mask cutting position automatic adjustment method based on intelligent visual inspection of the present invention, the present invention provides an automatic mask cutting position adjustment system based on intelligent visual inspection, which firstly performs real-time inspection on the produced mask by using a visual system, and further obtains a Circle set CircletAnd the Contour set Contour of the fishtail folding parteAnd finally, controlling and adjusting the adjusting shaft according to the adjusting value da to complete the adjustment of the cutting position of the mask to be detected when the number of unqualified masks to be detected meets the preset detection condition.
The invention relates to a mask cutting position automatic adjusting system based on intelligent visual detection, which comprises:
the image acquisition unit is used for acquiring an initial image Img1 of the mask to be detected;
an image processing unit, configured to obtain an initial binary image Img2 and a binary image Img6 by a fixed threshold algorithm, obtain binary images Img3 and Img6a of a closed operation by a morphological closed process, obtain binary images Img4 and Img6b of an open operation by a morphological open process, obtain an image Img3a by processing a binary image Img4 of an open operation, obtain an image Img5 and an image Img4a of an affine transformation after the affine transformation, obtain an image Img5a or an image Img4b corresponding to a region Rt where a tail of a fish is located, obtain a mean filtered image Img5b by a mean filtering process, and obtain an enhanced image Img5c by a linear transformation;
an image marking unit for judging the connected domain of the binary image Img4 subjected to the binary operation by the Two-Pass algorithm to obtain the mask Contour set ContourmAnd judging a connected domain of the image Img4b to obtain a Contour set Contour of the fish tailnContour set according to the fish tailnCircle set to be synthesizedtAnd judging a connected domain of the binary image Img6b subjected to the run-on operation to obtain a fishtail folding part Contour set Contoure
An image determination unit for determining mask Contour set ContourmThe number of the outlines in the fish and the outline set Contour for judging the tail of the fishnThe number of the Contour in (1) and the Contour set Contour of the fishtail folding parteThe number of contours in (a);
an analysis and calculation unit for obtaining mask Contour set ContourmCenter point coordinate (X) of middle contourcb,Ycb) And the direction Phi of the contour in the image coordinate systemcbObtaining a left deviation value Tl and a right deviation value Tr of the mask to be detected;
an execution adjusting unit, configured to operate the offset of the mask to be detected, specifically, as shown in fig. 3, the execution adjusting unit includes a driving motor 10, a rotating shaft 20, a first bevel gear 30, a second bevel gear 40, a screw rod 50, a nut slider 60, and an adjusting shaft 70, the driving motor 10 drives the rotating shaft 20 to rotate, the first bevel gear 30 is fixed on the rotating shaft 20, one end of the screw rod 50 is connected to the second bevel gear 40, the nut slider 60 is clamped on the screw rod 50, the adjusting shaft 70 is connected to the nut slider 60, the rotating shaft 20 rotates to drive the first bevel gear 30 to rotate, so that the second bevel gear 40 rotates, the second bevel gear 40 rotates to drive the screw rod 50 to rotate, the screw rod 50 rotates to drive the nut slider 60 to slide up and down along the screw rod 50, and since the adjusting shaft 70 is fixedly connected to the nut slider 60, thereby enabling the adjusting shaft 70 to move up and down, realizing the position adjustment of the conveying mask and further completing the adjustment of the cutting position of the conveying mask;
a drive control unit for obtaining the adjustment value da and controlling the execution of the adjustment unit according to the adjustment value da.
In summary, the automatic mask cutting position adjusting method and system based on intelligent visual detection provided by the invention can be used for detecting the produced masks in real time to obtain the Circle set CircletAnd the Contour set Contour of the fishtail folding parteAnd finally, controlling the adjusting shaft 70 to adjust the cutting position of the mask to be detected according to the adjusting value da when the number of unqualified masks to be detected meets the preset detection condition.
The above examples are merely illustrative of several embodiments of the present invention, and the description thereof is more specific and detailed, but not to be construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present invention should be subject to the appended claims.

Claims (10)

1. A mask cutting position automatic adjusting method based on intelligent visual detection is characterized by comprising the following steps:
(1) acquiring an initial image Img1 of the mask to be detected;
(2) establishing an image coordinate system, and carrying out binarization processing on the initial image Img1 according to a fixed threshold algorithm to obtain an initial binarized image Img 2;
(3) constructing a circular structural element, and performing morphological closing processing on the initial binary image Img2 to obtain a closed-operation binary image Img 3;
(4) constructing a circular structural element, and performing morphological opening processing on the binary image Img3 subjected to the closing operation to obtain an opening operation binary image Img 4;
(5) judging the connected domain of the binary image Img4 subjected to the on operation by a Two-Pass algorithm to obtain all the connected domains in the binary image Img4 subjected to the on operation,and finding out the corresponding Contour of the connected domain in the binarized image Img4 according to the connected domain in the binarized image Img4 subjected to the opening operation to obtain an initial mask Contour set Contours
(6) According to the preset perimeter L of the maskmsBy the formula
Figure FDA0002733452360000011
Calculating initial mask Contour set ContoursThe number of contours meeting the requirements in the mask Contour set is obtainedm(ii) a Wherein, the preset perimeter L of the maskmsCL, the standard mask perimeter that has been converted to pixel lengthmSet Contour for initial mask ContoursThe contour length corresponding to the middle connected domain;
(7) and determining mask Contour set ContourmIf mask Contour set ContourmIf the number of the contours in the sequence is 0 or more than 1, then the step (29) is carried out; if mask Contour set ContourmIf the number of the contours in the step (5) is 1, then the step (8) is carried out;
(8) acquiring mask Contour set ContourmObtaining a mask Contour set Contour according to the corresponding space momentmCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcb(ii) a Set Contour according to mask outlinemCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcbObtaining the X-axis coordinate X of the central point of the mask to be detectedcbCenter point Y-axis coordinate YcbAnd the direction Phi of the contour in the image coordinate systemcb
(9) Constructing a transformation matrix McAccording to the constructed transformation matrix McAnd (4) obtaining the coordinates (X) of the center point of the mask to be detected in the image coordinate system in the step (8)cb,Ycb) Carrying out affine transformation to obtain the center point coordinate (X) of the mask to be detected after affine transformationcf,Ycf) (ii) a For the initial stage obtained in step (1)Carrying out affine transformation on the original image Img1 to obtain an affine-transformed image Img 5; carrying out affine transformation on the binary image Img4 subjected to the opening operation in the step (5) to obtain an affine-transformed image Img4 a;
(10) and generating an outer region rectangle Ro of the mask detection with the length Lr1 and the width Wr1, wherein the center point coordinate of the outer region rectangle Ro is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf) (ii) a Generating an inner area rectangle Ri with the length Lr2 and the width Wr2 for mask detection, wherein the center point coordinate of the inner area rectangle Ri is the center point coordinate (X) of the mask to be detected after affine transformation in the step (9)cf,Ycf);
(11) Carrying out region subtraction on an outer region rectangle Ro detected by the mask and an inner region rectangle Ri detected by the mask to obtain a region Rt where the tail of the fish is located, and then setting the gray value of pixel points of an image region except the region Rt where the tail of the fish is located in the image Img5 or the image Img4a to be 0 to obtain an image Img5a or an image Img4b corresponding to the region Rt where the tail of the fish is located;
(12) judging the connected domains of the image Img4b through a Two-Pass algorithm, acquiring all the connected domains in the image Img4b, finding out the corresponding outline of the connected domains in the image Img4b according to the connected domains in the image Img4b, and obtaining an outline set Contour of the initial fish tailt
(13) According to the preset contour length L of the tail part of the fishnsBy the formula
Figure FDA0002733452360000021
Computing Contour set Contour of initial fish tailtThe number of Contour meeting the requirement in the middle is obtained, and the Contour set Contour of the fish tail is obtainedn(ii) a Wherein the preset contour length L of the fish tail partnsFor the contour length of a standard fish tail, CL, converted into pixel lengthsContour set Contour for initial fish tailtThe contour length corresponding to the middle connected domain;
(14) judging the Contour set Contour of the fish tailnNumber of profiles in, if fish tail wheelContour set ContournIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fish tailnIf the number of the contours in the step (2) is equal to 2, then the step (15) is carried out;
(15) contour set according to the fish tailnCircle set to be synthesizedt
(16) Carrying out mean value filtering processing on the image Img5a to obtain a mean value filtering image Img5 b;
(17) performing linear transformation on the mean value filtering image Img5b to obtain an enhanced image Img5c, and obtaining a gray value corresponding to a pixel point in the enhanced image Img5 c;
(18) carrying out binarization processing on the enhanced image Img5c according to a fixed threshold algorithm to obtain a binarized image Img 6;
(19) constructing a circular structural element, and performing morphological closing processing on the binary image Img6 to obtain a closed-operation binary image Img6 a;
(20) constructing a circular structural element, and performing morphological opening processing on the binary image Img6a subjected to the closing operation to obtain an opening operation binary image Img6 b;
(21) judging the connected domains of the binary image Img6b subjected to the opening operation by a Two-Pass algorithm, acquiring all the connected domains in the binary image Img6b subjected to the opening operation, finding out the corresponding contours of the connected domains in the binary image Img6b according to the connected domains in the binary image Img6b subjected to the opening operation, and obtaining an initial fishtail folding part Contour set Contourd
(22) According to the preset contour length L of the fishtail folding partneBy the formula
Figure FDA0002733452360000031
Calculating initial fishtail folding part Contour set ContourdObtaining Contour set Contour of fishtail folding part according to the required Contour numbere(ii) a Wherein, the preset contour length L of the fishtail folding partneFor the contour length of the standard fishtail fold converted into pixel length, CLeSet Contour for initial fishtail fold ContourdContour corresponding to middle connected domainA length;
(23) judging the Contour set Contour of the fishtail folding parteIf the fishtail folding part Contour set ContoureIf the number of the contours in the step (1) is not equal to 2, then the step (29) is carried out; if the Contour set Contour of the fishtail folding parteIf the number of the contours in the step (2) is equal to 2, then the step (24) is carried out;
(24) obtaining the Contour set Contour of the fishtail folding parteTwo corresponding space moments to obtain a fishtail folding part Contour set ContoureCenter point coordinates (X) of two contourscd,Ycd)、(Xce,Yce);
(25) According to the X-axis coordinate value X of the center point of the mask to be detected after affine transformationcfCircle set CircletContour set Contour of fishtail folding parteThe two outlines in the middle are left and right distinguished to obtain a left circle, a right circle, a left outline and a right outline;
(26) obtaining the left Contour Contour according to the distance formula between the two pointsdlDistance Ll from center point to center of left circle, right ContourdrThe distance from the central point to the center of the right circle is Lr;
(27) obtaining a left deviation value Tl-dd and a right deviation value Tr-Lr-dd of the mask to be detected, and comparing the left deviation value Tl and the right deviation value Tr with a preset length deviation dr to judge whether the mask to be detected is qualified or not, wherein dd is a preset length standard value;
(28) if the number of unqualified to-be-detected masks meets the preset detection condition, adjusting the cutting position of the to-be-detected mask;
(29) and judging that the mask to be detected is a defective product, and conveying the mask to be detected to a product failing area.
2. The method for automatically adjusting mask cutting position based on intelligent visual inspection as claimed in claim 1, wherein in the step (8), mask Contour set Contour is obtainedmObtaining a mask Contour set Contour according to the corresponding space momentmCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcbThe method comprises the following steps:
mask Contour set Contour is set in binary image Img4 of opening operationmSetting the gray value of the pixel point of the image area outside the middle outline to be 0 to obtain an image Img3a, and obtaining the image Img3a through a formula
Figure FDA0002733452360000041
Mask Contour set Contour acquisition methodmCorresponding spatial moment, wherein mjiSet Contour for maskmCorresponding space moment, array (x, y) is the gray value of the image Img3a at (x, y), j is 0-3, i is 0-3, and then mask Contour set Contour is obtainedmCenter point coordinate (X) of middle contourcb,Ycb) And mask Contour set ContourmContour direction Phi of the middle contour in the image coordinate systemcb
3. The automatic mask cutting position adjusting method based on intelligent visual inspection according to claim 1, wherein the method comprises the following steps: the outer region rectangle Ro for mask detection and the inner region rectangle Ri for mask detection in the step (10) are generated in the affine-transformed image Img5 or image Img4 a.
4. The method for automatically adjusting mask cutting positions based on intelligent visual inspection as claimed in claim 1, wherein the step (16) of performing mean filtering on the image Img5a to obtain a mean filtered image Img5b comprises:
carrying out mean value filtering processing on the image Img5a according to a formula
Figure FDA0002733452360000042
Obtaining a mean value filtering image Img5b, wherein src1(x, y) is the gray value of a pixel point of the image Img5a at (x, y), dst1(x, y) is the gray value of a pixel point of the image Img5b at (x, y), h (k, l) is a filtering kernel, and k, l represents the size of the filtering kernel,k and l are both odd numbers.
5. The method for automatically adjusting mask cutting positions based on intelligent visual inspection according to claim 1, wherein the step (17) of performing linear transformation on the mean filtered image Img5b to obtain an enhanced image Img5c, and obtaining gray values corresponding to pixel points in the enhanced image Img5c comprises:
by linear transformation of the formula Pixeln=3*Pixelo+0 traversal of the Pixel points in the mean-filtered image Img5c, where PixeloIs the gray value, Pixel, of the Pixel point in the mean filtered image Img5bn0 is an offset value for the gray value corresponding to the pixel point in the enhanced image Img5 c;
obtaining gray value Pixel corresponding to Pixel point in the enhanced image Img5cnIf PixelnIf greater than 255, Pixeln255; if PixelnLess than 0, Pixeln0; if PixelnBetween 0 and 255, then PixelnEqual to 3 pixelso+0。
6. The mask cutting position automatic adjustment method based on intelligent visual inspection according to claim 1, wherein in the step (25), the X-axis coordinate value X of the center point of the mask to be inspected is obtained according to the affine transformationcfCircle set CircletContour set Contour of fishtail folding parteThe method for obtaining the left circle, the right circle, the left outline and the right outline by left-right distinguishing of the two outlines in the step (1) comprises the following steps:
circle set CircletThe coordinate value of the center of the circle on the X axis is less than XcfThe Circle of (A) is a left CircletlCircle set CircletThe coordinate value of the center of the circle on the X axis is larger than XcfThe Circle of (A) is a right Circletr(ii) a Wherein, the CircletlThe corresponding center coordinates are (Xcil, Ycil), CircletrThe corresponding circle center is (Xcir, Ycir);
contour set Contour of fishtail folding parteThe central point X-axis coordinate value is less than XcfWheel (D)Contour is left ContourdlContour set Contour of fishtail foldeThe central point X-axis coordinate value is greater than XcfIs the right ContourdrWherein ContourdlThe coordinates of the center point of the corresponding Contour are (Xcol, Ycol), ContourdrThe corresponding circle center is (Xcor, Ycor).
7. The method for automatically adjusting the cutting position of the mask based on the intelligent visual inspection as claimed in claim 1, wherein the step (27) of obtaining the left deviation value Tl-dd and the right deviation value Tr-Lr-dd of the mask to be inspected, and the method for determining whether the mask to be inspected is qualified by comparing the left deviation value Tl and the right deviation value Tr with the preset length deviation dr comprises:
if the absolute value Tl > dr or the absolute value Tr > dr is greater, the mask to be detected is unqualified; if the absolute Tl is less than or equal to dr and the absolute Tr is less than or equal to dr, the mask to be detected is qualified.
8. The automatic mask cutting position adjusting method based on intelligent visual inspection according to claim 1, wherein the step of enabling the number of unqualified masks to meet the preset detection conditions comprises the following steps:
continuously detecting that the number of unqualified masks to be detected exceeds a number set value or detecting a preset number of masks to be detected, and detecting that the number percentage of unqualified masks to be detected exceeds a number percentage set value.
9. The automatic mask cutting position adjusting method based on intelligent visual inspection according to claim 1, wherein in the step (28), if the number of unqualified masks to be inspected meets the preset inspection conditions, the method for adjusting the cutting position of the mask to be inspected comprises the following steps:
obtaining an adjusting value da, wherein the adjusting value da is obtained through the average value of all the deviation values which exceed the left deviation value Tl and the right deviation value Tr in the unqualified mask to be detected or obtained through the middle value of all the deviation values which exceed the left deviation value Tl and the right deviation value Tr in the unqualified mask to be detected;
the adjustment shaft is controlled according to the adjustment value da.
10. The utility model provides a gauze mask cuts position automatic regulating system based on intelligent visual detection which characterized in that: comprises that
The image acquisition unit is used for acquiring an initial image Img1 of the mask to be detected;
obtaining an initial binary image Img2 and a binary image Img6 by a fixed threshold algorithm, obtaining binary images Img3 and Img6a which are closed by morphological closing processing, obtaining binary images Img4 and Img6b which are opened by morphological opening processing, obtaining an image Img3a by processing the binary image Img4 which is opened, obtaining an image Img5 and an image Img4a which are affine transformed by affine transformation, obtaining an image Img5a or an image Img4b which correspond to a region Rt where a tail of a fish is located, obtaining a mean filtering image Img5b by mean filtering processing, and obtaining an enhanced image Img5c by linear transformation;
an image marking unit for judging the connected domain of the binary image Img4 subjected to the binary operation by the Two-Pass algorithm to obtain the mask Contour set ContourmAnd judging a connected domain of the image Img4b to obtain a Contour set Contour of the fish tailnContour set according to the fish tailnCircle set to be synthesizedtAnd judging a connected domain of the binary image Img6b subjected to the run-on operation to obtain a fishtail folding part Contour set Contoure
An image determination unit for determining mask Contour set ContourmThe number of the outlines in the fish and the outline set Contour for judging the tail of the fishnThe number of the Contour in (1) and the Contour set Contour of the fishtail folding parteThe number of contours in (a);
an analysis and calculation unit for obtaining mask Contour set ContourmCenter point coordinate (X) of middle contourcb,Ycb) And the direction Phi of the contour in the image coordinate systemcbObtaining a left deviation value Tl and a right deviation value Tr of the mask to be detected;
the execution adjusting unit is used for operating the offset of the mask to be detected;
and the driving control unit is used for controlling the execution adjusting unit.
CN202011125412.XA 2020-10-20 2020-10-20 Automatic mask cutting position adjusting method and system based on intelligent visual detection Active CN112215828B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011125412.XA CN112215828B (en) 2020-10-20 2020-10-20 Automatic mask cutting position adjusting method and system based on intelligent visual detection

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011125412.XA CN112215828B (en) 2020-10-20 2020-10-20 Automatic mask cutting position adjusting method and system based on intelligent visual detection

Publications (2)

Publication Number Publication Date
CN112215828A CN112215828A (en) 2021-01-12
CN112215828B true CN112215828B (en) 2022-03-15

Family

ID=74056124

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011125412.XA Active CN112215828B (en) 2020-10-20 2020-10-20 Automatic mask cutting position adjusting method and system based on intelligent visual detection

Country Status (1)

Country Link
CN (1) CN112215828B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114441499B (en) * 2022-04-11 2022-07-12 天津美腾科技股份有限公司 Grade detection method and device, identification equipment, ore pulp grade instrument and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4393399A (en) * 1979-05-18 1983-07-12 Dr. -Ing. Rudolf Hell Gmbh Method and apparatus for partial electronic retouching of colors
JPH01175366A (en) * 1987-12-28 1989-07-11 Canon Inc Image processor
CN103052877A (en) * 2010-09-14 2013-04-17 西门子公司 Apparatus and method for automatic inspection of through-holes of component
CN107014822A (en) * 2017-02-28 2017-08-04 深圳市维图视技术有限公司 A kind of non-woven fabrics gauze mask defective vision detecting system and method
CN109374635A (en) * 2018-11-20 2019-02-22 深圳市维图视技术有限公司 A kind of mask defect detecting device and method
CN109765238A (en) * 2018-12-12 2019-05-17 弓立(厦门)医疗用品有限公司 A kind of product quality detection method of mask fully-automatic production detection device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2295930B1 (en) * 2008-06-04 2014-01-01 Kabushiki Kaisha Kobe Seiko Sho Tire shape inspection method and tire shape inspection device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4393399A (en) * 1979-05-18 1983-07-12 Dr. -Ing. Rudolf Hell Gmbh Method and apparatus for partial electronic retouching of colors
JPH01175366A (en) * 1987-12-28 1989-07-11 Canon Inc Image processor
CN103052877A (en) * 2010-09-14 2013-04-17 西门子公司 Apparatus and method for automatic inspection of through-holes of component
CN107014822A (en) * 2017-02-28 2017-08-04 深圳市维图视技术有限公司 A kind of non-woven fabrics gauze mask defective vision detecting system and method
CN109374635A (en) * 2018-11-20 2019-02-22 深圳市维图视技术有限公司 A kind of mask defect detecting device and method
CN109765238A (en) * 2018-12-12 2019-05-17 弓立(厦门)医疗用品有限公司 A kind of product quality detection method of mask fully-automatic production detection device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于机器视觉的口罩带缺失检测方法研究;翁敬喻;《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》;20190815;第B024-271页 *

Also Published As

Publication number Publication date
CN112215828A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
CN108776140B (en) Machine vision-based printed matter flaw detection method and system
CN105067638B (en) Tire fetal membrane face character defect inspection method based on machine vision
EP1173749B1 (en) Image editing for preparing a texture analysis
CN111539935B (en) Online cable surface defect detection method based on machine vision
CN101799434B (en) Printing image defect detection method
CN109658456A (en) Tank body inside fillet laser visual vision positioning method
CN108596880A (en) Weld defect feature extraction based on image procossing and welding quality analysis method
CN110044910B (en) Automobile cup box part detection system and detection method
CN112304960B (en) High-resolution image object surface defect detection method based on deep learning
CN112215828B (en) Automatic mask cutting position adjusting method and system based on intelligent visual detection
CN109886958B (en) Method, device and system for automatically identifying welding seam position based on square tube
CN107154033A (en) A kind of high ferro contact net rotation ears vertical openings pin missing detection method and system
CN112734720A (en) Ship hull laser cleaning in-place detection method and system based on visual identification
CN113554587A (en) Molten pool image geometric feature extraction method and system based on deep learning
CN114926407A (en) Steel surface defect detection system based on deep learning
CN114719749A (en) Metal surface crack detection and real size measurement method and system based on machine vision
CN113139900B (en) Method for acquiring complete surface image of bar
CN112950541B (en) Online monitoring method for gluing synthetic leather based on machine vision
CN111833350B (en) Machine vision detection method and system
CN112184704B (en) Welding seam processing method based on convolutional neural network
CN109658394A (en) Eye fundus image preprocess method and system and microaneurysm detection method and system
CN112070738A (en) Method and system for detecting nose bridge of mask
CN114219802B (en) Skin connecting hole position detection method based on image processing
CN107516309B (en) Visual inspection method for defects of printing panel
CN116008304A (en) Weld joint detection method suitable for pipeline interior

Legal Events

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