CN116337887A - Method and system for detecting defects on upper surface of casting cylinder body - Google Patents

Method and system for detecting defects on upper surface of casting cylinder body Download PDF

Info

Publication number
CN116337887A
CN116337887A CN202310039962.7A CN202310039962A CN116337887A CN 116337887 A CN116337887 A CN 116337887A CN 202310039962 A CN202310039962 A CN 202310039962A CN 116337887 A CN116337887 A CN 116337887A
Authority
CN
China
Prior art keywords
image
defect
cylinder body
cylinder
sub
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310039962.7A
Other languages
Chinese (zh)
Inventor
陈锦诚
付傲然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Platform For Smart Manufacturing Co Ltd
Original Assignee
Shanghai Platform For Smart Manufacturing 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 Shanghai Platform For Smart Manufacturing Co Ltd filed Critical Shanghai Platform For Smart Manufacturing Co Ltd
Priority to CN202310039962.7A priority Critical patent/CN116337887A/en
Publication of CN116337887A publication Critical patent/CN116337887A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • G01N21/898Irregularities in textured or patterned surfaces, e.g. textiles, wood
    • 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/01Arrangements or apparatus for facilitating the optical investigation
    • 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/01Arrangements or apparatus for facilitating the optical investigation
    • G01N21/13Moving of cuvettes or solid samples to or from the investigating station
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N35/00Automatic analysis not limited to methods or materials provided for in any single one of groups G01N1/00 - G01N33/00; Handling materials therefor
    • G01N35/00584Control arrangements for automatic analysers
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N35/00Automatic analysis not limited to methods or materials provided for in any single one of groups G01N1/00 - G01N33/00; Handling materials therefor
    • G01N35/0099Automatic analysis not limited to methods or materials provided for in any single one of groups G01N1/00 - G01N33/00; Handling materials therefor comprising robots or similar manipulators
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01NINVESTIGATING OR ANALYSING MATERIALS BY DETERMINING THEIR CHEMICAL OR PHYSICAL PROPERTIES
    • G01N35/00Automatic analysis not limited to methods or materials provided for in any single one of groups G01N1/00 - G01N33/00; Handling materials therefor
    • G01N35/10Devices for transferring samples or any liquids to, in, or from, the analysis apparatus, e.g. suction devices, injection devices
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01VGEOPHYSICS; GRAVITATIONAL MEASUREMENTS; DETECTING MASSES OR OBJECTS; TAGS
    • G01V9/00Prospecting or detecting by methods not provided for in groups G01V1/00 - G01V8/00
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • 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/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • 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/01Arrangements or apparatus for facilitating the optical investigation
    • G01N2021/0106General arrangement of respective parts
    • G01N2021/0112Apparatus in one mechanical, optical or electronic block
    • 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)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Chemical & Material Sciences (AREA)
  • Analytical Chemistry (AREA)
  • Biochemistry (AREA)
  • Immunology (AREA)
  • Pathology (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Textile Engineering (AREA)
  • General Life Sciences & Earth Sciences (AREA)
  • Geophysics (AREA)
  • Quality & Reliability (AREA)
  • Robotics (AREA)
  • Wood Science & Technology (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Investigating Materials By The Use Of Optical Means Adapted For Particular Applications (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method and a system for detecting defects on the upper surface of a casting cylinder body based on machine vision and deep learning, wherein an industrial camera is installed at a station of an engine cylinder body; when the engine cylinder reaches the cylinder station, triggering the industrial camera to shoot a plane photo on the cylinder, and transmitting a result image back to the image processing module; the image processing module divides the image into a plurality of smaller images, performs image processing on each image, and identifies defects in the image based on a pre-trained deep learning defect identification model; and integrating the results of the multiple graphs to obtain the integral detection result of the upper plane of the cylinder body, wherein the integral detection result comprises the information of defect names, defect positions and the like. The method and the system for detecting the defects on the upper surface of the casting cylinder body have the characteristics of convenient deployment, low cost, high system processing speed and the like, and have important significance in promoting the development of manufacturing industry, reducing the production cost of enterprises and improving the production efficiency.

Description

Method and system for detecting defects on upper surface of casting cylinder body
Technical Field
The invention relates to the technical field of automated production, in particular to a method and a system for detecting defects on the upper surface of a casting cylinder body based on machine vision and deep learning.
Background
In the automobile industry, most of cylinder bodies of engines and motors are produced in a casting mode. Despite the recent advances and developments in casting processes, certain drawbacks remain unavoidable in the production of manufactured cylinders. The plane defect on the cylinder body can cause problems of misalignment between the cylinder bodies, quality degradation of the whole product, durable potential safety hazard and the like, and most automobile industry enterprises can control the product completely.
At present, the surface defect detection mode of the cast cylinder body of the automobile engine is manual investigation, and the method has low efficiency and is easy to make mistakes, so that an efficient automatic detection system is needed to realize. With the development of industrial 4.0 and intelligent manufacturing, the improvement of the automation and the intelligent level of the production and manufacturing process has become an important direction of upgrading and transforming of manufacturing enterprises.
The use of machine vision technology to assist the enterprise in automated inspection is an important technology for the intelligent transformation of manufacturing enterprises, wherein the accuracy and precision of defect identification are core factors affecting the cylinder identification efficiency and accuracy. Some detection methods use gray scale detection algorithms to process the acquired image, but have very limited recognition capability for certain defects, such as irregular size, and strange shape.
In recent years, a defect detection method of deep learning has been rapidly developed, and the method can effectively solve the problem of identifying part of specific defects. However, in order to train the deep learning network and evaluate the accuracy and precision of the defect detection method, a large number of data sets including two-dimensional color images, defect information and the like need to be constructed for training learning, and the prior art lacks data sets including a large number of data samples.
Disclosure of Invention
The invention provides a method and a system for detecting defects on the upper surface of a casting cylinder body based on machine vision and deep learning aiming at the defects in the prior art.
According to an aspect of the present invention, there is provided a method of detecting defects on an upper surface of a casting cylinder, comprising:
acquiring hardware in-place information when a cylinder body to be detected reaches a detection station;
triggering and acquiring an upper surface image of the cylinder body based on the hardware in-place information, and performing image preprocessing on the upper surface image of the cylinder body to obtain an image to be identified;
dividing the image to be identified to form a plurality of sub-images;
based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result of each sub-image;
and integrating the defect classification result of each sub-image to obtain the overall identification result of the upper plane defect of the cylinder to be detected, and finishing the detection of the upper surface defect of the cylinder to be detected.
Optionally, the acquiring the hardware in-place information when the cylinder reaches the detection station includes:
and after the cylinder body reaches a designated station, the state of the proximity switch is changed by adopting the proximity switch, so that hardware in-place information is detected.
Optionally, based on the hardware in-place information, triggering to acquire an image of the upper surface of the cylinder, and performing image preprocessing on the image of the upper surface of the cylinder to obtain an image to be identified, including:
based on the hardware in-place information, sending image acquisition instruction information, and triggering to acquire an upper surface image of the cylinder body; wherein, the image acquisition instruction information includes: the shooting camera parameter information and the shooting light source parameter information are sent to a camera based on a camera communication protocol, and a current frame is obtained through shooting, so that an upper surface image of the cylinder body is obtained;
performing image preprocessing on the image of the upper surface of the cylinder body;
adopting a template matching recognition algorithm to recognize the positions of key points of the upper plane of the cylinder body in the upper surface image of the cylinder body, and obtaining the six-degree-of-freedom position coordinates of the cylinder body on the workbench;
judging whether the six-degree-of-freedom position coordinates of the cylinder body on the workbench meet a set coordinate threshold value, and if so, taking the image of the upper surface of the cylinder body as an image to be identified.
Optionally, the image preprocessing includes: image filtering, image enhancement, etc.
Optionally, the segmenting the image to be identified to form a plurality of sub-images includes:
dividing the image to be identified into a plurality of images with set sizes which are not overlapped with each other, and forming a plurality of sub-images.
Optionally, the identifying each sub-image based on the pre-trained deep learning model includes:
acquiring a cylinder image sample containing a target defect;
performing defect labeling on the cylinder image sample to obtain a sample data set;
inputting the sample data set into a deep learning model for training to obtain an inference model;
identifying each sub-image by utilizing the reasoning model, and outputting an image identification result;
and obtaining the pixel position and the defect confidence coefficient of the defect in the sub-image and an external rectangle matched with the pixel position according to the image recognition result, and outputting the coordinate information and the size information of the external rectangle and the defect confidence coefficient as corresponding defect recognition results.
Optionally, the identifying each piece of the sub-image based on the image identification algorithm includes:
based on a template matching recognition algorithm, the type and the image number of the cylinder in the sub-image are obtained through image classification recognition; based on a preset template library, obtaining a template image matched with the sub-image, carrying out gray processing on the sub-image and the template image, and comparing;
dividing pixel positions which are defective in the sub-images and circumscribed rectangles which are matched with the pixel positions according to the comparison result, and taking coordinate information and size information of the circumscribed rectangles as defect information;
and outputting the defect information as a corresponding defect identification result when the defect information is greater than or equal to a preset defect identification standard.
Optionally, in the defect labeling of the cylinder image sample, the size of the defect labeling rectangular frame is unified to be 1.5-2 times of the defect size.
Optionally, the template image refers to standard acquired images of planes on various cylinder bodies, which are acquired in an offline mode, and the standard acquired images have no corresponding defects.
Optionally, the defect identification criteria include: defect parameter threshold.
Optionally, the defect identification criteria include: defect parameter thresholds and tolerance band thresholds.
Optionally, synthesizing defect classification results of each sub-image to obtain an overall identification result of the upper plane defect of the cylinder to be detected, including:
merging and summarizing the obtained data of the defect identification result to obtain a summarized data set;
performing de-duplication on the defect recognition results in the summarized data set, comparing the defect recognition results which are positioned on the dividing boundary positions of two or more sub-images and have the same defect types and are recognized for multiple times, screening the positions of the defect recognition results in the original image, and only reserving the result with the largest externally connected rectangle or the largest confidence coefficient in the defect recognition results;
through the steps, the overall identification result of the upper plane defect of the cylinder body to be detected is finally obtained.
According to another aspect of the present invention, there is provided a system for detecting defects on an upper surface of a casting cylinder, comprising: the system comprises a master control module, a cylinder body state acquisition module, an image acquisition module and a visual algorithm module, wherein the cylinder body state acquisition module, the image acquisition module and the visual algorithm module are respectively connected with the master control module; wherein:
the cylinder body state acquisition module is used for acquiring hardware in-place information when the cylinder body to be detected reaches the detection station;
the master control module is used for monitoring the hardware in-place information in real time, triggering the image acquisition module to acquire the image of the upper surface of the cylinder body, receiving the image of the upper surface of the cylinder body acquired by the image acquisition module, transmitting the image to the vision algorithm module, and receiving the defect identification result of the vision algorithm module;
the image acquisition module is used for acquiring an image of the upper plane of the cylinder to be detected according to the image acquisition instruction information, obtaining an image of the upper surface of the cylinder, and outputting the image to the master control module;
the visual algorithm module is used for carrying out image preprocessing on the image of the upper surface of the cylinder body to obtain an image to be identified; dividing the image to be identified to form a plurality of sub-images; based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result of each sub-image; and integrating the defect classification result of each sub-image to obtain an overall upper plane defect identification result of the cylinder to be detected, and outputting the overall upper plane defect identification result to the master control module.
Optionally, the cylinder state acquisition module includes: the master control module detects the state of the proximity switch in real time, and after the cylinder body reaches a designated station, the state of the proximity switch is changed, and the PLC of the master control module is triggered to correspond to the state change of a preset port, so that hardware in-place information is detected;
optionally, the image acquisition module includes: a camera and a light source; the camera is used for collecting images of the upper plane of the cylinder body to be detected; the light source is arranged around the camera and is used for providing shooting brightness for the camera.
Optionally, the system further comprises: a robot module; the robot module moves to a designated position according to the movement instruction signal output by the master control module; the image acquisition module is mounted on the robot module.
Due to the adoption of the technical scheme, compared with the prior art, the invention has at least one of the following beneficial effects:
according to the method and the system for detecting the defects on the upper surface of the cast cylinder body, the automatic identification technology of the defects on the upper surface of the cylinder body before butt joint is established based on machine vision and deep learning, the whole surface of the cylinder body can be detected at the same time, whether the defects exist on the whole surface or not and what defects exist on the whole surface can be judged in real time, and the overall detection speed is faster than that of manual detection.
According to the method and the system for detecting the defects on the upper surface of the casting cylinder body, provided by the invention, the image is detected by using the deep learning algorithm and the gray level algorithm, so that the overall accuracy is improved compared with the overall accuracy by using only the gray level algorithm.
The method and the system for detecting the defects on the upper surface of the casting cylinder body can judge whether the defects exist on the surface of the cylinder body or not in real time, have the characteristics of low cost, high speed and the like, and can reduce the workload of workers and the labor cost.
The method and the system for detecting the defects on the upper surface of the casting cylinder body can realize the feedback of the defect positions, and are beneficial to improving the repairing efficiency of the vehicle.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, given with reference to the accompanying drawings in which:
FIG. 1 is a flowchart showing a method for detecting defects on the upper surface of a casting cylinder according to a preferred embodiment of the present invention.
FIG. 2 is a schematic diagram showing the components of a system for detecting defects on the upper surface of a casting cylinder according to a preferred embodiment of the present invention.
FIG. 3 is a schematic view of an image acquisition module of a system for detecting defects on the upper surface of a casting cylinder according to a preferred embodiment of the present invention.
In the figure, 1 is an image acquisition module, 2 is a cylinder body, and 3 is a conveying device.
Detailed Description
The present invention will be described in detail with reference to specific examples. The following examples will assist those skilled in the art in further understanding the present invention, but are not intended to limit the invention in any way. It should be noted that variations and modifications could be made by those skilled in the art without departing from the inventive concept. These are all within the scope of the present invention.
The embodiment of the invention provides a method for detecting defects on the upper surface of a casting cylinder body, which comprises the steps of acquiring an image of a target position when an engine cylinder body moves to a detection position, detecting the cylinder body by adopting various visual algorithms (based on a pre-trained deep learning model and an image recognition algorithm), and analyzing by combining a cylinder body template; if no defect exists on the surface of the cylinder body, judging the cylinder body as a qualified part; if the surface of the cylinder body has defects, judging the cylinder body as a defective part, and returning the position information of the defects.
As shown in fig. 1, the method for detecting the defect of the upper surface of the casting cylinder body provided in this embodiment may include:
s1, acquiring hardware in-place information when a cylinder body to be detected reaches a detection station;
s2, triggering and acquiring an upper surface image of the cylinder body based on the hardware in-place information, and performing image preprocessing on the upper surface image of the cylinder body to obtain an image to be identified;
s3, dividing the image to be identified to form a plurality of sub-images;
s4, based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result of each sub-image;
and S5, combining the defect classification results of each sub-image to obtain an overall upper plane defect identification result of the cylinder to be detected, and finishing the upper surface defect detection of the cylinder to be detected.
In a preferred embodiment of S1, acquiring the hardware in-place information when the cylinder arrives at the detection station may include:
and after the cylinder body reaches a designated station, the state of the proximity switch is changed, so that hardware in-place information is detected.
In a preferred embodiment of S2, based on the hardware in-place information, triggering to acquire an image of the upper surface of the cylinder, and performing image preprocessing on the image of the upper surface of the cylinder to obtain an image to be identified, which may include:
s21, based on the hardware in-place information, sending image acquisition instruction information, and triggering to acquire an upper surface image of the cylinder body; wherein, image acquisition instruction information includes: the method comprises the steps of sending image acquisition instruction information to a camera based on a camera communication protocol to obtain a current frame through photographing, and obtaining an upper surface image of a cylinder body;
s22, preprocessing such as image filtering and image enhancement is carried out on the upper surface image of the cylinder body, so as to obtain a clearer image to be identified;
s23, recognizing the positions of key points of the upper plane of the cylinder body in the upper surface image of the cylinder body by adopting a template matching recognition algorithm to obtain six-degree-of-freedom position coordinates of the cylinder body on the workbench;
s24, judging whether the six-degree-of-freedom position coordinates of the cylinder body on the workbench meet a set coordinate threshold value, and if so, taking the image of the upper surface of the cylinder body as the image to be identified.
In a preferred embodiment of S3, the image to be identified is segmented to form a plurality of sub-images, including:
dividing the image to be identified into a plurality of images with set sizes which are not overlapped with each other, and forming a plurality of sub-images. In a specific application, the multiple non-overlapping set-size images are preferably 4 or 9, and the set-size images are typically small-size images with sizes of about 600×400 or 400×300, and the unit is pixels.
In a preferred embodiment of S4, identifying each sub-image based on the pre-trained deep learning model may include:
s411, acquiring a cylinder image sample containing target defects;
s412, performing defect labeling on the cylinder image sample to obtain a sample data set;
s413, inputting the sample data set into a deep learning model for training to obtain an inference model;
s414, identifying each sub-image by utilizing the inference model, and outputting an image identification result;
s415, obtaining pixel positions of defects in the sub-images, defect confidence coefficients and circumscribed rectangles matched with the pixel positions according to the image recognition results, and outputting coordinate information, size information and defect confidence coefficients of the circumscribed rectangles as corresponding defect recognition results.
In a preferred embodiment of S4, the identifying each sub-image based on the image identification algorithm may include:
s421, based on a template matching recognition algorithm, the type and the image number of the cylinder in the sub-image are obtained through image classification recognition; based on a preset template library, obtaining a template image matched with the sub-image, carrying out gray processing on the sub-image and the template image, and comparing;
s422, dividing the pixel position of the defect in the sub-image and the circumscribed rectangle matched with the pixel position according to the comparison result, and taking the coordinate information and the size information of the circumscribed rectangle as defect information;
s423, outputting the defect information as a corresponding defect identification result when the defect information is greater than or equal to a preset defect identification standard.
In a preferred embodiment of S412, in defect labeling the cylinder image sample, the size of the defect labeling rectangular frame is unified to be 1.5-2 times of the size of the defect.
In a preferred embodiment of S422, the template image refers to a standard acquired image of the upper plane of the cylinder of various types acquired in an offline manner, and no corresponding defect exists on the standard acquired image.
In a preferred embodiment of S423, the defect identification criteria include: defect parameter threshold.
In another preferred embodiment of S421, the defect identification criteria include: defect parameter thresholds and tolerance band thresholds.
In a preferred embodiment of S5, the step of synthesizing the defect classification result of each sub-image to obtain the overall identification result of the upper plane defect of the cylinder to be detected may include:
s51, merging and summarizing the data of the obtained defect identification result to obtain a summarized data set;
s52, de-duplicating defect recognition results in the summarized data set, namely comparing the defect recognition results which are the same in defect type and recognized for multiple times on the dividing boundary positions of two or more sub-images, and screening the positions of the defect recognition results in the original image, and only reserving the result with the largest externally connected rectangle or the largest confidence coefficient in the defect recognition results;
and S53, finally obtaining the overall identification result of the upper plane defect of the cylinder body to be detected through the steps.
According to the method for detecting the defects on the upper surface of the casting cylinder body, which is provided by the embodiment of the invention, when the cylinder body reaches a detection station, hardware in-place information is obtained; based on the hardware in-place information, the industrial camera can be triggered to take a picture of the upper surface of the cylinder body, and an image of the upper surface of the cylinder body is obtained; preprocessing an image on the upper surface of the cylinder body to obtain an image to be identified; dividing an image to be identified into a plurality of smaller images; identifying each segmented image, and reasoning to obtain a defect identification result based on a pre-trained deep learning model and an image identification algorithm, wherein the identification result comprises information such as defect types, defect positions and the like; and (3) synthesizing the identification results of the segmentation graphs to obtain the overall identification result of the plane defects on the cylinder body, wherein the overall identification result comprises the types and the positions of the defects.
The method for detecting the defects on the upper surface of the casting cylinder body provided by the embodiment of the invention can judge whether the defects exist on the upper surface of the engine cylinder body in real time, so that the defect vehicles are prevented from circulating to the market, the risk of repairing automobiles is reduced, the workload of workers is reduced, and the labor cost is reduced.
An embodiment of the invention provides a system for detecting defects on the upper surface of a casting cylinder body.
As shown in fig. 2, the system for detecting defects on the upper surface of the casting cylinder provided in this embodiment may include: the system comprises a master control module, a cylinder body state acquisition module, an image acquisition module and a visual algorithm module, wherein the cylinder body state acquisition module, the image acquisition module and the visual algorithm module are respectively connected with the master control module; wherein:
the cylinder body state acquisition module is used for acquiring hardware in-place information when the cylinder body to be detected reaches the detection station;
the master control module is used for monitoring the hardware in-place information in real time, triggering the image acquisition module to acquire the upper surface image of the cylinder body, receiving the upper surface image of the cylinder body acquired by the image acquisition module, transmitting the upper surface image to the visual algorithm module, and receiving the defect identification result of the visual algorithm module;
the image acquisition module is used for acquiring images of the upper plane of the cylinder to be detected according to the image acquisition instruction information, obtaining an image of the upper surface of the cylinder and outputting the image to the master control module; as shown in fig. 3;
the visual algorithm module is used for carrying out image preprocessing on the image of the upper surface of the cylinder body to obtain an image to be identified; dividing an image to be identified to form a plurality of sub-images; based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result; and (3) integrating the defect classification result of each sub-image to obtain an overall upper plane defect identification result of the cylinder to be detected, and outputting the overall upper plane defect identification result to a master control module.
In a preferred embodiment, the cylinder state acquisition module may include: and the master control module detects the state of the proximity switch in real time, and when the cylinder body reaches a designated station, the state of the proximity switch changes to trigger the PLC of the master control module to preset the state change of the designated port, so that the hardware in-place information is detected.
In a preferred embodiment, the image acquisition module may include: a camera and a light source; the camera is used for collecting images of the upper plane of the cylinder body to be detected; a light source is disposed around the camera for providing a photographing brightness for the camera.
In a preferred embodiment, the system may further comprise: a robot module; the robot module moves to a designated position according to the movement instruction signal output by the master control module; the image acquisition module is installed on the robot module.
The following further describes the setting and working methods of each functional module of the technical solution provided in the foregoing embodiment of the present invention.
The image acquisition module is arranged at a fixed position on a specific distance of the detection station, and is kept in a communication state with the bus control module continuously before sending an image acquisition signal to the image acquisition module according to hardware state information, so that the acquisition module is ensured to be in an activated state, and if the bus control module cannot receive the signal of the image acquisition module, the signal is immediately alarmed through a human-computer interaction interface or hardware. In some preferred embodiments, the image acquisition module is mounted on a robot, and can be moved to a designated position under the drive of the robot, and in such examples, the tasks of the bus control module further include: and sending a moving signal to the robot, and driving the image acquisition unit to move to a preset position by the robot according to the moving signal. And returning to a ready state when the execution of the moving instruction of the robot is completed. In this preferred embodiment, in acquiring the hardware state information to be detected, the hardware state information includes position information of the automobile.
The cylinder to be detected can be conveyed by the industrial robot, the state of the on-site proximity switch reflects whether the cylinder to be detected is conveyed to a detection area of the system, in some preferred embodiments, before the hardware state information of the automobile is acquired when the automobile to be detected reaches the designated station, the method further comprises the steps of judging whether the cylinder to be detected reaches the designated station by communicating with other on-site hardware, and the method comprises the following steps:
acquiring working state information of a robot, and judging whether a cylinder body to be detected reaches a designated position or not according to the working state information of the robot; specifically, when the robot is not transported or in a transportation state, returning to the non-ready state, and when the detection cylinder is transported to the detection area, returning to the ready state;
when the cylinder body to be detected reaches a designated position, the image acquisition module acquires images of the cylinder body to be detected to obtain image information of the cylinder body to be detected; specifically, the control module issues a shooting instruction to the image acquisition module, and the light source is started and the camera starts to acquire the image of the cylinder to be detected.
After the vision algorithm module obtains the transferred image data, firstly, confirming the state of the cylinder body again according to the image information of the cylinder body to be detected, and using a template matching recognition algorithm to recognize the positions of some key points of the upper plane of the cylinder body in the shot image, so as to obtain the posture of the cylinder body, and judging whether the cylinder body to be detected meets the requirement of detecting the posture. The pose requirement refers to the six-degree-of-freedom position coordinates of the cylinder body on the workbench.
If the requirement of detecting the pose is met, the cylinder body to be detected reaches the appointed station. The identification flow of the detection of the plane defects on the cylinder body can be performed only through the detection of the pose of the cylinder body to be detected.
The visual algorithm module divides the cylinder image into 4 or 9 images with smaller sizes which are not overlapped with each other, and then performs defect identification on each image.
The visual algorithm module simultaneously has two or more algorithms running in parallel, takes a small-size image as input, and outputs a defect identification result. In particular, different algorithms mainly aim at identifying different kinds of defects so as to increase the identification capacity and coverage of the system, thereby improving the overall identification rate of the defects and the accuracy of the system.
The algorithm running simultaneously at least comprises:
image recognition algorithm: gray scale recognition processing algorithm
The gray level recognition processing algorithm has the main advantages of recognizing defects such as cracks, scratches and the like with regular shapes and small morphological differences. Hereinafter also referred to as conventional defects.
The recognition algorithm is based on a template matching recognition algorithm, and the type and the image number of the cylinder body in the target image are recognized through image classification recognition; and then, based on a preset template library, acquiring a template image of the region image, carrying out gray processing on the shot segmentation image and the target template image, and completing comparison work to segment relevant defects.
Particularly, the dividing defect refers to dividing the pixel position of the defect in the shot divided image, and an external rectangle, and the coordinate information and the size information of the external rectangle are used as defect information and returned to the software general control module.
The template image of the target area refers to a standard acquisition image of the upper plane of each type of cylinder body obtained offline, and the image is ensured not to have corresponding defects.
In some preferred embodiments, criteria for defect verification need to be considered. For example, some extremely slight scratches have limited impact on the cylinder parts, and enterprises can accept the existence of such features in actual manufacturing production without repairing them. If these slight defects are all determined as defects, the yield rate determined by the system is too low, and the overall efficiency of the system is lowered. Therefore, in the determination, it is necessary to reduce the determination of the slight defect according to the parameters of the separated suspected defect, such as the length, width, gradation gradient, and the like.
In some preferred embodiments, manufacturing tolerances of the cast cylinder block are also taken into account to avoid identifying deformations due to manufacturing tolerances as defects. Specifically, when the image templates are matched, processing of relevant tolerance zone thresholds is added to the main edges of the cylinder body, so that the false recognition rate is reduced.
(II) deep learning recognition processing algorithm
The deep learning recognition processing algorithm has the main advantages of recognizing the defects of irregular shapes, uneven sizes, large morphological differences, such as sand holes, worm holes and the like. Hereinafter also referred to as unconventional defects.
Before loading, the recognition algorithm offline performs the following processing:
(1) Acquiring a cylinder image sample containing a target defect, and particularly, polishing and photographing through a hardware system and an image acquisition system which are configured in an environment similar to a defect identification station to acquire image data;
(2) Labeling the image sample, wherein the size of the defect rectangular labeling frame is unified to be 1.5-2 times of the size of the defect;
(3) And inputting the image dataset into the model for training to obtain an inference model.
The trained reasoning model is preloaded in a deep learning recognition processing algorithm, and the algorithm comprises an image preprocessing module, a reasoning model and a reasoning result processing module.
The image preprocessing module is responsible for reading the image obtained from the software master control module, preprocessing the image, and converting the image into the image type which can be identified by the inference model. In particular, the image type attribute mainly refers to an image data format and an image size.
The reasoning model is responsible for reasoning the pictures, and identifying and extracting defect information. Defect information refers to the pixel location of the defect in the captured segmented image, the confidence of the defect, and an bounding rectangle.
The reasoning result processing module takes coordinate data, size data and confidence coefficient data of the defects of the circumscribed rectangle as defect information and returns the defect information to the software master control module.
And the software master control module collects all the recognition results of all the divided images and performs merging and summarizing. The summary information includes:
1. circumscribed rectangle position and size information of conventional defects of each image;
2. circumscribed rectangle position, size information and confidence data of irregular defects of each image.
And the software master control module checks whether defects are positioned on the dividing boundary positions of two or more pictures according to the position information of each defect, wherein the types of the defects are the same, and the defects are identified for multiple times. If yes, only one defect identification result with the largest circumscribed rectangle or the largest confidence coefficient is reserved, so that the identification results are ensured not to be repeated.
It should be noted that: it should be noted that, the steps in the method provided by the present invention may be implemented by using corresponding modules, devices, units, etc. in the system, and those skilled in the art may refer to a technical scheme of the system to implement a step flow of the method, or may refer to a technical scheme of the method to implement a structural composition of the system, that is, embodiments in the system and the method may be understood to be preferred examples, which are not repeated herein.
In some embodiments of the invention:
the method comprises the steps that a proximity switch is placed on site to detect whether a cylinder body reaches a designated station or not, a site PLC detects the state of the proximity switch in real time, and a software master control module inquires the state of the site PLC in real time; when the cylinder body reaches a designated station, the state of the proximity switch is changed, and the PLC is triggered to correspond to the state change of the preset port, so that the software master control module can obtain hardware in-place information.
The general control module is used for sending image acquisition instruction information to the image acquisition module, wherein the image acquisition instruction information comprises photographing camera parameter information and photographing light source parameter information. Collecting respective identification results of the segmented images, merging and summarizing to remove the defects repeatedly identified on the boundary edges of the images, and integrating to obtain an overall identification result; the result contains all existing defects, its position information and kind information, etc.
And the visual algorithm module is used for dividing the gray level image into 4 or 9 images with smaller sizes after receiving the image data acquired by the image acquisition module, and respectively carrying out defect detection reasoning. A pre-trained deep learning model is built in, and the model is used for completing training learning based on offline shot pictures, setting scene configuration, learning parameters and the like, and is used for reasoning images and identifying a plurality of defects; taking offline photographs of cylinder body samples on the engine with defects, and collecting picture data; the data are manufactured into data sets, defect definition is carried out on each graph, then labeling is carried out, and the data sets containing a large number of data samples can be obtained; and learning the data set by using a specific deep learning algorithm to generate a specific deep learning model, namely an inference model. An image recognition algorithm is included for recognizing a number of defects therein. The position information of the defect identification result comprises the central position of an external rectangular frame of the defect and the size parameter. The defect recognition result of each picture is the sum of the recognition result of the deep learning model and the recognition result of the visual algorithm.
According to the method and the system for detecting the defects of the upper surface of the cylinder body, provided by the embodiment of the invention, based on machine vision and deep learning, an automatic surface defect identification technology before assembling and matching of the cast cylinder body of the engine is established, whether defects exist on the upper surface of the cylinder body can be judged in real time, defective vehicles are prevented from flowing into the market, the risk of repairing automobiles is reduced, meanwhile, the workload of workers can be reduced, and the labor cost is reduced. And moreover, the real-time feedback of the defect position can be realized, and the repair efficiency of the cylinder part is improved.
The foregoing describes specific embodiments of the present invention. It is to be understood that the invention is not limited to the particular embodiments described above, and that various changes and modifications may be made by one skilled in the art within the scope of the claims without affecting the spirit of the invention. The above-described preferred features may be used in any combination without collision.

Claims (10)

1. The method for detecting the defects of the upper surface of the casting cylinder body is characterized by comprising the following steps of:
acquiring hardware in-place information when a cylinder body to be detected reaches a detection station;
triggering and acquiring an upper surface image of the cylinder body based on the hardware in-place information, and performing image preprocessing on the upper surface image of the cylinder body to obtain an image to be identified;
dividing the image to be identified to form a plurality of sub-images;
based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result of each sub-image;
and integrating the defect classification result of each sub-image to obtain the overall identification result of the upper plane defect of the cylinder to be detected, and finishing the detection of the upper surface defect of the cylinder to be detected.
2. The method for detecting defects on the upper surface of a casting cylinder according to claim 1, wherein the step of acquiring the hardware in-place information when the cylinder arrives at the detection station comprises the steps of:
and after the cylinder body reaches a designated station, the state of the proximity switch is changed by adopting the proximity switch, so that hardware in-place information is detected.
3. The method for detecting the defects on the upper surface of the casting cylinder body according to claim 1, wherein the steps of triggering to acquire the upper surface image of the cylinder body based on the hardware in-place information and performing image preprocessing on the upper surface image of the cylinder body to obtain an image to be identified include:
based on the hardware in-place information, sending image acquisition instruction information, and triggering to acquire an upper surface image of the cylinder body; wherein, the image acquisition instruction information includes: the shooting camera parameter information and the shooting light source parameter information are sent to a camera based on a camera communication protocol, and a current frame is obtained through shooting, so that an upper surface image of the cylinder body is obtained;
performing image preprocessing on the image of the upper surface of the cylinder body;
adopting a template matching recognition algorithm to recognize the positions of key points of the upper plane of the cylinder body in the upper surface image of the cylinder body, and obtaining the six-degree-of-freedom position coordinates of the cylinder body on the workbench;
judging whether the six-degree-of-freedom position coordinates of the cylinder body on the workbench meet a set coordinate threshold value, and if so, taking the image of the upper surface of the cylinder body as an image to be identified.
4. The method for detecting surface defects on a casting cylinder according to claim 1, wherein the dividing the image to be recognized to form a plurality of sub-images includes:
dividing the image to be identified into a plurality of images with set sizes which are not overlapped with each other, and forming a plurality of sub-images.
5. The method for detecting defects on the upper surface of a casting cylinder according to claim 1, wherein the recognition of each of the sub-images based on the pre-trained deep learning model comprises:
acquiring a cylinder image sample containing a target defect;
performing defect labeling on the cylinder image sample to obtain a sample data set;
inputting the sample data set into a deep learning model for training to obtain an inference model;
identifying each sub-image by utilizing the reasoning model, and outputting an image identification result;
obtaining pixel positions of defects in the sub-images, defect confidence coefficients and circumscribed rectangles matched with the pixel positions according to the image recognition results, and outputting coordinate information, size information and defect confidence coefficients of the circumscribed rectangles as corresponding defect recognition results;
the image recognition algorithm is based on the recognition of each sub-image, and the method comprises the following steps:
based on a template matching recognition algorithm, the type and the image number of the cylinder in the sub-image are obtained through image classification recognition; based on a preset template library, obtaining a template image matched with the sub-image, carrying out gray processing on the sub-image and the template image, and comparing;
dividing pixel positions which are defective in the sub-images and circumscribed rectangles which are matched with the pixel positions according to the comparison result, and taking coordinate information and size information of the circumscribed rectangles as defect information;
and outputting the defect information as a corresponding defect identification result when the defect information is greater than or equal to a preset defect identification standard.
6. The method for detecting defects on an upper surface of a casting cylinder according to claim 5, further comprising any one or more of:
in the defect labeling of the cylinder image sample, the size of a defect labeling rectangular frame is unified to be 1.5-2 times of the size of the defect;
-the template image refers to standard acquired images of the planes on various types of cylinders obtained in an off-line manner, on which the corresponding defects are absent;
-the defect identification criteria comprise: a defect parameter threshold;
-the defect identification criteria comprise: defect parameter thresholds and tolerance band thresholds.
7. The method for detecting defects on the upper surface of a casting cylinder according to claim 1, wherein the step of synthesizing the defect recognition result of each sub-image to obtain the overall upper plane defect recognition result of the cylinder to be detected comprises the steps of:
merging and summarizing the obtained data of the defect identification result to obtain a summarized data set;
performing de-duplication on the defect recognition results in the summarized data set, comparing the defect recognition results which are positioned on the dividing boundary positions of two or more sub-images and have the same defect types and are recognized for multiple times, screening the positions of the defect recognition results in the original image, and only reserving the result with the largest externally connected rectangle or the largest confidence coefficient in the defect recognition results;
through the steps, the overall identification result of the upper plane defect of the cylinder body to be detected is finally obtained.
8. A system for detecting defects on an upper surface of a casting cylinder, comprising: the system comprises a master control module, a cylinder body state acquisition module, an image acquisition module and a visual algorithm module, wherein the cylinder body state acquisition module, the image acquisition module and the visual algorithm module are respectively connected with the master control module; wherein:
the cylinder body state acquisition module is used for acquiring hardware in-place information when the cylinder body to be detected reaches the detection station;
the master control module is used for monitoring the hardware in-place information in real time, triggering the image acquisition module to acquire the image of the upper surface of the cylinder body, receiving the image of the upper surface of the cylinder body acquired by the image acquisition module, transmitting the image to the vision algorithm module, and receiving the defect identification result of the vision algorithm module;
the image acquisition module is used for acquiring an image of the upper plane of the cylinder to be detected according to the image acquisition instruction information, obtaining an image of the upper surface of the cylinder, and outputting the image to the master control module;
the visual algorithm module is used for carrying out image preprocessing on the image of the upper surface of the cylinder body to obtain an image to be identified; dividing the image to be identified to form a plurality of sub-images; based on a pre-trained deep learning model and an image recognition algorithm, respectively recognizing each sub-image to obtain a defect recognition result of each sub-image; and integrating the defect classification result of each sub-image to obtain an overall upper plane defect identification result of the cylinder to be detected, and outputting the overall upper plane defect identification result to the master control module.
9. The cast cylinder upper surface defect detection system of claim 8, further comprising any one or more of:
-the cylinder status acquisition module comprising: the master control module detects the state of the proximity switch in real time, and after the cylinder body reaches a designated station, the state of the proximity switch is changed, and the PLC of the master control module is triggered to correspond to the state change of a preset port, so that hardware in-place information is detected;
-the image acquisition module comprising: a camera and a light source; the camera is used for collecting images of the upper plane of the cylinder body to be detected; the light source is arranged around the camera and is used for providing shooting brightness for the camera.
10. The cast cylinder upper surface defect detection system of claim 8 or 9, further comprising: a robot module; the robot module moves to a designated position according to the movement instruction signal output by the master control module; the image acquisition module is mounted on the robot module.
CN202310039962.7A 2023-01-11 2023-01-11 Method and system for detecting defects on upper surface of casting cylinder body Pending CN116337887A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310039962.7A CN116337887A (en) 2023-01-11 2023-01-11 Method and system for detecting defects on upper surface of casting cylinder body

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310039962.7A CN116337887A (en) 2023-01-11 2023-01-11 Method and system for detecting defects on upper surface of casting cylinder body

Publications (1)

Publication Number Publication Date
CN116337887A true CN116337887A (en) 2023-06-27

Family

ID=86881133

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310039962.7A Pending CN116337887A (en) 2023-01-11 2023-01-11 Method and system for detecting defects on upper surface of casting cylinder body

Country Status (1)

Country Link
CN (1) CN116337887A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993727A (en) * 2023-09-26 2023-11-03 宁德思客琦智能装备有限公司 Detection method and device, electronic equipment and computer readable medium
CN117523307A (en) * 2023-11-24 2024-02-06 佛山众陶联供应链服务有限公司 Tile sorting method and system based on opc and tile surface flaw identification model

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116993727A (en) * 2023-09-26 2023-11-03 宁德思客琦智能装备有限公司 Detection method and device, electronic equipment and computer readable medium
CN116993727B (en) * 2023-09-26 2024-03-08 宁德思客琦智能装备有限公司 Detection method and device, electronic equipment and computer readable medium
CN117523307A (en) * 2023-11-24 2024-02-06 佛山众陶联供应链服务有限公司 Tile sorting method and system based on opc and tile surface flaw identification model
CN117523307B (en) * 2023-11-24 2024-04-19 佛山众陶联供应链服务有限公司 Tile sorting method and system based on opc and tile surface flaw identification model

Similar Documents

Publication Publication Date Title
CN111951237B (en) Visual appearance detection method
CN108171112B (en) Vehicle identification and tracking method based on convolutional neural network
CN116337887A (en) Method and system for detecting defects on upper surface of casting cylinder body
US11508057B2 (en) Inspection system and method for vehicle underbody
KR20220042916A (en) Vision inspection system by using remote learning of product defects image
CN111007073A (en) Method and system for online detection of part defects in additive manufacturing process
CN110033431B (en) Non-contact detection device and detection method for detecting corrosion area on surface of steel bridge
CN117095005B (en) Plastic master batch quality inspection method and system based on machine vision
CN105158268A (en) Intelligent online detection method, system and device for defects of fine-blanked parts
CN108090434B (en) Rapid ore identification method
CN112304960A (en) High-resolution image object surface defect detection method based on deep learning
CN114235837A (en) LED packaging surface defect detection method, device, medium and equipment based on machine vision
CN113111875A (en) Seamless steel rail weld defect identification device and method based on deep learning
CN118202383A (en) Defect detection method, defect detection system, and defect detection program
CN115937059A (en) Part inspection system with generative training models
CN113012228B (en) Workpiece positioning system and workpiece positioning method based on deep learning
CN113936291A (en) Aluminum template quality inspection and recovery method based on machine vision
Hridoy et al. A framework for industrial inspection system using deep learning
CN116678898B (en) Generalized wafer defect detection method, system, equipment and medium
CN117635599A (en) Defect detection model training and defect detection method, device, equipment and medium
CN116385353B (en) Camera module abnormality detection method
CN115255884B (en) Robot roller automatic assembly system and method based on OpenCV vision processing
CN111145254A (en) Door valve blank positioning method based on binocular vision
CN115601345A (en) Machine vision-based large-size punching plate hole group leakage-proof detection method and device
CN112734742B (en) Method and system for improving industrial quality inspection accuracy

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