CN117314913B - Water-light needle defective product detection method and system based on visual identification - Google Patents

Water-light needle defective product detection method and system based on visual identification Download PDF

Info

Publication number
CN117314913B
CN117314913B CN202311606597.XA CN202311606597A CN117314913B CN 117314913 B CN117314913 B CN 117314913B CN 202311606597 A CN202311606597 A CN 202311606597A CN 117314913 B CN117314913 B CN 117314913B
Authority
CN
China
Prior art keywords
needle
detection
image data
water
light
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
CN202311606597.XA
Other languages
Chinese (zh)
Other versions
CN117314913A (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.)
Shenzhen Kangzhun Technology Co ltd
Original Assignee
Shenzhen Kangzhun 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 Shenzhen Kangzhun Technology Co ltd filed Critical Shenzhen Kangzhun Technology Co ltd
Priority to CN202311606597.XA priority Critical patent/CN117314913B/en
Publication of CN117314913A publication Critical patent/CN117314913A/en
Application granted granted Critical
Publication of CN117314913B publication Critical patent/CN117314913B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • 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/89Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles
    • G01N21/8914Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles characterised by the material examined
    • 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/89Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles
    • G01N21/892Investigating the presence of flaws or contamination in moving material, e.g. running paper or textiles characterised by the flaw, defect or object feature examined
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4038Scaling the whole image or part thereof for image mosaicing, i.e. plane images composed of plane sub-images
    • 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
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/70Labelling scene content, e.g. deriving syntactic or semantic representations
    • 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/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • 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/10141Special mode during image acquisition
    • 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/30244Camera pose
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Textile Engineering (AREA)
  • Chemical & Material Sciences (AREA)
  • Pathology (AREA)
  • Immunology (AREA)
  • Biochemistry (AREA)
  • Analytical Chemistry (AREA)
  • Software Systems (AREA)
  • Geometry (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Multimedia (AREA)
  • Computational Linguistics (AREA)
  • Quality & Reliability (AREA)
  • Medical Informatics (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Computer Graphics (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)

Abstract

The invention discloses a method and a system for detecting defective products of a water-light needle based on visual identification. And importing all the pinhead image data into a preset detection image distribution template to carry out image stitching, so as to obtain the hydro-optical pinhead detection image data. And analyzing the water-light needle detection image data by presetting a water-light needle defective product detection model, respectively analyzing the needle point part and the needle body part of each needle, and integrating the marking data of all the needle image data to obtain the water-light needle defect detection data. The method for detecting the defective product of the water-light needle head based on visual identification can rapidly identify the defective product of the needle head, and improves the detection efficiency of the defective product detection of the water-light needle head.

Description

Water-light needle defective product detection method and system based on visual identification
Technical Field
The application relates to the technical field of medical equipment, in particular to a method and a system for detecting defective products of a water-light needle based on visual identification.
Background
With the development of society and the improvement of living standard of people, the beauty and skin care industry is rapidly developed, and the water-light needle head is used as a popular beauty technology and gradually becomes an indispensable part of daily life of people, and the quality problem of the water-light needle head is increasingly valued. However, various defective products such as needle tip burrs, hooks, needle flip-chip, needle tilting, etc. of the needle defect may occur in the production process of the water-light needle, and these problems seriously affect the use effect and safety thereof.
Aiming at the problem of detecting defective products of the water-light needle heads, the traditional detection method mainly depends on manual operation, is time-consuming and labor-consuming, is easy to leak detection, and seriously affects the detection efficiency. The single-needle water-light needle head can be detected based on a visual identification needle head detection method, but for the multi-needle water-light needle head, because shielding and overlapping possibly exist among the needle heads, the multi-needle water-light needle head cannot be accurately detected as defective products through the visual identification needle head detection method.
Therefore, the prior art has defects, and improvement is needed.
Disclosure of Invention
In view of the above problems, the invention aims to provide a method and a system for detecting defective products of a water-light needle based on visual identification, which can more effectively and rapidly detect quality of a multi-needle water-light needle.
The first aspect of the invention provides a method for detecting defective products of a water-light needle based on visual identification, which comprises the following steps:
adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
analyzing frame by frame according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data;
performing image geometric transformation on the first detection image data to obtain needle image data;
binding the needle head image data with needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the hydro-optical pinhead detection image data;
analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data;
and transferring the unqualified water-light needle to a defective product area according to the water-light needle defect detection data.
In this scheme, according to waiting to detect the parameter information of water light syringe needle and adjust the detection angle who detects the camera, include:
analyzing according to the parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in the database;
if yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
performing simulation analysis based on the three-dimensional model of the water light needle to be detected, determining the minimum detection angle between adjacent needles which are not affected by each other under any rotation angle, and obtaining a second detection angle;
and adjusting the detection angle of the detection camera according to the second detection angle.
In this scheme, still include:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
Otherwise, the detection angle of the detection camera is adjusted according to the second preset angle.
In this scheme, before analyzing the video frame image of the detected video data frame by frame, the method further includes:
performing image processing on the video frame image of the detection video data, and converting the video frame image into a binarized image; the image processing includes image denoising and binarization processing.
In this scheme, still include:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
In this scheme, the performing image geometric transformation on the first detection image data to obtain needle image data includes:
Performing perspective transformation on the needle seat part of the hydro-optical needle to determine perspective transformation adjustment parameters;
performing perspective transformation on the first detection image data according to the perspective transformation adjustment parameters;
and scaling the first detection image data according to the needle diameter data of the first detection image data after perspective transformation to obtain needle image data.
In this scheme, through predetermining the defective article detection model of water light syringe needle to water light syringe needle detects image data carries out the analysis, obtains water light syringe needle defect detection data, includes:
extracting image features of the pinhead image data in the water-light pinhead detection image data;
based on the image characteristics of the needle head image data, comparing the needle head image data with sample image data in a database respectively, and marking the needle head image data with burrs and/or hooks on the needle point as unqualified;
analyzing according to the needle head image data, and determining the minimum circumscribed rectangle of the needle head image data;
analyzing according to the minimum circumscribed rectangle of the needle head image data, and marking the needle head image data with the needle head length which does not meet preset parameter information and the needle head with the inclination as unqualified;
And integrating the mark data of the needle image data in the hydro-optical needle detection image data to obtain hydro-optical needle defect detection data.
In this scheme, according to the minimum circumscribed rectangle of syringe needle image data carries out the analysis, with syringe needle length not satisfying preset parameter information and there is syringe needle image data mark of slope as unqualified, include:
calculating the area difference value between the minimum circumscribed rectangular area of the needle head image data and the minimum circumscribed rectangular area of the standard sample image;
judging whether the area difference value is in a preset range interval or not;
if not, the needle length in the needle image data does not meet the preset parameter information, and the needle image data is marked as unqualified;
if yes, judging whether the inclination angle of the minimum circumscribed rectangle of the needle head image data is larger than a preset threshold value;
if the needle image data is larger than the preset value, marking the needle image data as unqualified;
otherwise, marking the needle image data as qualified.
The second aspect of the invention provides a system for detecting defective products of a water-light needle based on visual identification, which comprises the following components:
the data acquisition module is used for adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
The image analysis module is used for carrying out frame-by-frame analysis according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data; performing image geometric transformation on the first detection image data to obtain needle image data; binding the needle head image data with needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
the image stitching module is used for performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the water-light pinhead detection image data;
the defective product detection module is used for analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data; and transferring the unqualified water-light needle to a defective product area according to the water-light needle defect detection data.
In this scheme, according to waiting to detect the parameter information of water light syringe needle and adjust the detection angle who detects the camera, include:
analyzing according to the parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in the database;
If yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
performing simulation analysis based on the three-dimensional model of the water light needle to be detected, determining the minimum detection angle between adjacent needles which are not affected by each other under any rotation angle, and obtaining a second detection angle;
and adjusting the detection angle of the detection camera according to the second detection angle.
In this scheme, still include:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
otherwise, the detection angle of the detection camera is adjusted according to the second preset angle.
In this scheme, before analyzing the video frame image of the detected video data frame by frame, the method further includes:
performing image processing on the video frame image of the detection video data, and converting the video frame image into a binarized image; the image processing includes image denoising and binarization processing.
In this scheme, still include:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
In this scheme, the performing image geometric transformation on the first detection image data to obtain needle image data includes:
performing perspective transformation on the needle seat part of the hydro-optical needle to determine perspective transformation adjustment parameters;
performing perspective transformation on the first detection image data according to the perspective transformation adjustment parameters;
and scaling the first detection image data according to the needle diameter data of the first detection image data after perspective transformation to obtain needle image data.
In this scheme, through predetermining the defective article detection model of water light syringe needle to water light syringe needle detects image data carries out the analysis, obtains water light syringe needle defect detection data, includes:
extracting image features of the pinhead image data in the water-light pinhead detection image data;
based on the image characteristics of the needle head image data, comparing the needle head image data with sample image data in a database respectively, and marking the needle head image data with burrs and/or hooks on the needle point as unqualified;
analyzing according to the needle head image data, and determining the minimum circumscribed rectangle of the needle head image data;
analyzing according to the minimum circumscribed rectangle of the needle head image data, and marking the needle head image data with the needle head length which does not meet preset parameter information and the needle head with the inclination as unqualified;
and integrating the mark data of the needle image data in the hydro-optical needle detection image data to obtain hydro-optical needle defect detection data.
In this scheme, according to the minimum circumscribed rectangle of syringe needle image data carries out the analysis, with syringe needle length not satisfying preset parameter information and there is syringe needle image data mark of slope as unqualified, include:
Calculating the area difference value between the minimum circumscribed rectangular area of the needle head image data and the minimum circumscribed rectangular area of the standard sample image;
judging whether the area difference value is in a preset range interval or not;
if not, the needle length in the needle image data does not meet the preset parameter information, and the needle image data is marked as unqualified;
if yes, judging whether the inclination angle of the minimum circumscribed rectangle of the needle head image data is larger than a preset threshold value;
if the needle image data is larger than the preset value, marking the needle image data as unqualified;
otherwise, marking the needle image data as qualified.
A third aspect of the present invention provides a computer-readable storage medium, in which a vision-based water-light needle defective product detection method program is included, which when executed by a processor, implements the steps of a vision-based water-light needle defective product detection method as described in any one of the above.
The invention discloses a method and a system for detecting defective products of a water-light needle based on visual identification. And importing all the pinhead image data into a preset detection image distribution template to carry out image stitching, so as to obtain the hydro-optical pinhead detection image data. And analyzing the water-light needle detection image data by presetting a water-light needle defective product detection model, respectively analyzing the needle point part and the needle body part of each needle, and integrating the marking data of all the needle image data to obtain the water-light needle defect detection data. The method for detecting the defective product of the water-light needle head based on visual identification can rapidly identify the defective product of the needle head, and improves the detection efficiency of the defective product detection of the water-light needle head.
Drawings
FIG. 1 shows a flow chart of a method for detecting defective products of a water-light needle based on visual recognition;
FIG. 2 is a flow chart of a method for detecting a camera angle according to the present invention;
FIG. 3 shows a flow chart of a method for analyzing the data of the water-light needle detection image by presetting a water-light needle defective product detection model;
fig. 4 shows a block diagram of a water-light needle defective product detection system based on visual recognition according to the present invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present invention will be more clearly understood, a more particular description of the invention will be rendered by reference to the appended drawings and appended detailed description. It should be noted that, in the case of no conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, however, the present invention may be practiced in other ways than those described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
Fig. 1 shows a flow chart of a method for detecting defective products of a water-light needle based on visual recognition.
As shown in fig. 1, the invention discloses a method for detecting defective products of a water-light needle based on visual identification, which comprises the following steps:
s102, adjusting the detection angle of a detection camera according to parameter information of a water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
s104, analyzing frame by frame according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data;
s106, performing image geometric transformation on the first detection image data to obtain needle image data;
s108, binding the needle head image data with the needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
s110, performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the water-light pinhead detection image data;
s112, analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data;
s114, transferring the unqualified water optical needle to a defective product area according to the water optical needle defect detection data.
According to the embodiment of the invention, the parameter information of the water-light needle to be detected comprises the parameter information of the brand, the model, the diameter of the needle, the length of the needle and the like of the needle to be detected, the adjustment angle interval of the detection camera is 0-90 degrees, wherein the horizontal angle is 0 degrees, the vertical angle is 90 degrees, and the detection chassis can rotate by 360 degrees. When the water light needle to be detected is transported to the detection chassis, parameter information of the water light needle to be detected is called to adjust the detection angle of the detection camera, and after the detection angle adjustment of the detection camera is completed, the detection chassis and the water light needle on the detection chassis are controlled to rotate, so that detection video data of the water light needle to be detected is obtained. Before frame-by-frame analysis is carried out on video frame images of detected video data, binarization processing is carried out on the video frame images, the video frame images are displayed in a binarization image mode, then needle head images which are located at a first preset angle in the video frame images are intercepted through comparison with needle head side face sample images and sample images under the condition that the needle heads are inverted, and first detected image data are obtained. And when the pinhead flip image exists in the video frame image, marking the corresponding pinhead of the pinhead flip image as unqualified. The image geometry transformation includes perspective transformation and scaling processing for the purpose of eliminating the image perspective effect and adjusting the resulting first detected image data to a uniform size for subsequent analysis processing thereof. The preset detection image distribution template is determined according to the parameter information and overlook image data of the water-light needles to be detected, the number of the needles of the water-light needles to be detected and the positions corresponding to the distribution coordinates of each needle are recorded in the preset detection image distribution template, and in the process of analyzing video image frames, after the needle image data of the needles are imported into the preset detection image distribution template, the needles recorded in the preset detection image distribution template are filtered in the subsequent analysis process.
And marking the needle defects of the water-light needle images in the historical detection data in a manual marking mode, training the marked historical detection data to obtain a preset water-light needle defective product detection model, and adjusting the water-light needle defect detection data. When the water-light needle defective product is detected by a preset water-light needle defective product detection model, the needle point part and the needle body part of the water-light needle are respectively analyzed, so that whether the water-light needle has a needle defect is determined, and the needle defect comprises needle point burrs, hooks, inclined needle heads and abnormal needle length. And analyzing based on the water-light needle defect detection data, transporting the qualified water-light needles according to a preset transportation route, adjusting the transportation route of the unqualified water-light needles, and transporting and transferring the unqualified water-light needles to a defective product area.
The first preset angle is +/-90 degrees, namely the rotation angle corresponding to the needle side image, and the first detection image is the needle side image.
Fig. 2 shows a flow chart of a method for detecting a detection angle of a camera according to the present invention.
As shown in fig. 2, according to an embodiment of the present invention, the adjusting the detection angle of the detection camera according to the parameter information of the water-light needle to be detected includes:
S202, analyzing according to parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in a database;
s204, if yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
s206, if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
s208, performing simulation analysis based on the three-dimensional model of the water-light needle to be detected, and determining the minimum detection angle between adjacent needles, which is not affected by each other, under any rotation angle to obtain a second detection angle;
s210, adjusting the detection angle of the detection camera according to the second detection angle.
The detection template data is obtained through historical detection data of the water-light needle, and the historical detection angle of the water-light needle and a preset detection image distribution template are recorded in the detection template data. The detection camera can be directly adjusted to the current optimal detection angle of the water light needle to be detected by calling the detection template data in the database, and the detection image distribution template of the water light needle to be detected is determined, so that convenience is provided for subsequent detection. When the detection template data of the water light needle to be detected cannot be obtained in the database, the detection angle of the detection camera is adjusted to be 0 degrees to obtain the front view image data of the water light needle to be detected, and the detection angle of the detection camera is adjusted to be 90 degrees to obtain the overlook image data of the water light needle to be detected. The distribution position of each needle in the current water light needle to be detected can be determined through the three-dimensional model of the water light needle to be detected, the minimum detection angle, namely the second detection angle, is determined by combining the positions of the detection cameras according to the needle length of the water light needle to be detected and the distance calculation between the adjacent needles.
According to an embodiment of the present invention, further comprising:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
otherwise, the detection angle of the detection camera is adjusted according to the second preset angle.
It should be noted that, when the detection angle is too large, the needle point image features in the needle point image data are less, and it cannot be judged whether the to-be-detected water light needle point has a defect, so that the maximum detection angle, namely the second preset angle, is set when the water light needle point is detected. Wherein, the value range of the second preset angle is between 0 and 90 degrees, and the specific value is dynamically adjusted by the system according to the historical detection data. And the initial value of the system of the third preset angle is 0 degrees, namely, the detection camera is adjusted to be a horizontal angle to detect the injection. The third preset angle can be adjusted according to the actual use requirement by a person skilled in the art, and the adjustment range of the third preset angle is between 0 degree and the second preset angle range.
According to an embodiment of the present invention, before performing frame-by-frame analysis on the video frame image of the detected video data, the method further includes:
Performing image processing on the video frame image of the detection video data, and converting the video frame image into a binarized image; the image processing includes image denoising and binarization processing.
Before binarization, image denoising (through methods such as gaussian filtering and mean filtering) is needed to eliminate noise in the video frame image, and improve the quality of the image. Then selecting proper pixel value threshold to divide the video frame image into two parts, one part is needle head image, and the other part is needle seat and background irrelevant image. And setting the pixel larger than the pixel value threshold value to be 1, setting the pixel smaller than the pixel value threshold value to be 0, and converting the video frame image into a binarized image for display.
According to an embodiment of the present invention, further comprising:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
Analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
When the detection is performed through the third preset angle, when the water-light needle to be detected is at a certain rotation angle, the adjacent needles are affected by each other, for example, the images of the needles are not obtained due to overlapping, shielding and the like, so that the first detection image data cannot be obtained. Therefore, when the hydro-optical needle is detected through the third preset angle, on the basis of intercepting the needle image of the first preset angle, intercepting the needle image of the fourth preset angle to obtain second detection image data, and marking the second detection image data according to the needle distribution coordinates. After analysis of all video image frames of the detection video data is completed, unknown pinheads without pinhead image data are screened out from the hydro-optical pinhead detection image data, a corresponding second detection image data is selected based on pinhead distribution coordinates of the unknown pinheads, a pinhead three-dimensional model is built, and simulated pinhead image data at a first preset angle is intercepted by adjusting the display angle of the pinhead three-dimensional model. Wherein the fourth preset angle is + -45 DEG and + -135 DEG, and the number of the second detection image data of each needle is 1-4. In addition, if the second detection image data of the unknown pinhead is less, when the pinhead three-dimensional model cannot be built through the second detection image data, the unknown pinhead in the to-be-detected water light pinhead can be detected through adjusting the detection angle of the detection camera, the first detection image data and the second detection image data of the unknown pinhead are obtained through adjusting the detection angle of the detection camera and the rotation angle of the to-be-detected water light pinhead, and the pinhead image data of the unknown pinhead is obtained after image conversion through data processing. Or the unknown needle is disregarded, the water-light needle to be detected is directly used for detecting the image data, and after the detection is finished, the unknown needle is detected in a manual detection mode.
According to an embodiment of the present invention, the performing image geometric transformation on the first detection image data to obtain needle image data includes:
performing perspective transformation on the needle seat part of the hydro-optical needle to determine perspective transformation adjustment parameters;
performing perspective transformation on the first detection image data according to the perspective transformation adjustment parameters;
and scaling the first detection image data according to the needle diameter data of the first detection image data after perspective transformation to obtain needle image data.
It should be noted that, the first detection image data is acquired through a certain shooting angle, and a certain perspective effect exists, so that after the first detection image data is acquired, image geometric transformation is performed on the first detection image data, including perspective transformation and scaling processing. The method comprises the steps of firstly determining a needle seat part (rectangular part) of a water light needle, performing perspective transformation on the needle seat part based on four vertexes of the needle seat, mapping the four vertexes onto the four vertexes of a target quadrilateral, eliminating an image perspective effect, and recording adjustment parameters during perspective transformation. And performing perspective transformation on the first detection image data based on the adjustment parameters, and eliminating perspective influence in the first detection image data.
And then determining the needle diameter data of the first detection image data, and scaling the first detection image data according to the needle diameter parameter information in the parameter information of the water-light needle to be detected, so that the needle diameter data in the first detection image data is consistent with the needle diameter parameter information in the parameter information.
In addition, in the case where the fourth preset angle is not 0 °, image geometric transformation is also performed on the acquired second detection image data.
Fig. 3 shows a flowchart of a method for analyzing the water-light needle detection image data by presetting a water-light needle defective product detection model.
As shown in fig. 3, according to an embodiment of the present invention, the analyzing the data of the water-light needle detection image by presetting a water-light needle defective product detection model to obtain water-light needle defect detection data includes:
s302, extracting image features of the pinhead image data in the water-light pinhead detection image data;
s304, based on the image characteristics of the needle head image data, comparing the needle head image data with sample image data in a database respectively, and marking the needle head image data with burrs and/or hooks on the needle point as unqualified;
S306, analyzing according to the needle head image data, and determining the minimum circumscribed rectangle of the needle head image data;
s308, analyzing according to the minimum circumscribed rectangle of the needle head image data, and marking the needle head image data with the needle head length which does not meet preset parameter information and the inclined needle head image data as unqualified;
and S310, integrating the mark data of the needle image data in the water light needle detection image data to obtain the water light needle defect detection data.
The method is characterized in that the needle point part and the needle body part of the needle point image data are respectively analyzed through a preset water-light needle point defective product detection model, firstly, the image characteristics of the needle point part in the needle point image data are extracted, and whether the needle point part of each needle point image data in the water-light needle point detection image data has the needle point defect of burrs or hooks is judged through comparison with the image characteristics of the needle point part in the sample image data in a database, so that the detection of the needle point part is completed. And then, needle body part detection is carried out on the needle head image data with qualified needle point parts, frame selection is carried out on the needle head image data, and the minimum circumscribed rectangle is determined. And judging whether the needle length is the needle length parameter information in the parameter information of the hydro-optical needle and whether the needle is inclined according to the minimum circumscribed rectangular area and the inclination angle, thereby completing the detection of the needle body part. And marking each needle image data based on the detection data of the needle tip part and the needle body part, integrating after all the needle image data are marked, and outputting the hydro-optical needle defect detection data by the model.
According to an embodiment of the present invention, the analyzing according to the minimum circumscribed rectangle of the needle image data, marking the needle image data with the needle length not meeting the preset parameter information and having the inclination as unqualified includes:
calculating the area difference value between the minimum circumscribed rectangular area of the needle head image data and the minimum circumscribed rectangular area of the standard sample image;
judging whether the area difference value is in a preset range interval or not;
if not, the needle length in the needle image data does not meet the preset parameter information, and the needle image data is marked as unqualified;
if yes, judging whether the inclination angle of the minimum circumscribed rectangle of the needle head image data is larger than a preset threshold value;
if the needle image data is larger than the preset value, marking the needle image data as unqualified;
otherwise, marking the needle image data as qualified.
It should be noted that, the standard sample image is a binary image of the water-light needle consistent with the needle length and the needle diameter parameter information in the parameter information of the water-light needle to be detected, and because the diameter of the needle image data is already adjusted to be consistent with the needle diameter parameter information in the parameter information of the water-light needle to be detected by performing image geometric transformation on the needle image data, whether the needle length of the needle image data is the needle length information of the water-light needle to be detected can be judged by calculating the area difference value between the minimum circumscribed rectangular area of the needle image data and the minimum circumscribed rectangular area of the standard sample image. Considering the influence of detection errors, setting an area difference value to obtain a preset range interval, wherein the initial value of the preset range interval is +/-2% of the minimum circumscribed rectangular area of the standard sample image. And then determining whether the needle corresponding to the needle image data is inclined according to the inclination angle of the minimum circumscribed rectangle of the needle image data, and setting the maximum inclination angle, namely a preset threshold value, based on the inclination angle of the needle which does not affect normal use. The preset range interval and the preset threshold value can be adjusted by a person skilled in the art according to actual use requirements.
Fig. 4 shows a block diagram of a water-light needle defective product detection system based on visual recognition according to the present invention.
As shown in fig. 4, a second aspect of the present invention provides a system for detecting defective products of a water-light needle based on visual recognition, comprising:
the data acquisition module is used for adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
the image analysis module is used for carrying out frame-by-frame analysis according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data; performing image geometric transformation on the first detection image data to obtain needle image data; binding the needle head image data with needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
the image stitching module is used for performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the water-light pinhead detection image data;
the defective product detection module is used for analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data; and transferring the unqualified water-light needle to a defective product area according to the water-light needle defect detection data.
According to the embodiment of the invention, the parameter information of the water-light needle to be detected comprises the parameter information of the brand, the model, the diameter of the needle, the length of the needle and the like of the needle to be detected, the adjustment angle interval of the detection camera is 0-90 degrees, wherein the horizontal angle is 0 degrees, the vertical angle is 90 degrees, and the detection chassis can rotate by 360 degrees. When the water light needle to be detected is transported to the detection chassis, parameter information of the water light needle to be detected is called to adjust the detection angle of the detection camera, and after the detection angle adjustment of the detection camera is completed, the detection chassis and the water light needle on the detection chassis are controlled to rotate, so that detection video data of the water light needle to be detected is obtained. Before frame-by-frame analysis is carried out on video frame images of detected video data, binarization processing is carried out on the video frame images, the video frame images are displayed in a binarization image mode, then needle head images which are located at a first preset angle in the video frame images are intercepted through comparison with needle head side face sample images and sample images under the condition that the needle heads are inverted, and first detected image data are obtained. And when the pinhead flip image exists in the video frame image, marking the corresponding pinhead of the pinhead flip image as unqualified. The image geometry transformation includes perspective transformation and scaling processing for the purpose of eliminating the image perspective effect and adjusting the resulting first detected image data to a uniform size for subsequent analysis processing thereof. The preset detection image distribution template is determined according to the parameter information and overlook image data of the water-light needles to be detected, the number of the needles of the water-light needles to be detected and the positions corresponding to the distribution coordinates of each needle are recorded in the preset detection image distribution template, and in the process of analyzing video image frames, after the needle image data of the needles are imported into the preset detection image distribution template, the needles recorded in the preset detection image distribution template are filtered in the subsequent analysis process.
And marking the needle defects of the water-light needle images in the historical detection data in a manual marking mode, training the marked historical detection data to obtain a preset water-light needle defective product detection model, and adjusting the water-light needle defect detection data. When the water-light needle defective product is detected by a preset water-light needle defective product detection model, the needle point part and the needle body part of the water-light needle are respectively analyzed, so that whether the water-light needle has a needle defect is determined, and the needle defect comprises needle point burrs, hooks, inclined needle heads and abnormal needle length. And analyzing based on the water-light needle defect detection data, transporting the qualified water-light needles according to a preset transportation route, adjusting the transportation route of the unqualified water-light needles, and transporting and transferring the unqualified water-light needles to a defective product area.
The first preset angle is +/-90 degrees, namely the rotation angle corresponding to the needle side image, and the first detection image is the needle side image.
According to an embodiment of the present invention, the adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected includes:
analyzing according to the parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in the database;
If yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
performing simulation analysis based on the three-dimensional model of the water light needle to be detected, determining the minimum detection angle between adjacent needles which are not affected by each other under any rotation angle, and obtaining a second detection angle;
and adjusting the detection angle of the detection camera according to the second detection angle.
The detection template data is obtained through historical detection data of the water-light needle, and the historical detection angle of the water-light needle and a preset detection image distribution template are recorded in the detection template data. The detection camera can be directly adjusted to the current optimal detection angle of the water light needle to be detected by calling the detection template data in the database, and the detection image distribution template of the water light needle to be detected is determined, so that convenience is provided for subsequent detection. When the detection template data of the water light needle to be detected cannot be obtained in the database, the detection angle of the detection camera is adjusted to be 0 degrees to obtain the front view image data of the water light needle to be detected, and the detection angle of the detection camera is adjusted to be 90 degrees to obtain the overlook image data of the water light needle to be detected. The distribution position of each needle in the current water light needle to be detected can be determined through the three-dimensional model of the water light needle to be detected, the minimum detection angle, namely the second detection angle, is determined by combining the positions of the detection cameras according to the needle length of the water light needle to be detected and the distance calculation between the adjacent needles.
According to an embodiment of the present invention, further comprising:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
otherwise, the detection angle of the detection camera is adjusted according to the second preset angle.
It should be noted that, when the detection angle is too large, the needle point image features in the needle point image data are less, and it cannot be judged whether the to-be-detected water light needle point has a defect, so that the maximum detection angle, namely the second preset angle, is set when the water light needle point is detected. Wherein, the value range of the second preset angle is between 0 and 90 degrees, and the specific value is dynamically adjusted by the system according to the historical detection data. And the initial value of the system of the third preset angle is 0 degrees, namely, the detection camera is adjusted to be a horizontal angle to detect the injection. The third preset angle can be adjusted according to the actual use requirement by a person skilled in the art, and the adjustment range of the third preset angle is between 0 degree and the second preset angle range.
According to an embodiment of the present invention, before performing frame-by-frame analysis on the video frame image of the detected video data, the method further includes:
Performing image processing on the video frame image of the detection video data, and converting the video frame image into a binarized image; the image processing includes image denoising and binarization processing.
Before binarization, image denoising (through methods such as gaussian filtering and mean filtering) is needed to eliminate noise in the video frame image, and improve the quality of the image. Then selecting proper pixel value threshold to divide the video frame image into two parts, one part is needle head image, and the other part is needle seat and background irrelevant image. And setting the pixel larger than the pixel value threshold value to be 1, setting the pixel smaller than the pixel value threshold value to be 0, and converting the video frame image into a binarized image for display.
According to an embodiment of the present invention, further comprising:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
Analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
When the detection is performed through the third preset angle, when the water-light needle to be detected is at a certain rotation angle, the adjacent needles are affected by each other, for example, the images of the needles are not obtained due to overlapping, shielding and the like, so that the first detection image data cannot be obtained. Therefore, when the hydro-optical needle is detected through the third preset angle, on the basis of intercepting the needle image of the first preset angle, intercepting the needle image of the fourth preset angle to obtain second detection image data, and marking the second detection image data according to the needle distribution coordinates. After analysis of all video image frames of the detection video data is completed, unknown pinheads without pinhead image data are screened out from the hydro-optical pinhead detection image data, a corresponding second detection image data is selected based on pinhead distribution coordinates of the unknown pinheads, a pinhead three-dimensional model is built, and simulated pinhead image data at a first preset angle is intercepted by adjusting the display angle of the pinhead three-dimensional model. Wherein the fourth preset angle is + -45 DEG and + -135 DEG, and the number of the second detection image data of each needle is 1-4. In addition, if the second detection image data of the unknown pinhead is less, when the pinhead three-dimensional model cannot be built through the second detection image data, the unknown pinhead in the to-be-detected water light pinhead can be detected through adjusting the detection angle of the detection camera, the first detection image data and the second detection image data of the unknown pinhead are obtained through adjusting the detection angle of the detection camera and the rotation angle of the to-be-detected water light pinhead, and the pinhead image data of the unknown pinhead is obtained after image conversion through data processing. Or the unknown needle is disregarded, the water-light needle to be detected is directly used for detecting the image data, and after the detection is finished, the unknown needle is detected in a manual detection mode.
According to an embodiment of the present invention, the performing image geometric transformation on the first detection image data to obtain needle image data includes:
performing perspective transformation on the needle seat part of the hydro-optical needle to determine perspective transformation adjustment parameters;
performing perspective transformation on the first detection image data according to the perspective transformation adjustment parameters;
and scaling the first detection image data according to the needle diameter data of the first detection image data after perspective transformation to obtain needle image data.
It should be noted that, the first detection image data is acquired through a certain shooting angle, and a certain perspective effect exists, so that after the first detection image data is acquired, image geometric transformation is performed on the first detection image data, including perspective transformation and scaling processing. The method comprises the steps of firstly determining a needle seat part (rectangular part) of a water light needle, performing perspective transformation on the needle seat part based on four vertexes of the needle seat, mapping the four vertexes onto the four vertexes of a target quadrilateral, eliminating an image perspective effect, and recording adjustment parameters during perspective transformation. And performing perspective transformation on the first detection image data based on the adjustment parameters, and eliminating perspective influence in the first detection image data.
And then determining the needle diameter data of the first detection image data, and scaling the first detection image data according to the needle diameter parameter information in the parameter information of the water-light needle to be detected, so that the needle diameter data in the first detection image data is consistent with the needle diameter parameter information in the parameter information.
In addition, in the case where the fourth preset angle is not 0 °, image geometric transformation is also performed on the acquired second detection image data.
According to an embodiment of the present invention, the analyzing the water-light needle detection image data by presetting a water-light needle defective product detection model to obtain water-light needle defect detection data includes:
extracting image features of the pinhead image data in the water-light pinhead detection image data;
based on the image characteristics of the needle head image data, comparing the needle head image data with sample image data in a database respectively, and marking the needle head image data with burrs and/or hooks on the needle point as unqualified;
analyzing according to the needle head image data, and determining the minimum circumscribed rectangle of the needle head image data;
analyzing according to the minimum circumscribed rectangle of the needle head image data, and marking the needle head image data with the needle head length which does not meet preset parameter information and the needle head with the inclination as unqualified;
And integrating the mark data of the needle image data in the hydro-optical needle detection image data to obtain hydro-optical needle defect detection data.
The method is characterized in that the needle point part and the needle body part of the needle point image data are respectively analyzed through a preset water-light needle point defective product detection model, firstly, the image characteristics of the needle point part in the needle point image data are extracted, and whether the needle point part of each needle point image data in the water-light needle point detection image data has the needle point defect of burrs or hooks is judged through comparison with the image characteristics of the needle point part in the sample image data in a database, so that the detection of the needle point part is completed. And then, needle body part detection is carried out on the needle head image data with qualified needle point parts, frame selection is carried out on the needle head image data, and the minimum circumscribed rectangle is determined. And judging whether the needle length is the needle length parameter information in the parameter information of the hydro-optical needle and whether the needle is inclined according to the minimum circumscribed rectangular area and the inclination angle, thereby completing the detection of the needle body part. And marking each needle image data based on the detection data of the needle tip part and the needle body part, integrating after all the needle image data are marked, and outputting the hydro-optical needle defect detection data by the model.
According to an embodiment of the present invention, the analyzing according to the minimum circumscribed rectangle of the needle image data, marking the needle image data with the needle length not meeting the preset parameter information and having the inclination as unqualified includes:
calculating the area difference value between the minimum circumscribed rectangular area of the needle head image data and the minimum circumscribed rectangular area of the standard sample image;
judging whether the area difference value is in a preset range interval or not;
if not, the needle length in the needle image data does not meet the preset parameter information, and the needle image data is marked as unqualified;
if yes, judging whether the inclination angle of the minimum circumscribed rectangle of the needle head image data is larger than a preset threshold value;
if the needle image data is larger than the preset value, marking the needle image data as unqualified;
otherwise, marking the needle image data as qualified.
It should be noted that, the standard sample image is a binary image of the water-light needle consistent with the needle length and the needle diameter parameter information in the parameter information of the water-light needle to be detected, and because the diameter of the needle image data is already adjusted to be consistent with the needle diameter parameter information in the parameter information of the water-light needle to be detected by performing image geometric transformation on the needle image data, whether the needle length of the needle image data is the needle length information of the water-light needle to be detected can be judged by calculating the area difference value between the minimum circumscribed rectangular area of the needle image data and the minimum circumscribed rectangular area of the standard sample image. Considering the influence of detection errors, setting an area difference value to obtain a preset range interval, wherein the initial value of the preset range interval is +/-2% of the minimum circumscribed rectangular area of the standard sample image. And then determining whether the needle corresponding to the needle image data is inclined according to the inclination angle of the minimum circumscribed rectangle of the needle image data, and setting the maximum inclination angle, namely a preset threshold value, based on the inclination angle of the needle which does not affect normal use. The preset range interval and the preset threshold value can be adjusted by a person skilled in the art according to actual use requirements.
The invention also provides a computer readable storage medium, which comprises a vision-recognition-based water-light needle defective product detection method program, wherein when the vision-recognition-based water-light needle defective product detection method program is executed by a processor, the steps of the vision-recognition-based water-light needle defective product detection method are realized.
The invention discloses a method and a system for detecting defective products of a water-light needle based on visual identification. And importing all the pinhead image data into a preset detection image distribution template to carry out image stitching, so as to obtain the hydro-optical pinhead detection image data. And analyzing the water-light needle detection image data by presetting a water-light needle defective product detection model, respectively analyzing the needle point part and the needle body part of each needle, and integrating the marking data of all the needle image data to obtain the water-light needle defect detection data. The method for detecting the defective product of the water-light needle head based on visual identification can rapidly identify the defective product of the needle head, and improves the detection efficiency of the defective product detection of the water-light needle head.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or an optical disk, or the like, which can store program codes.
Alternatively, the above-described integrated units of the present invention may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.

Claims (6)

1. The method for detecting the defective product of the water-light needle head based on visual identification is characterized by comprising the following steps of:
adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
analyzing frame by frame according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data;
performing image geometric transformation on the first detection image data to obtain needle image data;
binding the needle head image data with needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the hydro-optical pinhead detection image data;
analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data;
transferring the unqualified water-light needle to a defective product area according to the water-light needle defect detection data;
The adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected comprises the following steps:
analyzing according to the parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in the database;
if yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
performing simulation analysis based on the three-dimensional model of the water light needle to be detected, determining the minimum detection angle between adjacent needles which are not affected by each other under any rotation angle, and obtaining a second detection angle;
adjusting the detection angle of the detection camera according to the second detection angle;
further comprises:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
otherwise, adjusting the detection angle of the detection camera according to the second preset angle;
Further comprises:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
2. The method for detecting defective water-jet needles based on visual recognition according to claim 1, further comprising, before performing frame-by-frame analysis on the video frame images of the detected video data:
performing image processing on the video frame image of the detection video data, and converting the video frame image into a binarized image; the image processing includes image denoising and binarization processing.
3. The method for detecting defective water-light needle based on visual recognition according to claim 1, wherein the performing image geometric transformation on the first detection image data to obtain needle image data comprises:
Performing perspective transformation on the needle seat part of the hydro-optical needle to determine perspective transformation adjustment parameters;
performing perspective transformation on the first detection image data according to the perspective transformation adjustment parameters;
and scaling the first detection image data according to the needle diameter data of the first detection image data after perspective transformation to obtain needle image data.
4. The method for detecting defective water-light needle based on visual recognition according to claim 1, wherein the analyzing the water-light needle detection image data by a preset water-light needle defective product detection model to obtain water-light needle defect detection data comprises:
extracting image features of the pinhead image data in the water-light pinhead detection image data;
based on the image characteristics of the needle head image data, comparing the needle head image data with sample image data in a database respectively, and marking the needle head image data with burrs and/or hooks on the needle point as unqualified;
analyzing according to the needle head image data, and determining the minimum circumscribed rectangle of the needle head image data;
analyzing according to the minimum circumscribed rectangle of the needle head image data, and marking the needle head image data with the needle head length which does not meet preset parameter information and the needle head with the inclination as unqualified;
And integrating the mark data of the needle image data in the hydro-optical needle detection image data to obtain hydro-optical needle defect detection data.
5. The method for detecting defective water-light needle based on visual recognition according to claim 1, wherein the analyzing according to the minimum circumscribed rectangle of the needle image data, marking the needle length not meeting the preset parameter information and the needle image data having inclination as failed, comprises:
calculating the area difference value between the minimum circumscribed rectangular area of the needle head image data and the minimum circumscribed rectangular area of the standard sample image;
judging whether the area difference value is in a preset range interval or not;
if not, the needle length in the needle image data does not meet the preset parameter information, and the needle image data is marked as unqualified;
if yes, judging whether the inclination angle of the minimum circumscribed rectangle of the needle head image data is larger than a preset threshold value;
if the needle image data is larger than the preset value, marking the needle image data as unqualified;
otherwise, marking the needle image data as qualified.
6. A water light needle defective product detecting system based on visual identification is characterized by comprising:
The data acquisition module is used for adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected, controlling the water light needle to be detected to rotate, and acquiring detection video data of the water light needle through the adjusted detection camera;
the image analysis module is used for carrying out frame-by-frame analysis according to the video frame images of the detection video data, and intercepting the needle head image at a first preset angle to obtain first detection image data; performing image geometric transformation on the first detection image data to obtain needle image data; binding the needle head image data with needle head distribution coordinates of the corresponding needle head and importing the needle head image data into a preset detection image distribution template;
the image stitching module is used for performing image stitching on the imported pinhead image data based on the preset detection image distribution template to obtain the water-light pinhead detection image data;
the defective product detection module is used for analyzing the water-light needle detection image data through a preset water-light needle defective product detection model to obtain water-light needle defect detection data; transferring the unqualified water-light needle to a defective product area according to the water-light needle defect detection data;
The adjusting the detection angle of the detection camera according to the parameter information of the water light needle to be detected comprises the following steps:
analyzing according to the parameter information of the water-light needle to be detected, and judging whether corresponding detection template data exist in the database;
if yes, determining a first detection angle according to the detection template data, and adjusting the detection angle of the detection camera according to the first detection angle;
if not, acquiring front view image data and overlook image data of the water light needle to be detected through a detection camera, analyzing according to the front view image data and overlook image data, and establishing a three-dimensional model of the water light needle to be detected;
performing simulation analysis based on the three-dimensional model of the water light needle to be detected, determining the minimum detection angle between adjacent needles which are not affected by each other under any rotation angle, and obtaining a second detection angle;
adjusting the detection angle of the detection camera according to the second detection angle;
further comprises:
judging whether the second detection angle is larger than a second preset angle or not;
if yes, adjusting the detection angle of the detection camera according to the third preset angle;
otherwise, adjusting the detection angle of the detection camera according to the second preset angle;
Further comprises:
when the water light needle to be detected is detected through a third preset angle, intercepting a needle image at a fourth preset angle to obtain second detection image data;
according to the hydro-optical needle detection image data, analyzing, marking a needle without the needle image data as an unknown needle, and establishing a needle three-dimensional model through second detection image data of the unknown needle;
analyzing the needle three-dimensional model to obtain simulated needle image data of the unknown needle at a first preset angle;
binding the simulated needle image data with the unknown needle and importing the simulated needle image data into a preset detection image distribution template.
CN202311606597.XA 2023-11-29 2023-11-29 Water-light needle defective product detection method and system based on visual identification Active CN117314913B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311606597.XA CN117314913B (en) 2023-11-29 2023-11-29 Water-light needle defective product detection method and system based on visual identification

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311606597.XA CN117314913B (en) 2023-11-29 2023-11-29 Water-light needle defective product detection method and system based on visual identification

Publications (2)

Publication Number Publication Date
CN117314913A CN117314913A (en) 2023-12-29
CN117314913B true CN117314913B (en) 2024-03-29

Family

ID=89255674

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311606597.XA Active CN117314913B (en) 2023-11-29 2023-11-29 Water-light needle defective product detection method and system based on visual identification

Country Status (1)

Country Link
CN (1) CN117314913B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202256183U (en) * 2011-09-09 2012-05-30 杭州品目科技有限公司 Defect detection equipment for injector pinhead based on machine vision
CN105588841A (en) * 2016-01-28 2016-05-18 浙江工业大学 Stitch inclination defect detection device based on machine vision
CN114460094A (en) * 2022-02-09 2022-05-10 湖南迪普视智能科技有限公司 Data processing method and device for visual defect detection, FPGA chip and detection system
CN114820439A (en) * 2022-03-16 2022-07-29 昆山磊晶电子有限公司 PCB bare board defect detection system and method based on AOI
CN115620061A (en) * 2022-10-20 2023-01-17 深圳市智宇精密五金塑胶有限公司 Hardware part defect detection method and system based on image recognition technology
CN116500038A (en) * 2023-04-28 2023-07-28 湘潭大学 Image acquisition method for detecting defect of outer diameter cylindrical surface of micro workpiece

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113177574B (en) * 2021-03-19 2022-08-16 华中科技大学 Visual model for material characterization image analysis and analysis method thereof

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN202256183U (en) * 2011-09-09 2012-05-30 杭州品目科技有限公司 Defect detection equipment for injector pinhead based on machine vision
CN105588841A (en) * 2016-01-28 2016-05-18 浙江工业大学 Stitch inclination defect detection device based on machine vision
CN114460094A (en) * 2022-02-09 2022-05-10 湖南迪普视智能科技有限公司 Data processing method and device for visual defect detection, FPGA chip and detection system
CN114820439A (en) * 2022-03-16 2022-07-29 昆山磊晶电子有限公司 PCB bare board defect detection system and method based on AOI
CN115620061A (en) * 2022-10-20 2023-01-17 深圳市智宇精密五金塑胶有限公司 Hardware part defect detection method and system based on image recognition technology
CN116500038A (en) * 2023-04-28 2023-07-28 湘潭大学 Image acquisition method for detecting defect of outer diameter cylindrical surface of micro workpiece

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
ETG-Symposium》.2020,第139-144页. *
Robert Bach等.Investigation on electrical treeing behaviour at needle defects in cable insulation under AC voltage with the help of image processing algorithms and deep neural networks.《VDE High Voltage Technology 2020 *
不同针头新型水光针注射技术对面部年轻化的作用比较;余永利等;《现代医学与健康研究电子杂志》;20200531;第4卷(第10期);第124-126页 *

Also Published As

Publication number Publication date
CN117314913A (en) 2023-12-29

Similar Documents

Publication Publication Date Title
CN108323204B (en) Method for detecting face flaw point and intelligent terminal
US6614919B1 (en) Method of extracting iris region and individual identification device
CN107945135B (en) Image processing method, image processing apparatus, storage medium, and electronic device
CN100407221C (en) Central location of a face detecting device, method and program
CN100357959C (en) Facial parts position detection device, method for detecting facial parts position, and program for detecting facial parts position
US7215829B2 (en) Method and system for object recognition using fractal map
TWI525555B (en) Image processing apparatus and processing method thereof
CN100571335C (en) Image syncretizing effect real-time estimating method and device based on pixel space relativity
CN110245561B (en) Face recognition method and device
CN116664559B (en) Machine vision-based memory bank damage rapid detection method
CN110619333B (en) Text line segmentation method, text line segmentation device and electronic equipment
CN113962306A (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN110543848B (en) Driver action recognition method and device based on three-dimensional convolutional neural network
CN111008560A (en) Livestock weight determination method, device, terminal and computer storage medium
CN112052730B (en) 3D dynamic portrait identification monitoring equipment and method
CN112017210A (en) Target object tracking method and device
CN117314913B (en) Water-light needle defective product detection method and system based on visual identification
CN110909568A (en) Image detection method, apparatus, electronic device, and medium for face recognition
CN112070792B (en) Edge growth connection method and device for image segmentation
CN114627482B (en) Method and system for realizing table digital processing based on image processing and character recognition
CN111126286A (en) Vehicle dynamic detection method and device, computer equipment and storage medium
CN115880365A (en) Double-station automatic screw screwing detection method, system and device
CN113284115B (en) Steel coil tower shape identification method, system, medium and terminal
CN115860026A (en) Bar code detection method and device, bar code detection equipment and readable storage medium
CN114254605A (en) Answer sheet template generation method, answer sheet identification method and device and electronic equipment

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