Device and method for detecting tiny defects on surface of product
Through image processing technology and automated detection equipment, the problem of difficult detection of tiny defects on the product surface has been solved, and efficient, stable and accurate automated detection has been achieved, with automatic marking and quality traceability functions.
Patent Information
- Application Number
- CN202511002658.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-21
- Publication Date
- 2025-09-26
AI Technical Summary
In existing technologies, defects such as tiny scratches generated during the production process of products such as automobile engine oil coolers, transmission oil coolers and new energy vehicle battery coolers are difficult to detect automatically, resulting in low detection efficiency, poor stability and low accuracy, and reliance on manual visual inspection leads to subjective results.
The device for detecting tiny defects on product surfaces uses image matching, filtering, differentiation, and threshold processing technologies combined with automatic code scanning and lighting optimization. Automated detection is achieved through components such as profiling tooling, acquisition cameras, light sources, and NG marking modules. It uses image processing algorithms to identify scratch defects and trace quality issues through QR codes.
It achieves rapid and stable identification of tiny defects on the product surface, improves detection accuracy and automation, reduces human errors, has the function of automatically marking unqualified products, and supports quality data traceability.
Smart Images

Figure CN120703102A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of visual inspection and relates to a device and method for detecting minor defects on a product surface. Background Art
[0002] The manufacturing process for automotive engine oil coolers, transmission oil coolers, new energy vehicle battery coolers, and oil coolers in electric drive cooling systems primarily includes stamping, cleaning, riveting, assembly, welding, marking, airtightness testing, and dimensional inspection. These cooler products now feature automated testing for airtightness, mounting hole position, sealing surface flatness, and other dimensional inspections on single machines or integrated inspection lines, ensuring product quality. However, defects such as scratches incurred during production and transit are often overlooked. This is because the product's sealing surface has inconsistent texture and brightness, and some even have complex conditions such as localized shallow liquid stains. Furthermore, the product surface is prone to uneven illumination and localized specular reflections under illumination, making it difficult to detect. If these scratches are located in the mounting seal area, they can impair the sealing effect, thereby affecting the product's cooling performance. Currently, there are no automated inspection devices or methods on the market, and major manufacturers still rely on manual visual inspection to control product quality.
[0003] However, this method has obvious shortcomings, mainly:
[0004] (1) Low inspection efficiency. When processing large quantities of products, the inspection time of inspectors has a relatively fixed time interval, which is difficult to improve significantly.
[0005] (2) Poor testing stability. Different people may have different judgments about the same product, which is more dependent on the worker's experience. When the testing time is too long, visual fatigue and depression are likely to occur. At this time, product testing is affected by people's subjective emotions, and the objectivity of the test results cannot be guaranteed, resulting in reduced stability.
[0006] (3) Low detection accuracy. Due to the physical limitations of the human eye, especially in certain special circumstances (such as strong reflections), some defects that are short and shallow on the product inspection surface may not be detected under continuous naked eye observation, which can easily lead to fatigue detection and reduce accuracy. Summary of the Invention
[0007] In order to overcome the deficiencies of the prior art, the present invention provides a device and method for detecting minor defects on a product surface.
[0008] In order to achieve the above object, the present invention adopts the following technical solutions:
[0009] A method for detecting minor defects on a product surface comprises the following steps:
[0010] Step 1: Confirm that the workpiece is loaded onto the profiling tooling, triggering the profiling tooling to move from the loading and unloading station to the inspection station. After confirming that it is in place, scan the QR code information on the workpiece to confirm the model of the workpiece;
[0011] Step 2: Trigger the acquisition camera to capture images of the inspection surface of the workpiece, upload the images to the industrial computer for defect detection, and output the defect detection results;
[0012] Step 3: Confirm the defect detection results of the workpiece. If it is confirmed to be defect-free, the image data of the workpiece and the detection results are stored in the industrial computer corresponding to the QR code information; if it is confirmed to be defective, the NG marking module is used to imprint a mark on the surface of the workpiece, and the image data of the workpiece and the detection results are stored in the industrial computer corresponding to the QR code information;
[0013] Step 4: The copy tooling returns to the loading and unloading station for unloading.
[0014] Furthermore, image defect detection includes the following steps:
[0015] Step 2.1: Extract the outer and inner contour points of the workpiece in the collected grayscale image, calculate the center point and rotation angle information of the minimum circumscribed rectangle of the outer contour, call the image template corresponding to the current workpiece model, and perform image contour matching;
[0016] Step 2.2: Copy the initial grayscale image to generate a copy image, and perform median filtering on the copy image;
[0017] Step 2.3: Perform difference processing on the copied image after median filtering and the initial grayscale image to obtain a difference image;
[0018] Step 2.4: Set the grayscale threshold and perform thresholding on the difference image to obtain a binary image;
[0019] Step 2.5: Perform contour processing on the binary image and extract the contour point set;
[0020] Step 2.6: Traverse the contour point set, remove the outer contour boundary points and inner contour boundary points, and set constraints to determine whether there are defective contour points.
[0021] Furthermore, image contour matching includes:
[0022] Step 2.1.1: Calculate the deviation between the minimum circumscribed rectangle center point and the rotation angle of the workpiece grayscale image and the image template. Based on this deviation, translate and rotate the inner and outer contour points of the workpiece in the grayscale image.
[0023] Step 4.1.2: After translation and rotation, traverse each point in the workpiece outer contour point set in the grayscale image and calculate the corresponding point with the shortest distance to the image template outer contour point set. During the traversal process, the corresponding points in the image template outer contour point set are not repeated. If the distance between two points in the above traversal number is less than or equal to the set distance threshold for more than a set percentage, the image outer contour is judged to match. Otherwise, it is judged as an image mismatch, that is, the workpiece is mixed and is not the current template workpiece, and the system alarm is triggered to remind you of the workpiece mix.
[0024] Step 4.1.3: If the outer contour of the image matches, traverse each point in the inner contour point set of the workpiece in the grayscale image and calculate the corresponding point with the shortest distance to the inner contour point set of the image template; during the traversal process, the corresponding points in the inner contour point set of the image template are not repeated; if the distance between two points in the above traversal number is less than or equal to the set distance threshold for more than a set percentage, it is judged that the inner contour of the image matches; if not, then calculate and determine the inner contour match of the image after the inner contour point is rotated 90 degrees, 180 degrees, and 270 degrees by the center point of the minimum circumscribed rectangle. If any of the inner contours of the image matches, it is judged that the image contour matches and no subsequent judgment is performed; if there is no inner contour match, it is judged that the image does not match.
[0025] Furthermore, after step 1 and before step 3, the profiling tooling rotates a set number of times in sequence according to the set angle, and step 2 is executed after each rotation to obtain a set number of defect detection results.
[0026] Furthermore, in step 1, the model confirmation of the workpiece includes: the barcode scanner works and scans and identifies the QR code on the back of the workpiece, obtains the QR code information and uploads it to the industrial computer through the network communication protocol, the industrial computer determines whether the QR code information is correct, whether there is a wrong code, garbled code or repeated code, if a wrong code, garbled code or repeated code occurs, the industrial computer displays the QR code error information on the touch screen, and communicates with the electronic control system, allowing the electronic control system to control the alarm through the IO interface to light up a red light and a buzzer reminder, and trigger the feeding cylinder to work, so that the workpiece returns to the loading and unloading station, and at the same time prompts the operator to press the reset button on the touch screen to reset; if the QR code information is correct, the industrial computer displays the QR code information on the touch screen.
[0027] A device for detecting minor defects on a product surface, for executing the above-mentioned method for detecting minor defects on a product surface, comprising:
[0028] A profiling tooling, wherein the profiling tooling is hollow and provided with a profiling groove for placing the workpiece;
[0029] A linear feeding mechanism, used to drive the profiling tool to move between the loading and unloading stations and the inspection station;
[0030] A rotating mechanism, used for driving the rotation of the profiling tooling, wherein the rotating mechanism is provided on the linear feeding mechanism;
[0031] An acquisition camera is provided at the inspection station to acquire an image of the inspection surface of the workpiece above the profiling tooling;
[0032] A light source, used to illuminate the inspection surface of the workpiece;
[0033] NG marking module, the NG marking module includes a stamp and a Z-axis cylinder for driving the movement of the stamp
[0034] Barcode scanner, used to identify the QR code information on the workpiece;
[0035] Touch screen display, used to display visual information and provide human-computer interaction;
[0036] The industrial computer is electrically connected to the linear feeding mechanism, the rotating mechanism, the acquisition camera, the barcode scanner and the touch screen respectively. The industrial computer is provided with detection software for performing image defect detection.
[0037] Furthermore, the profiling tooling includes a bottom tooling and a top tooling, the top tooling is detachably connected to the bottom tooling, and the profiling groove is provided on the top tooling.
[0038] Furthermore, it also includes a through-beam photoelectric sensor, which is arranged at the loading and unloading station and forms through-beam light. The profiling tooling is radially provided with a slot for the through-beam light to pass through, and the slot is connected to the profiling slot.
[0039] Furthermore, gratings for forming a counter-reflection are respectively provided on both sides of the loading and unloading stations.
[0040] Furthermore, the light source includes a first aperture and a second aperture, and the first aperture and the second aperture are arranged in sequence from top to bottom above the imitation tooling, the first aperture and the second aperture are coaxial, the diameter of the first aperture is smaller than the diameter of the second aperture, and the inner periphery of the first aperture and the inner periphery of the second aperture are evenly distributed with LED lamp beads, and the light-emitting angle of the LED lamp beads is 0°.
[0041] In summary, the present invention is beneficial in that:
[0042] (1) Using image processing technologies such as image matching, image filtering, image difference, image threshold binarization, and binary image contour detection, it is possible to quickly and stably identify scratch defects on the product surface.
[0043] (2) It has a low-angle two-layer lighting solution, which effectively avoids uneven lighting on the product surface and local mirror reflection, making scratches and appearance defects stand out, which is conducive to image algorithm recognition.
[0044] (3) It has an automatic code scanning function. After the product is placed on the tooling and the start button is pressed, the product reaches the detection position. The system self-sensingly recognizes the QR code and determines whether there are any wrong codes, garbled codes, or duplicate codes.
[0045] (4) It has the function of automatic image acquisition and detection. After the code is scanned successfully, the system automatically triggers the camera to capture the image and calls the image detection algorithm to identify whether there are scratch defects on the detection surface.
[0046] (5) The inspection image data is bound to the product QR code information, which can be queried through the database or by scanning the code to trace quality problems.
[0047] (6) It has the function of automatically marking the unqualified test results on the product test surface.
[0048] (7) The device has strong compatibility. Within the field of view, for products of different sizes and shapes, it only needs to replace the matching imitation tooling and switch the product formula to detect them. Among them, the product formula is associated with the grayscale image template of the inspection surface of the product. This template has been processed in advance to know the position of its inspection surface boundary points and the boundary points of the holes in the inspection surface. The image template is used to match the grayscale image of the inspected workpiece to determine the position of the inspection surface boundary points and the boundary points of the holes in the inspection surface of the workpiece. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 This is a flowchart of the method for detecting minor defects on product surfaces of the present invention.
[0050] Figure 2 It is a structural schematic diagram of the device for detecting minor defects on product surfaces of the present invention.
[0051] Figure 3 for Figure 2 Schematic diagram of the structure from the bottom perspective.
[0052] Figure 4 for Figure 2 Schematic diagram of the structure above the horizontal plate.
[0053] Figure 5 for Figure 4 Top view in .
[0054] Figure 6 for Figure 4 Schematic diagram of the structure from another perspective.
[0055] Figure 7 It is a schematic diagram of the exploded structure of the rotating mechanism and the copy tooling part.
[0056] Figure 8 Schematic diagram of the structure of the light source.
[0057] Markings in the figure: 11. Horizontal plate; 12. Window; 13. Feeding guide rail; 14. Electric control panel box; 15. Industrial computer; 16. Touch screen; 2. Detection surface; 21. Rotating mechanism; 211. Rotating motor; 22. Bottom tooling; 221. Screw hole; 23. Top tooling; 231. Profiling groove; 232. Slot; 233. Gap part; 234. Support part; 3. Photoelectric sensor; 31. Grating; 4. Light source; 41. Acquisition camera; 42. First aperture; 43. Second aperture; 51. Barcode scanner; 52. NG marking module. DETAILED DESCRIPTION
[0058] The following describes the embodiments of the present invention through specific examples. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments. The details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other unless they conflict.
[0059] It should be noted that the illustrations provided in the following embodiments are merely schematic illustrations of the basic concept of the present invention. Therefore, the illustrations only show components related to the present invention and are not drawn according to the number, shape, and size of components in actual implementation. In actual implementation, the type, quantity, and proportion of each component may be arbitrarily changed, and the component layout may also be more complex.
[0060] All directional indications in the embodiments of the present invention (such as up, down, left, right, front, back, horizontal, vertical...) are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0061] Due to installation errors and other reasons, the parallel relationship referred to in the embodiments of the present invention may actually be an approximately parallel relationship, and the perpendicular relationship may actually be an approximately perpendicular relationship.
[0062] The present invention provides a device for detecting minor defects on the surface of a product, comprising a frame, a profiling tool, a linear feeding mechanism, a rotating mechanism 21, a visual inspection module, a code scanning and recognition module, an NG marking module 52, a display module, an industrial computer 15, and an electronic control system.
[0063] Reference Figure 2 and Figure 3The frame includes a square frame structure composed of multiple beams and columns. An electric control panel box 14 and an industrial computer 15 are provided at the bottom of the frame. A horizontal plate 11 is fixedly provided in the middle of the frame for setting a profiling tool, a linear feeding mechanism, a rotating mechanism 21, etc., wherein the linear feeding mechanism includes a feeding guide rail 13 and a feeding cylinder. A window 12 is provided on the horizontal plate 11, and a group of feeding guide rails 13 are respectively provided on the opposite sides of the window 12. The bottom of the rotating mechanism 21 forms a sliding fit connection with the feeding guide rails 13 on both sides, and the feeding cylinder is connected to the rotating mechanism 21 for driving the rotating mechanism 21 to move along the feeding guide rails 13; the profiling tool is provided on the rotating mechanism 21, and the rotating mechanism 21 includes The outer ring base, the inner ring rotating platform and the rotating motor 211, the inner ring rotating platform and the outer ring base form a coaxial hollow structure, the outer ring base is connected to the feeding guide rail 13, the rotating motor 211 is installed on the outer ring base, and is driven by the gear box to drive the rotation of the inner ring rotating platform, the copying tooling is connected to the inner ring rotating platform, so that the copying tooling can rotate under the drive, and the feeding cylinder drives the rotating mechanism 21 to realize the linear movement and feeding of the copying tooling, and the two ends in the linear direction are formed as loading and unloading stations and inspection stations. The copying tooling moves to the loading and unloading station to set up the workpiece, and the copying tooling carries the workpiece to the inspection station for the workpiece inspection process.
[0064] Specifically, refer to Figure 7 The profiling tooling includes a bottom tooling 22 and a top tooling 23. Both the bottom tooling 22 and the top tooling 23 are hollow, and the hollow parts are connected to the hollow part of the rotating platform. The hollow part of the top tooling 23 is set as a profiling groove 231 for setting the workpiece. The profiling groove 231 is provided with a support part 234 for supporting the edge of the workpiece, and a gap part 233 is also provided for facilitating the removal of the workpiece. In some embodiments, the workpiece can also form an interference fit with the inner periphery of the profiling groove 231 to achieve clamping.
[0065] Connecting screw holes 221 are provided on the top tooling 23 and the bottom tooling 22, and the top tooling 23 and the bottom tooling 22 are detachably connected and fixed by inserting long screws. The profiling groove 231 of the top tooling 23 is set to adapt to the set model workpiece. When it is necessary to replace other models of workpieces for inspection, the detachable connection allows for quick switching and adaptation by only replacing the top tooling 23.
[0066] Further, refer to Figures 4 to 6, slots 232 are provided on the radially opposite sides of the top tooling 23, the slots 232 pass through in the radial direction and are connected to the hollow part of the top tooling 23, a group of through-beam photoelectric sensors 3 are provided at the loading and unloading stations, the photoelectric sensors 3 are installed on the frame, and through-beam photoelectric sensors 3 are formed between them. When the profiling tooling is located at the loading and unloading stations, the rotating mechanism 21 rotates the profiling tooling to the initial angle position. At this time, the slots 232 are located on the path of the through-beam light. When no workpiece is placed, the through-beam light can pass through the slots 232 on both sides to form effective through-beam. When a workpiece is placed on the top tooling 23, the workpiece will block the through-beam light.
[0067] The presence of material loading is automatically sensed by whether the incident light from the photoelectric sensor 3 is blocked. The signal line of the photoelectric sensor 3 is electrically connected to the IO port interface of the electronic control system, which monitors this interface in real time. When the profiling tool is located at the loading and unloading station, the incident light is blocked, and the signal from the photoelectric sensor 3 changes from low to high or from high to low (in this embodiment, the electronic control system preferably captures the signal from low to high), the electronic control system sets a delay time and begins the current overall inspection process, activating the linear feed mechanism to transport the profiling tool from the loading and unloading station to the inspection station for defect detection. After the inspection is completed, when the profiling tool returns from the inspection station to the loading and unloading station, it will block the incident light again, and the photoelectric sensor 3 will generate a sensing signal again. At this time, the electronic control system ignores the sensing signal from the photoelectric sensor 3 based on the condition that the current overall inspection process has not yet ended. The copy tooling will be rotated back to the initial angle position during the process of returning to the loading and unloading station. When the inspection result in the current total inspection process is OK, the copy tooling will rotate back to the initial angle position. After it is in place, the delay time will be set to end the current total inspection process; when the inspection result in the current total inspection process is NG, the copy tooling will rotate back to the initial angle position. After it is in place, the NG marking module 52 will be started to execute the marking process. After the marking is completed, the delay time will be set to end the current total inspection process.
[0068] After the current total inspection process is completed, the workpiece can be unloaded and removed. At this time, the incident light penetrates the slot 232 again to reset the photoelectric sensor 3 to monitor the next loading of the workpiece onto the copy tooling.
[0069] Furthermore, a set of light barriers 31 are installed on the left and right sides of the loading and unloading stations. These light barriers 31 are fixedly mounted on the profiles on either side of the frame, creating a cross-beam pattern. Their signal lines are electrically connected to the IO interface of the electronic control system. When the profiling tool is loaded and the linear feed mechanism begins entering the inspection station, the electronic control system monitors this interface in real time until the linear feed mechanism returns from the inspection station to the loading and unloading station, completing the current overall inspection process. If an object obstructs the cross-beam pattern of the light barriers 31 during this process, the electronic control system triggers an emergency stop, effectively preventing injuries from accidental hand placement during the entire inspection process.
[0070] Furthermore, a magnetic switch may be provided at the detection station. When the profiling tooling moves to the detection station, the magnetic switch will be triggered to generate a corresponding arrival signal.
[0071] The visual inspection module includes a collection camera 41 and a light source 4. The collection camera 41 is set above the inspection station and its position is fixed by a frame. Figure 4 and Figure 6 , the acquisition camera 41 collects the upper surface image of the workpiece on the copy tooling downward, so as to perform defect detection on the workpiece surface based on the collected image; the light source 4 can be directly set above the copy tooling, and the light source 4 illuminates the copy tooling to make the defects on the workpiece surface stand out, thereby facilitating defect resolution detection in the image collected by the camera.
[0072] Preferably, refer to Figure 8 The light source 4 is set to be ring-shaped and is arranged between the acquisition camera 41 and the workpiece. The light source 4 includes a first aperture 42 and a second aperture 43. The inner circumference of the first aperture 42 and the inner circumference of the second aperture 43 are uniformly arranged with a full circle of LED lamp beads along the circumferential direction. The light generated by the first aperture 42 and the second aperture 43 will partially irradiate downward on the surface of the workpiece on the profiling tooling, which can well highlight the defects.
[0073] Preferably, the light emitting angle of the LED lamp bead is 0°, that is, the light emitting direction is parallel to the plane where the aperture ring is located, so that the generated light is the softest, and will not be too bright to hit the surface of the workpiece, nor will it be too bright to interfere with the shooting of the acquisition camera 41.
[0074] The first aperture 42 and the second aperture 43 are distributed at a set height interval in the vertical direction. Specifically, the first aperture 42 is higher than the second aperture 43. The second aperture 43 is at a height of 10 mm above the profiling tooling, and the first aperture 42 is at a height of 20 mm above the profiling tooling. The first aperture 42 and the second aperture 43 are coaxially arranged and arranged in a stacked manner. The diameter of the first aperture 42 is smaller than the diameter of the second aperture 43, so that the light of the second aperture 43 is within the light range of the first aperture 42, thereby enhancing the illumination of the central area and highlighting the defects.
[0075] The LED lamp beads are round-headed, high-brightness LED lamp beads. Their luminous color is blue. The wavelength of blue light ranges from 440 to 490 nm, which is shorter than the wavelengths of green and red light. It has higher energy and can more easily penetrate metal materials and be absorbed. It can reduce metal surface reflections and allow the details of the metal surface to be displayed more clearly.
[0076] The code scanning and identification module includes a code scanner 51. In this embodiment, the workpiece includes a front side and a back side. The front side is the detection surface 2 that needs to be inspected for defects, and the back side can be pasted with a QR code that can be scanned and identified by the code scanner 51. The QR code serves as the identity identifier of the corresponding workpiece and stores a variety of information of the corresponding workpiece, so that it can be identified and distinguished by the code scanner 51. When the workpiece is set on the imitation tooling, its front side is the upper surface and the back side is the lower surface. Figure 3 The barcode scanner 51 is fixedly installed on the frame and is located below the horizontal plate 11. The hollow setting of the profiling tooling and the rotating platform, combined with the open setting of the window 12, makes it possible to see no obstruction between the lower surface of the workpiece and the barcode scanner 51. The barcode scanner 51 can directly scan and identify the information on the back of the workpiece.
[0077] The NG marking module 52 is arranged above the loading and unloading station and is fixed to the frame. In order to prevent the NG marking module 52 from interfering with the visual field, a group of Z-axis cylinders are set up (the Z-axis is vertical in this embodiment), and a seal is set at the end of the Z-axis cylinder. When a workpiece is detected as having defects at the inspection station, the seal can be moved by the cylinder to the surface of the workpiece to imprint an NG mark, thereby serving as a prompt.
[0078] The display module includes a touch screen 16 for displaying image data and detection data, as well as user operations.
[0079] The industrial computer 15 is installed in the electronic control panel box 14, and the electronic control panel box 14 is fixed to the frame. The industrial computer 15 is connected to the linear feeding mechanism, the rotating mechanism 21, the visual inspection module, the code scanning and recognition module, the NG marking module 52, and the display module to transmit data, and is equipped with an electronic control system to realize the control of each mechanism module.
[0080] The present invention also provides a method for detecting minor defects on a product surface, which is based on the above-mentioned device for detecting minor defects on a product surface, and specifically comprises the following steps:
[0081] Step 1: The profiling tool is at the loading and unloading station. A workpiece is loaded onto the profiling tool. After the workpiece blocks the incident light of the photoelectric sensor 3, the detection process is triggered.
[0082] Step 2: The linear feeding mechanism drives the profiling tooling to move from the loading and unloading station to the inspection station.
[0083] Step 3: After the profiling tooling arrives at the inspection station, the barcode scanner 51 works and scans and identifies the QR code on the back of the workpiece, obtains the QR code information and uploads it to the industrial computer 15 through the network communication protocol. The industrial computer 15 determines whether the QR code information is correct, whether there is an error code, garbled code or repeated code. The error code indicates that the first N fixed characters are incorrect, the garbled code indicates that the total number of characters is one more or one less, and the repeated code indicates that it is repeated with the previously inspected workpiece QR code. If an error code, garbled code or repeated code occurs, the industrial computer 15 displays the QR code error information on the touch screen 16 and communicates with the electronic control system, allowing the electronic control system to control the alarm to light up a red light and buzzer through the IO interface, and trigger the feeding cylinder to work, so that the workpiece returns to the loading and unloading station, and at the same time prompts the operator to press the reset button of the touch screen 16 to reset (that is, turn off the red light and stop the buzzer to proceed to the next inspection process); if the QR code information is correct, the industrial computer 15 displays the QR code information on the touch screen 16.
[0084] The duplicate code detection and judgment process includes:
[0085] Each time you scan a QR code (assuming the first N digits are fixed characters, representing information such as the supplier, and the last M digits are unfixed characters, representing the shift, year, day of the year, and serial number)
[0086] 3.1. Take the first N fixed characters as the first-level directory folder.
[0087] 3.2. Use the last M digits of the year, shift, and day of the year to create the second-level, third-level, and fourth-level sub-directory folders respectively.
[0088] 3.3. Enter the corresponding folder and check whether there are any sub-directory folders and files (such as TXT format).
[0089] 3.4. If it does not exist, create this subdirectory folder and file
[0090] 3.5. If it exists, read the file for comparison.
[0091] 3.6. If the same character information is found, it will be prompted as a duplicate.
[0092] 3.7. If the code is not found, the character information of the QR code scanned this time will be written into the file.
[0093] Under the above judgment process, each comparison only requires reading a small file (the maximum number of which is the output of only one shift) instead of comparing it with all previously saved data, which greatly reduces the amount of calculation and improves detection efficiency.
[0094] Step 4: When the scan confirms that the QR code information corresponds to the model of the workpiece, the electronic control system triggers the acquisition camera 41 to capture the image of the inspection surface 2 of the workpiece. The collected image is uploaded to the industrial computer 15 through the network communication protocol. The industrial computer 15 uses the inspection software and the image defect detection algorithm to perform visual inspection on the image to determine whether there are defects in the inspection surface 2. If there are defects, the defective area in the image is marked.
[0095] The image defect detection specifically includes the following steps:
[0096] Step 4.1: The acquired image is a grayscale image. The outer contour points (the outer edge points of the workpiece detection surface 2) and the inner contour points (the hole edge points at the non-outer contour of the workpiece detection surface 2) of the workpiece in the grayscale image are extracted, and the center point of the minimum circumscribed rectangle of the outer contour and the rotation angle information are calculated;
[0097] According to the currently set workpiece detection model, the image template corresponding to the current workpiece model is called (the image template includes the inner and outer contour point information of the workpiece detection surface 2, the center point of the minimum circumscribed rectangle of the outer contour, and the rotation angle information) to perform image contour matching. The image contour matching method includes:
[0098] Step 4.1.1: Calculate the deviation between the minimum circumscribed rectangle center point and the rotation angle of the workpiece grayscale image and the image template. Based on this deviation, translate and rotate the inner and outer contour points of the workpiece in the grayscale image.
[0099] Step 4.1.2: After translation and rotation, traverse each point in the workpiece outer contour point set in the grayscale image and calculate the corresponding point with the shortest distance to the image template outer contour point set; during the traversal process, the corresponding points in the image template outer contour point set are not repeated; if the distance between two points in the above traversal number is less than or equal to the set distance threshold for a set percentage (for example, 95%), the image outer contour is judged to match; otherwise, it is judged as an image mismatch, that is, the workpiece is mixed and is not the current template workpiece, and the system alarm reminds you of the workpiece mix (the marked QR code information does not correspond to the workpiece type);
[0100] Step 4.1.3: If the image outer contour matches, then traverse each point in the workpiece inner contour point set in the grayscale image and calculate the corresponding point with the shortest distance to the image template inner contour point set; during the traversal process, the corresponding points in the image template inner contour point set are not repeated; if the distance between two points in the above traversal number is less than or equal to the set distance threshold for a set percentage (for example, 95%), then it is determined that the image inner contour matches; if not, then calculate and determine the inner contour match of the image after rotating the inner contour point by 90 degrees, 180 degrees, and 270 degrees around the center point of the minimum circumscribed rectangle. If any of the image inner contours matches, it is determined that the image contour matches and subsequent judgments are not performed; if no inner contour matches, it is determined that the image does not match. Among them, the three cases of rotating by 90 degrees, 180 degrees, and 270 degrees take into account the situation where the outer contours of different types of workpieces are the same but the inner contours are axially symmetrical.
[0101] Step 4.2: Copy the initial grayscale image and perform median filtering on the copied image. The basic principle is to replace the grayscale value of a pixel in the digital image with the median of the grayscale values of all points in a neighborhood of the pixel.
[0102] Step 4.3: Perform a difference process on the initial grayscale image and the median filtered copy image. This process involves subtracting the grayscale value of each pixel in the initial grayscale image from the grayscale value of the copy image to obtain a difference image. The grayscale values in the initial grayscale image and the copy image are in the range of 0 to 255.
[0103] Step 4.4: Threshold the differential image, that is, traverse the grayscale value corresponding to each pixel in the differential image, and compare whether the grayscale value is greater than the set grayscale threshold (preferably 20 in this embodiment); if so, set the grayscale value of the pixel to 0, otherwise, set the grayscale value of the pixel to 255.
[0104] Step 4.5: Perform contour finding processing on the thresholded differential image, thereby extracting all contour point sets within the detection surface 2 of the workpiece corresponding to the image.
[0105] Step 4.6: Use the constraints to filter out the scratch contour points. The constraints include minimum length and minimum width. That is, traverse the extracted contour point set, remove the outer contour boundary points and inner contour boundary points of the detection surface 2, and filter and determine whether there are scratch contour points based on the constraints of the minimum length and minimum width of the scratch defect.
[0106] Among them, the processing in steps 4.2 to 4.6 helps to highlight the pixels of scratch defects. In addition, the grayscale values of different detection areas of the workpiece detection surface 2 may be quite different after lighting. The grayscale values of some areas are close to those of the scratch area. If the initial grayscale image is directly thresholded, it will cause misjudgment. It should be noted that the pixel grayscale value of the scratch area is abrupt relative to the surrounding non-scratched area, while the grayscale value of the local area caused by factors such as uneven illumination intensity, inconsistent illumination angle, and inconsistent glossiness of the workpiece surface is slowly changing relative to the surrounding area. In the case of slow change, the difference in pixel grayscale value before and after median filtering is relatively small.
[0107] Step 5: The rotating mechanism 21 drives the profiling tool to rotate to a set angle, and step 4 is repeated once.
[0108] Step 6: Repeat step 5 multiple times. In this embodiment, it is preferably set to be repeated three times, and then the visual inspection result of the current workpiece is displayed on the touch screen 16.
[0109] Among them, considering that in order to make it easier to place the workpiece and simplify the loading and unloading operations, the support position of the profiling groove 231 of the profiling tooling will leave a margin with the workpiece, and the center position of the detection surface 2 of the workpiece is not necessarily the same each time the workpiece is placed, making it difficult for the workpiece detection surface 2 and the four surfaces of the light source to be completely parallel, and it is difficult for the center of the workpiece detection surface 2 and the center axis of the four surfaces of the light source to coincide. In this case, it will cause the lighting effect of the workpiece detection surface 2 at different rotation angles to be different, which will affect the defect recognition and detection. Therefore, after the first execution of the image defect detection process, step 5 and step 6 are executed one or more times. Because multiple executions are time-consuming and the difference in lighting effects is not obvious when the angle is small, the preferred setting in this embodiment is to repeat step 5 and step 6 twice, and the set rotation angles in the two steps 5 are -45° and 45° respectively.
[0110] Step 7: If the test results of the set multiple image visual inspections are all qualified (i.e., no defects exist), the industrial computer 15 displays the image on the touch screen 16 and lights up the green light, names the image with the QR code information and saves it, and saves this QR code information and the corresponding inspection qualified mark in the form of a document; then, the industrial computer 15 communicates with the electronic control system, allowing the electronic control system to trigger the linear feeding mechanism to work, so that the copy tooling and the workpiece return to the loading and unloading station. After confirming the trigger signal of the photoelectric sensor 3 of the loading and unloading station, it is known that the workpiece has returned to the loading and unloading position, and the rotating mechanism 21 rotates the copy tooling back to the initial angle position.
[0111] Step 8: If any of the inspection results is unqualified, the image marked with defects will be displayed on the touch screen 16, and a red light and a buzzer will be turned on to remind. The electronic control system will trigger the linear feeding mechanism to make the workpiece return to the loading and unloading position, and the rotating mechanism 21 will rotate the copy tooling back to the initial angle position. The industrial computer 15 communicates with the electronic control system, and the electronic control system controls the NG marking module 52 to work. The Z-axis cylinder drives the seal to move to the inspection surface 2 of the workpiece to imprint the mark, completing the NG marking process; then, it is necessary to manually press the touch screen reset button to actively eliminate the alarm (i.e., turn off the red light and stop the buzzer). The industrial computer 15 will also name and save the image marked with defects with QR code information, and save this QR code information and the corresponding NG mark in document form.
[0112] Step 9: When the workpiece returns to the loading and unloading position, it is unloaded to the good product area or the defective product area according to the inspection results of the workpiece.
[0113] The present invention also provides a method for querying and tracing inspection records of cooler workpieces, comprising:
[0114] (1) The operator taps the mode switch button on the touch screen interface to switch the detection mode to the QR code query mode.
[0115] (2) Place the workpiece on the profiling tooling, press the start button with both hands, and the feeding cylinder will move the profiling tooling and the workpiece to the inspection station.
[0116] (3) The system controls the scanner to identify the QR code of the workpiece and transmits it to the query software. After processing, the query software displays the QR code information of the workpiece and a photo of its sealing surface.
[0117] (4) After the query is completed, the system controls the linear feeding mechanism to operate so that the workpiece returns to the loading and unloading position.
[0118] (5) The operator removes the workpiece.
[0119] Alternatively, the operator can also query the software by filtering conditions such as the test date, manually entered QR code information, and test results to query the corresponding records.
[0120] The present invention also provides a management and query method for the QR code on the cooler workpiece, which is used to systematically manage and query the QR code information, image information and test results generated by the detection device. Users can view the test results in various ways, such as time and date screening, pass / fail screening, and precise QR code query. It not only supports manual input query, but also can be linked with a code scanner to automatically obtain and process QR code information, thereby improving operational efficiency and accuracy. The method includes:
[0121] Database query:
[0122] Date and time filter: Users can filter test records by specific year, month, and day. By entering conditions such as supplier information and shift, the system can extract and display all test records that meet the conditions from the local database.
[0123] Test result screening: Screening based on whether the test results are qualified or not. Users can select a specific test result (such as qualified or unqualified), and the system will display all records that meet the criteria.
[0124] QR code precise query: Users can enter the product's QR code information or directly use a barcode scanner to scan the QR code on the product. The system will accurately match the records in the local database and call out the corresponding detailed detection information, including detection images and test results.
[0125] Automated processing:
[0126] Scanner Integration: The software is tightly integrated with the scanner. Once the scanner reads the QR code, it is automatically transmitted to the software, triggering the query operation. This feature greatly improves query efficiency and reduces manual input errors.
[0127] Test result display: The query results are displayed in a table on the software interface. Users can intuitively view the detailed information of each test record, including serial number, year, month, day, customer part number, supplier, shift, serial number and test result, etc.
[0128] Data export and reset:
[0129] Data Export: Users can export the current query results as Excel files for further analysis and archiving. This function ensures flexible use and long-term preservation of data.
[0130] Query condition reset: Provides a reset function to clear all current query conditions, making it convenient for users to re-enter new query conditions and query test records under different conditions.
[0131] Furthermore, a query method is provided, comprising:
[0132] Filter by time and date:
[0133] The user selects the year, month, and day to be queried, and enters conditions such as supplier information and shifts. Click the "Query" button, and the system will automatically filter and display all inspection records that meet the conditions from the database.
[0134] Filter queries by test results:
[0135] The user selects the type of test result to be queried (such as qualified or unqualified), clicks the "Query" button, and the system will display all records that meet the test result conditions.
[0136] Accurate query through QR code:
[0137] Users can manually enter the QR code information or scan the QR code on the product with a scanner. After the system receives and interprets the QR code information, it immediately performs an accurate match in the database, calls up the corresponding inspection record, and displays detailed information.
[0138] Data export and query condition reset:
[0139] After completing a query, users can click the "Data Export" button to export the current query results as an Excel file for easy archiving and sharing. At the same time, users can also click the "Reset" button to clear all currently entered query conditions and start a new query operation.
[0140] Furthermore, a query software interface based on a touch screen display is provided, including:
[0141] Query condition input area: Users enter or select query conditions here, including year, month, day, supplier, shift, test results and QR code information.
[0142] Function button area: includes data export and reset buttons. Users can export query results or reset query conditions by clicking these buttons.
[0143] Result display area: The query results are displayed in table format, and the detailed information of each record is clear at a glance.
[0144] Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
Claims
1. A method for detecting minor defects on a product surface, characterized in that: The following steps are involved: Step 1: Confirm that the workpiece is loaded onto the profiling tooling, triggering the profiling tooling to move from the loading and unloading station to the inspection station. After confirming that it is in place, scan the QR code information on the workpiece to confirm the model of the workpiece; Step 2: Trigger the acquisition camera to capture images of the inspection surface of the workpiece, upload the images to the industrial computer for defect detection, and output the defect detection results; Step 3: Confirm the defect detection results of the workpiece. If it is confirmed to be defect-free, the image data of the workpiece and the detection results are stored in the industrial computer corresponding to the QR code information; if it is confirmed to be defective, the NG marking module is used to imprint a mark on the surface of the workpiece, and the image data of the workpiece and the detection results are stored in the industrial computer corresponding to the QR code information; Step 4: The copy tooling returns to the loading and unloading station for unloading.
2. A method for detecting minor defects on a product surface according to claim 1, characterized in that: Image defect detection includes the following steps: Step 2.1: Extract the outer and inner contour points of the workpiece in the collected grayscale image, calculate the center point and rotation angle information of the minimum circumscribed rectangle of the outer contour, call the image template corresponding to the current workpiece model, and perform image contour matching; Step 2.2: Copy the initial grayscale image to generate a copy image, and perform median filtering on the copy image; Step 2.3: Perform difference processing on the copied image after median filtering and the initial grayscale image to obtain a difference image; Step 2.4: Set the grayscale threshold and perform thresholding on the difference image to obtain a binary image; Step 2.5: Perform contour processing on the binary image and extract the contour point set; Step 2.6: Traverse the contour point set, remove the outer contour boundary points and inner contour boundary points, and set constraints to determine whether there are defective contour points.
3. The method for detecting minor defects on a product surface according to claim 2, characterized in that: Image contour matching includes: Step 2.1.1: Calculate the deviation between the minimum circumscribed rectangle center point and the rotation angle of the workpiece grayscale image and the image template. Based on this deviation, translate and rotate the inner and outer contour points of the workpiece in the grayscale image. Step 4.1.2: After translation and rotation, traverse each point in the workpiece outer contour point set in the grayscale image and calculate the corresponding point with the shortest distance to the image template outer contour point set. During the traversal process, the corresponding points in the image template outer contour point set are not repeated. If the distance between two points in the above traversal number is less than or equal to the set distance threshold for more than a set percentage, the image outer contour is judged to match. Otherwise, it is judged as an image mismatch, that is, the workpiece is mixed and is not the current template workpiece, and the system alarm is triggered to remind you of the workpiece mix. Step 4.1.3: If the outer contour of the image matches, traverse each point in the inner contour point set of the workpiece in the grayscale image and calculate the corresponding point with the shortest distance to the inner contour point set of the image template; during the traversal process, the corresponding points in the inner contour point set of the image template are not repeated; if the distance between two points in the above traversal number is less than or equal to the set distance threshold for more than a set percentage, it is judged that the inner contour of the image matches; if not, then calculate and determine the inner contour match of the image after the inner contour point is rotated 90 degrees, 180 degrees, and 270 degrees by the center point of the minimum circumscribed rectangle. If any of the inner contours of the image matches, it is judged that the image contour matches and no subsequent judgment is performed; if there is no inner contour match, it is judged that the image does not match.
4. A method for detecting minor defects on a product surface according to claim 1, characterized in that: After step 1 and before step 3, the copy tooling rotates a set number of times according to the set angle, and step 2 is executed after each rotation to obtain a set number of defect detection results.
5. The method for detecting minor defects on a product surface according to claim 1, characterized in that: In step 1, the model confirmation of the workpiece includes: the barcode scanner works and scans and identifies the QR code on the back of the workpiece, obtains the QR code information and uploads it to the industrial computer through the network communication protocol, the industrial computer determines whether the QR code information is correct, whether there is an incorrect code, garbled code or repeated code, and if an incorrect code, garbled code or repeated code is present, the industrial computer displays the QR code error information on the touch screen and communicates with the electronic control system, allowing the electronic control system to control the alarm to light up a red light and buzzer reminder through the IO interface, and trigger the feeding cylinder to work, so that the workpiece returns to the loading and unloading station, and at the same time prompts the operator to press the reset button on the touch screen to reset; If the QR code information is correct, the industrial computer will display the QR code information on the touch screen.
6. A device for detecting minor defects on a product surface, used to perform the method for detecting minor defects on a product surface according to any one of claims 1 to 5, characterized in that: include: A profiling tooling, wherein the profiling tooling is hollow and provided with a profiling groove for placing the workpiece; A linear feeding mechanism is used to drive the movement of the profiling tool between the loading and unloading stations and the inspection station; a rotating mechanism is used to drive the rotation of the profiling tool, and the rotating mechanism is provided on the linear feeding mechanism; An acquisition camera is provided at the inspection station to acquire an image of the inspection surface of the workpiece above the profiling tooling; A light source, used to illuminate the inspection surface of the workpiece; NG marking module, the NG marking module includes a stamp and a Z-axis cylinder for driving the movement of the stamp Scanner, used to identify the QR code information on the workpiece; Touch screen display, used to display visual information and provide human-computer interaction; The industrial computer is electrically connected to the linear feeding mechanism, the rotating mechanism, the acquisition camera, the barcode scanner and the touch screen respectively. The industrial computer is provided with detection software for performing image defect detection.
7. The device for detecting minor defects on product surfaces according to claim 6, characterized in that: The profiling tooling includes a bottom tooling and a top tooling, the top tooling is detachably connected to the bottom tooling, and the profiling groove is arranged on the top tooling.
8. The device for detecting minor defects on product surfaces according to claim 6, characterized in that: It also includes a through-beam photoelectric sensor, which is arranged at the loading and unloading station and forms through-beam light. The profiling tooling is radially provided with a slot for the through-beam light to pass through, and the slot is connected to the profiling slot.
9. The device for detecting minor defects on product surfaces according to claim 6, characterized in that: Gratings for forming a counter-reflection are respectively arranged on both sides of the loading and unloading stations.
10. The device for detecting minor defects on product surfaces according to claim 6, characterized in that: The light source includes a first aperture and a second aperture, which are arranged in sequence from top to bottom above the profiling tooling, the first aperture and the second aperture are coaxial, the diameter of the first aperture is smaller than the diameter of the second aperture, and LED lamp beads are evenly distributed on the inner periphery of the first aperture and the inner periphery of the second aperture, and the light-emitting angle of the LED lamp beads is 0°.