An industrial automation quality inspection device and control method based on image recognition
By setting auxiliary cross lines and a lifting stage on the eyepiece of the hardness tester, and combining image recognition and multiple test force loading, the problems of large manual calibration error and complex image recognition of hardness testers are solved, and efficient and accurate hardness testing and hardness indenter wear detection are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2026-03-17
AI Technical Summary
Existing hardness testers suffer from low accuracy due to the manual calibration of indentation boundaries during hardness measurement. The image recognition method is complex and inefficient, especially when the base plate and indentation are the same color, making it difficult to distinguish them and resulting in low accuracy.
An industrial automated quality inspection device based on image recognition is adopted. By setting auxiliary cross lines on the eyepiece, the camera collects images of the indentation and cross lines, counts the number of cross line pixels and the distance within the exposure area, automatically determines the indentation area, and detects the wear of the hardness indenter by combining a lifting platform and multiple test force loading, thus realizing automated hardness measurement.
It improves the accuracy and efficiency of hardness testing, reduces human error, can accurately identify the indentation area and detect wear of the hardness indenter, and ensures the accuracy of hardness measurement.
Smart Images

Figure CN119269232B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of industrial automation, specifically relating to an industrial automation quality inspection device and control method based on image recognition. Background Technology
[0002] A hardness tester is a hardness testing instrument. Metal hardness represents a material's resistance to indentation by a hard object; it is one of the important performance indicators of metallic materials. Current hardness testers require manual operation of corresponding control buttons during hardness measurement. First, a test force is applied to the test object using a hardness indenter, creating an indentation. Then, the objective lens is placed directly above the indentation, and the hardness is determined based on the indentation. There are currently two methods for determining the hardness of the test object: one is to manually observe the boundary points of the indentation and manually move the boundary calibration line to calibrate the boundary of the indentation. This method introduces significant human error and has low accuracy. The other method is image recognition, which involves acquiring indentation images, training the images to obtain the indentation area, and then determining the hardness based on the indentation area. This method requires acquiring a large number of indentation images, is complex, and has low detection efficiency. Furthermore, when the image color of the test object's substrate is the same as the indentation color (both are black), it is difficult to distinguish between the indentation area and the substrate area, resulting in low detection accuracy. Summary of the Invention
[0003] This invention provides an industrial automated quality inspection device and control method based on image recognition, which solves the problems of low detection accuracy when manually calibrating the indentation boundary to determine hardness in the current hardness measurement process, and the complexity, low detection efficiency and accuracy when using image recognition to determine the indentation area to determine hardness.
[0004] According to a first aspect of the present invention, an industrial automated quality inspection device based on image recognition is provided, comprising a microhardness tester and its control platform. The microhardness tester includes a camera, an eyepiece, an objective lens, a hardness indenter, an indenter rod, a stage, and a reflector disposed between the eyepiece and the objective lens. The eyepiece is provided with auxiliary cross lines. The objective lens and the indenter rod are disposed on a turntable, and the stage is disposed below the hardness indenter and the objective lens. The control platform is connected to the turntable drive mechanism, the indenter rod, and the camera of the microhardness tester, respectively. After receiving a hardness detection signal, the control platform first controls the turntable drive mechanism to drive... The turntable is rotated so that the hardness indenter on the turntable rotates to be directly above the object to be tested on the stage. Then, the indenter rod is controlled to move the hardness indenter downward, applying a set test force to the object to be tested, so that a square indentation is produced on the object to be tested, and the two diagonals of the indentation are the exposure areas. Afterward, the turntable drive mechanism is controlled to drive the turntable to rotate so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The color of the auxiliary cross line is different from the image color of the object to be tested and the indentation.
[0005] After the camera captures an image including the indentation and auxiliary intersecting lines through the eyepiece, the control platform determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary intersecting lines, it counts the number of auxiliary pixels located within the diagonal exposure area along both diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of auxiliary pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation; and based on the area of the indentation, it determines the hardness of the object under test.
[0006] In one optional implementation, the control platform further determines whether the hardness of the object to be tested is within a preset hardness range. If it is, the hardness of the object to be tested is qualified; otherwise, the hardness of the object to be tested is unqualified.
[0007] In another alternative implementation, the stage is a lifting stage, and the control platform is connected to the lifting stage. After controlling the turntable drive mechanism to drive the turntable to rotate so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation, the platform determines the clarity of the image captured by the camera and adjusts the lifting stage according to the clarity so that the image clarity reaches a preset clarity.
[0008] In another optional implementation, the control platform locally stores a relationship graph between hardness, test force loading parameters, and indentation area. After receiving the wear detection signal of the hardness indenter and determining the hardness of the test object based on the area of the indentation, the control platform determines the second test force loading parameters based on the relationship graph. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameters.
[0009] The control platform controls the turntable drive mechanism to rotate the turntable according to the second test force loading parameters, so that the hardness indenter on the turntable rotates to be directly above the test object on the stage. Then, the indenter rod is controlled to move the hardness indenter downward, loading the set test force onto the test object, so that a square indentation is generated on the test object, and the two diagonals of the indentation are the exposure area. After that, the turntable drive mechanism is controlled to rotate the turntable so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area.
[0010] After the camera captures an image including the indentation and auxiliary intersecting lines through the eyepiece, the control platform determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each pixel in the auxiliary intersecting lines, it counts the number of pixels of the auxiliary intersecting lines located within the two diagonal exposure areas along the two diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation, thus obtaining the indentation area for the second time.
[0011] Determine whether the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the force loading parameters of the second test. If so, it is determined that the hardness indenter is not worn; otherwise, it is determined that the hardness indenter is worn.
[0012] In another alternative implementation, the hardness indenter is a regular square pyramid indenter, which creates a square indentation on the test object, with the two diagonals of the indentation serving as the exposure area.
[0013] According to a second aspect of the present invention, a control method for the above-described image recognition-based industrial automated quality inspection device is provided, comprising a control platform performing the following steps:
[0014] Step S110: After receiving the hardness detection signal, firstly, control the turntable drive mechanism in the microhardness tester to drive the turntable to rotate, so that the hardness indenter on the turntable rotates to be directly above the test object on the stage. Then, control the indenter rod to drive the hardness indenter to move down, applying the set test force to the test object, so that a square indentation is generated on the test object, and the two diagonals of the indentation are the exposure area. Control the turntable drive mechanism to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The color of the auxiliary cross line is different from the imaging color of the test object and the indentation.
[0015] Step S120: After the camera captures an image of the indentation and the auxiliary cross line in the eyepiece, the auxiliary cross line is determined based on the RGB values of each pixel in the image.
[0016] Step S130: Based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary cross line, count the number of auxiliary pixels of the auxiliary cross line located in the diagonal exposure area along the two diagonal directions.
[0017] Step S140: Determine the distance represented by each pixel based on the magnification of the eyepiece and objective lens; determine the length of the two diagonals based on the number of auxiliary pixels and the distance represented by each pixel; determine the area of the indentation based on the length of the two diagonals; determine the hardness of the object to be tested based on the area of the indentation.
[0018] In one alternative implementation, step S130 includes:
[0019] Step S131: For each auxiliary pixel in the auxiliary cross line, determine a straight line that passes through the auxiliary pixel and is perpendicular to the diagonal of the auxiliary pixel. Starting from the auxiliary pixel, move outward along the vertical line and determine whether each pixel is white according to its RGB value. If it is white, increment the corresponding calibrated pixel by 1 until non-white pixels are determined at both ends of the vertical line starting from the auxiliary pixel.
[0020] Step S132: Determine whether the calibration pixel corresponding to the auxiliary pixel is 0. If yes, proceed to step S133; otherwise, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1.
[0021] Step S133: Determine whether the calibration pixel corresponding to the adjacent auxiliary pixel facing the center of the auxiliary cross line is 2. If yes, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Otherwise, determine that the auxiliary pixel is not within the diagonal exposure area.
[0022] In another optional implementation, after step S110 and before step S120, the method further includes: determining the sharpness of the image captured by the camera, and adjusting the lifting of the lifting stage in the microhardness tester according to the sharpness, so that the image sharpness reaches a preset sharpness.
[0023] Another alternative implementation also includes:
[0024] Step S150: Determine whether a hardness indenter wear detection signal has been received. If yes, proceed to step S160; otherwise, end the measurement process.
[0025] Step S160: Determine the second test force loading parameters based on the relationship diagram of hardness, test force loading parameters and indentation area stored locally. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameters.
[0026] Step S170: According to the second test force loading parameters, perform a second test force loading on the test object according to steps S110 to S140 to obtain the indentation area for the second time.
[0027] Step S180: Determine whether the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the second test force loading parameters. If so, determine that the hardness indenter is not worn; otherwise, determine that the hardness indenter is worn.
[0028] In another alternative implementation, step S160 includes:
[0029] Step S161: Take the hardness obtained from the first loading as the target hardness, and determine other hardnesses that are lower than the target hardness;
[0030] Step S162: For each test force loading parameter, find the indentation area corresponding to the target hardness and other hardness from the relationship graph, take the other hardness whose indentation area is closest to the indentation area corresponding to the target hardness as the comparison hardness, and calculate the absolute value of the difference between the indentation area corresponding to the target hardness and the comparison hardness.
[0031] Step S163: Compare the absolute values of the differences calculated for each test force loading parameter, select the absolute value of the largest difference, and use the test force loading parameter corresponding to the selected absolute value of the difference as the second test force loading parameter.
[0032] The beneficial effects of this invention are:
[0033] 1. This invention sets auxiliary cross lines on the eyepiece, making the color of the auxiliary cross lines different from the image color of the test object and the indentation, and making the diagonal area of the indentation the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal of the indentation and are located at the center of the diagonal exposure area. In this way, the length of the two diagonals can be determined by the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area and the distance represented by each pixel. Thus, the indentation area can be determined based on the length of the two diagonals, and the hardness of the test object can be determined based on the indentation area. This invention does not rely on manual calibration of the boundary points of the indentation, and does not introduce human error. Furthermore, the indentation area recognition based on the image is achieved by counting the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area. The method is simple, and the hardness of the test object can be determined based on the indentation area after the indentation area is identified. The hardness detection efficiency and accuracy are both high.
[0034] 2. This invention uses a lifting platform as the stage and connects the control platform to the lifting platform. The lifting platform is raised and lowered according to the clarity of the image captured by the camera. This allows for the automatic acquisition of clear imaging images. The hardness of the object to be tested can be determined based on the clear imaging images, which can further ensure the accuracy of hardness measurement.
[0035] 3. When detecting whether the hardness indenter is worn, this invention first selects the second test force loading parameters, so that the test object is subjected to two different test forces. The indentation area is determined for each of the two test forces. If the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the same second test force loading parameters, then the hardness indenter is determined not to be worn. Otherwise, the hardness indenter is determined to be worn. Even if the hardness indenter is only slightly worn, the wear detection method of this invention can detect it with high accuracy. After accurately ruling out hardness indenter wear, the accuracy of the indentation area based on image recognition is even higher, thereby further ensuring the accuracy of hardness detection.
[0036] 4. The present invention designs a method for selecting the second test force loading parameters, which can improve the difference in indentation area between the hardness of the test object and other hardnesses under the second test force loading parameters, thereby ensuring the accuracy of wear detection of the hardness indenter. Attached Figure Description
[0037] Figure 1This is a schematic diagram of an embodiment of the industrial automated quality inspection device based on image recognition of the present invention;
[0038] Figure 2 It is an imaging image that includes indentations and auxiliary cross lines;
[0039] Figure 3 This is a flowchart of an embodiment of the control method for an industrial automated quality inspection device based on image recognition according to the present invention. Detailed Implementation
[0040] To enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, and to make the above-mentioned objectives, features and advantages of the embodiments of the present invention more apparent and understandable, the technical solutions in the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.
[0041] In the description of this invention, unless otherwise specified and limited, it should be noted that the term "connection" should be interpreted broadly. For example, it can be a mechanical connection or an electrical connection, or it can be a connection between two internal components. It can be a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above term according to the specific circumstances.
[0042] See Figure 1 This is a schematic diagram of an embodiment of the industrial automated quality inspection device based on image recognition of the present invention. The device may include a microhardness tester 1 and its control platform 2. The microhardness tester 1 may include a camera 11, an eyepiece 12, an objective lens 13, a hardness indenter 14, an indenter rod 15, a stage 16, and a reflector 17 disposed between the eyepiece 12 and the objective lens 13. The eyepiece 12 has auxiliary cross lines. The objective lens 13 and the indenter rod 15 are disposed on a turntable 18. The stage 16 is disposed below the hardness indenter 14 and the objective lens 13. The control platform 2 can be connected to the turntable drive mechanism 19, the indenter rod 15, and the camera 11 of the microhardness tester 1, respectively. After receiving a hardness detection signal, it first controls the turntable drive mechanism 19 to drive the turntable 18 to rotate, so that the hardness indenter on the turntable 18... The indenter 14 rotates to a position directly above the object to be tested on the stage 16. Then, the indenter rod 15 is controlled to move the indenter 14 downwards, applying a set test force to the object, creating a square indentation. The two diagonals of this indentation form the exposure area (this can be achieved by increasing the magnification of the eyepiece and / or objective lens, or by using other methods). Subsequently, the turntable drive mechanism 19 drives the turntable 18 to rotate, positioning the objective lens 13 of the corresponding magnification directly above the indentation. At this point, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The color of the auxiliary cross line is distinct from the image color of the object and the indentation. Figure 2As shown, the auxiliary cross lines can be red.
[0043] After the camera captures an image including the indentation and auxiliary intersecting lines through the eyepiece, the control platform 2 determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary intersecting lines, it counts the number of auxiliary pixels located within the diagonal exposure area along both diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of auxiliary pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation; and based on the area of the indentation, it determines the hardness of the object to be tested.
[0044] In this embodiment, the indentation, except for the exposure area, is non-white. The exposure area is white, and the areas in the image captured by the camera, excluding the indentation, can be black, white, or other colors different from the auxiliary cross lines. The control platform can also determine whether the hardness of the object under test is within a preset hardness range. If so, the hardness of the object under test is qualified; otherwise, the hardness of the object under test is unqualified. Furthermore, the stage 16 can be a lifting stage. The control platform 2 is connected to the lifting stage. After controlling the turntable drive mechanism 19 to drive the turntable 18 to rotate, so that the objective lens of the corresponding magnification on the turntable 18 is placed directly above the indentation, the platform determines the sharpness of the image captured by the camera. Based on this sharpness, the lifting stage is adjusted to achieve a preset sharpness. The determination of image sharpness can employ algorithms such as the Tenengrad gradient method, the Laplacian gradient method, and the variance method. This invention uses a lifting platform as the stage and connects the control platform to the lifting platform. The lifting platform is raised and lowered according to the clarity of the image captured by the camera. This allows for the automatic acquisition of clear imaging images. The hardness of the object to be measured is determined based on the clear imaging images, which can further ensure the accuracy of hardness measurement.
[0045] Furthermore, wear on the hardness indenter can also affect the accuracy of hardness measurement. When the hardness indenter is worn, the identified indentation area will shrink, and the measured hardness will increase accordingly. Therefore, it is necessary to periodically check whether the hardness indenter is worn. However, when the hardness indenter is slightly worn, existing detection methods are difficult to detect. To address this, the control platform of this invention can locally store a relationship graph between hardness, test force loading parameters, and indentation area. After receiving the hardness indenter wear detection signal and determining the hardness of the test object based on the indentation area, the control platform can determine the second test force loading parameters based on the relationship graph. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other lower hardnesses under the same second test force loading parameters.
[0046] The control platform, based on the second test force loading parameters, controls the turntable drive mechanism to rotate the turntable, causing the hardness indenter on the turntable to rotate directly above the test object on the stage. Then, the indenter rod is controlled to move the hardness indenter downwards, applying the set test force to the test object, creating a square indentation on the object. The two diagonals of this indentation form the exposure area. Subsequently, the turntable drive mechanism is controlled to rotate the turntable, positioning the objective lens of the corresponding magnification directly above the indentation. At this point, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The camera captures... After the eyepiece captures an image including the indentation and the auxiliary intersecting lines, the control platform determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each pixel in the auxiliary intersecting lines, it counts the number of pixels of the auxiliary intersecting lines located within the two diagonal exposure areas along the two diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation, thus obtaining the indentation area for the second time.
[0047] The control platform determines whether the indentation area obtained the second time is equal to the indentation area obtained from the first loading under the second test force loading parameters. If so, it is determined that the hardness indenter is not worn; otherwise, it is determined that the hardness indenter is worn. In detecting whether the hardness indenter is worn, this invention first selects the second test force loading parameters, applying two different test forces to the test object, and then determines the indentation area under each of the two loading forces. If the indentation area obtained the second time is equal to the indentation area obtained from the first loading under the second test force loading parameters, it is determined that the hardness indenter is not worn; otherwise, it is determined that the hardness indenter is worn. Even if the hardness indenter shows only slight wear, this invention's wear detection method can detect it with high accuracy. After accurately ruling out hardness indenter wear, the accuracy of the indentation area based on image recognition is even higher, thus further ensuring the accuracy of hardness detection.
[0048] The hardness indenter 14 can be a regular square pyramid indenter to create a square indentation on the test object, with the two diagonals of the indentation serving as the exposure area. The microhardness tester can be a Vickers hardness tester.
[0049] As can be seen from the above embodiments, the present invention sets auxiliary cross lines on the eyepiece, such that the color of the auxiliary cross lines is different from the imaging color of the test object and the indentation, and makes the diagonal area of the indentation the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal of the indentation and are located at the center of the diagonal exposure area. In this way, the length of the two diagonals can be determined according to the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area and the distance represented by each pixel. Thus, the indentation area can be determined according to the length of the two diagonals, and the hardness of the test object can be determined according to the indentation area. The present invention does not rely on manual calibration of the boundary points of the indentation, and does not introduce human error. Furthermore, the indentation area recognition based on the image is achieved by counting the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area. The method is simple, and the hardness of the test object can be determined according to the indentation area after the indentation area is identified. The hardness detection efficiency and accuracy are both high.
[0050] See Figure 3 This is a flowchart illustrating an embodiment of the control method for an industrial automated quality inspection device based on image recognition according to the present invention. The control method may include the control platform 2 performing the following steps:
[0051] Step S110: After receiving the hardness detection signal, firstly, control the turntable drive mechanism 19 in the microhardness tester 1 to drive the turntable 18 to rotate, so that the hardness indenter 14 on the turntable 18 rotates to be directly above the test object on the stage 16. Then, control the indenter rod 15 to drive the hardness indenter 14 to move down, and apply the set test force to the test object, so that a square indentation is generated on the test object, and the two diagonals of the indentation are the exposure area. Control the turntable drive mechanism 19 to drive the turntable 18 to rotate, so that the objective lens 13 of the corresponding magnification on the turntable 18 is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area (the center point of the auxiliary cross line overlaps with the center point of the diagonal). The color of the auxiliary cross line is different from the imaging color of the test object and the indentation.
[0052] Step S120: After the camera captures an image in the eyepiece that includes the indentation and the auxiliary cross line, the auxiliary cross line is determined based on the RGB values of each pixel in the image.
[0053] Step S130: Based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary cross line, count the number of auxiliary pixels located within the diagonal exposure area along both diagonal directions. Step S130 may include:
[0054] Step S131: For each auxiliary pixel in the auxiliary cross line, determine a straight line that passes through the auxiliary pixel and is perpendicular to the diagonal of the auxiliary pixel. Starting from the auxiliary pixel, move outward along the vertical line and determine whether each pixel is white according to its RGB value. If it is white, increment the corresponding calibrated pixel by 1 until non-white pixels are determined at both ends of the vertical line starting from the auxiliary pixel.
[0055] Step S132: Determine whether the calibration pixel corresponding to the auxiliary pixel is 0. If yes, proceed to step S133; otherwise, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1.
[0056] Step S133: Determine whether the calibration pixel corresponding to the adjacent auxiliary pixel facing the center of the auxiliary cross line is 2. If yes, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Otherwise, determine that the auxiliary pixel is not within the diagonal exposure area.
[0057] Since the number of calibration pixels corresponding to the auxiliary pixel points gradually decreases as the auxiliary cross line extends outward from the center of the auxiliary cross line towards the corresponding end of the diagonal, the direction of the center of the auxiliary cross line can be determined in step S133 based on the number of calibration pixels corresponding to each auxiliary pixel point.
[0058] Step S140: Determine the distance represented by each pixel based on the magnification of the eyepiece and objective lens; determine the length of the two diagonals based on the number of auxiliary pixels and the distance represented by each pixel; determine the area of the indentation based on the length of the two diagonals; determine the hardness of the object to be tested based on the area of the indentation.
[0059] As can be seen from the above embodiments, the present invention sets auxiliary cross lines on the eyepiece, such that the color of the auxiliary cross lines is different from the imaging color of the test object and the indentation, and makes the diagonal area of the indentation the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal of the indentation and are located at the center of the diagonal exposure area. In this way, the length of the two diagonals can be determined according to the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area and the distance represented by each pixel. Thus, the indentation area can be determined according to the length of the two diagonals, and the hardness of the test object can be determined according to the indentation area. The present invention does not rely on manual calibration of the boundary points of the indentation, and does not introduce human error. Furthermore, the indentation area recognition based on the image is achieved by counting the number of pixels of the auxiliary cross lines in the two diagonal directions within the exposure area. The method is simple, and the hardness of the test object can be determined according to the indentation area after the indentation area is identified. The hardness detection efficiency and accuracy are both high.
[0060] After step S110 and before step S120, the control method may further include: determining the clarity of the image captured by the camera, and adjusting the lifting of the lifting stage in the microhardness tester according to the clarity, so that the clarity of the image reaches a preset clarity.
[0061] The control method of the present invention may further include:
[0062] Step S150: Determine whether a hardness indenter wear detection signal has been received. If yes, proceed to step S160; otherwise, end the measurement process.
[0063] Step S160: Determine the second test force loading parameters based on the relationship diagram of hardness, test force loading parameters and indentation area stored locally. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameters.
[0064] Step S170: According to the second test force loading parameters, perform a second test force loading on the test object according to steps S110 to S140 to obtain the indentation area for the second time.
[0065] Step S180: Determine whether the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the second test force loading parameters. If so, determine that the hardness indenter is not worn; otherwise, determine that the hardness indenter is worn.
[0066] Step S160 may include:
[0067] Step S161: Take the hardness obtained from the first loading as the target hardness, and determine other hardnesses that are lower than the target hardness;
[0068] Step S162: For each test force loading parameter, find the indentation area corresponding to the target hardness and other hardness from the relationship graph, take the other hardness whose indentation area is closest to the indentation area corresponding to the target hardness as the comparison hardness, and calculate the absolute value of the difference between the indentation area corresponding to the target hardness and the comparison hardness.
[0069] Step S163: Compare the absolute values of the differences calculated for each test force loading parameter, select the absolute value of the largest difference, and use the test force loading parameter corresponding to the selected absolute value of the difference as the second test force loading parameter. This invention designs a method for selecting the second test force loading parameter that can improve the difference in indentation area between the hardness of the test object and other hardnesses under the second test force loading parameter, thereby ensuring the accuracy of wear detection by the hardness indenter.
[0070] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0071] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is defined solely by the appended claims.
Claims
1. An industrial automated quality inspection device based on image recognition, characterized in that, The system includes a microhardness tester and its control platform. The microhardness tester comprises a camera, eyepiece, objective lens, indenter, indenter rod, stage, and a reflector positioned between the eyepiece and objective lens. The eyepiece has auxiliary cross lines. The objective lens and indenter rod are mounted on a turntable, and the stage is positioned below the indenter and objective lens. The control platform is connected to the turntable drive mechanism, indenter rod, and camera of the microhardness tester. Upon receiving a hardness detection signal, the platform first controls the turntable drive mechanism to rotate the turntable, thus adjusting the hardness reading on the turntable. The indenter rotates to be directly above the object to be tested on the stage. Then, the indenter rod is controlled to move the hardness indenter downward, applying a set test force to the object to be tested, resulting in a square indentation on the object. The two diagonals of the indentation are the exposure areas. Subsequently, the turntable drive mechanism is controlled to rotate the turntable, so that the objective lens of the corresponding magnification on the turntable is positioned directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The color of the auxiliary cross line is different from the image color of the object to be tested and the indentation. After the camera captures an image including the indentation and auxiliary intersecting lines through the eyepiece, the control platform determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary intersecting lines, it counts the number of auxiliary pixels located within the diagonal exposure area along both diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of auxiliary pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation; and based on the area of the indentation, it determines the hardness of the object to be tested. The step of counting the number of auxiliary pixels located within the diagonal exposure area along both diagonal directions based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary cross line includes: Step S131: For each auxiliary pixel in the auxiliary cross line, determine a straight line that passes through the auxiliary pixel and is perpendicular to the diagonal of the auxiliary pixel. Starting from the auxiliary pixel, move outward along the vertical line and determine whether each pixel is white according to its RGB value. If it is white, increment the corresponding calibrated pixel by 1 until non-white pixels are determined at both ends of the vertical line starting from the auxiliary pixel. Step S132: Determine whether the calibration pixel corresponding to the auxiliary pixel is 0. If yes, proceed to step S133; otherwise, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Step S133: Determine whether the calibration pixel corresponding to the adjacent auxiliary pixel facing the center of the auxiliary cross line is 2. If yes, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Otherwise, determine that the auxiliary pixel is not within the diagonal exposure area.
2. The industrial automated quality inspection device based on image recognition according to claim 1, characterized in that, The control platform also determines whether the hardness of the object to be tested is within the preset hardness range. If it is, it means that the hardness of the object to be tested is qualified; otherwise, it means that the hardness of the object to be tested is unqualified.
3. The industrial automated quality inspection device based on image recognition according to claim 1, characterized in that, The platform is a lifting platform, and the control platform is connected to the lifting platform. After controlling the turntable drive mechanism to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation, the platform determines the clarity of the image captured by the camera, and adjusts the lifting of the platform according to the clarity so that the image clarity reaches the preset clarity.
4. The industrial automated quality inspection device based on image recognition according to claim 1, characterized in that, The control platform stores a relationship graph between hardness, test force loading parameters and indentation area locally. After receiving the wear detection signal of the hardness indenter and determining the hardness of the test object based on the area of the indentation, the control platform determines the second test force loading parameters based on the relationship graph. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameters. The control platform controls the turntable drive mechanism to rotate the turntable according to the second test force loading parameters, so that the hardness indenter on the turntable rotates to be directly above the test object on the stage. Then, the indenter rod is controlled to move the hardness indenter downward, loading the set test force onto the test object, so that a square indentation is generated on the test object, and the two diagonals of the indentation are the exposure area. After that, the turntable drive mechanism is controlled to rotate the turntable so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. After the camera captures an image including the indentation and auxiliary intersecting lines through the eyepiece, the control platform determines the auxiliary intersecting lines based on the RGB values of each pixel in the image; based on the RGB values of the pixels surrounding each pixel in the auxiliary intersecting lines, it counts the number of pixels of the auxiliary intersecting lines located within the two diagonal exposure areas along the two diagonal directions; based on the magnification of the eyepiece and objective lens, it determines the distance represented by each pixel; based on the counted number of pixels and the distance represented by each pixel, it determines the length of the two diagonals; based on the length of the two diagonals, it determines the area of the indentation, thus obtaining the indentation area for the second time. Determine whether the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the force loading parameters of the second test. If so, it is determined that the hardness indenter is not worn; otherwise, it is determined that the hardness indenter is worn.
5. The industrial automated quality inspection device based on image recognition according to claim 1, characterized in that, The hardness indenter is a regular square pyramid indenter, which creates a square indentation on the test object, with the two diagonals of the indentation serving as the exposure area.
6. A control method for an industrial automated quality inspection device based on image recognition as described in any one of claims 1 to 5, characterized in that, The control platform performs the following steps: Step S110: After receiving the hardness detection signal, firstly, control the turntable drive mechanism in the microhardness tester to drive the turntable to rotate, so that the hardness indenter on the turntable rotates to be directly above the test object on the stage. Then, control the indenter rod to drive the hardness indenter to move down, applying the set test force to the test object, so that a square indentation is generated on the test object, and the two diagonals of the indentation are the exposure area. Control the turntable drive mechanism to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed directly above the indentation. At this time, the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area. The color of the auxiliary cross line is different from the imaging color of the test object and the indentation. Step S120: After the camera captures an image of the indentation and the auxiliary cross line in the eyepiece, the auxiliary cross line is determined based on the RGB values of each pixel in the image. Step S130: Based on the RGB values of the pixels surrounding each auxiliary pixel in the auxiliary cross line, count the number of auxiliary pixels of the auxiliary cross line located in the diagonal exposure area along the two diagonal directions. Step S140: Determine the distance represented by each pixel based on the magnification of the eyepiece and objective lens; determine the length of the two diagonals based on the count of auxiliary pixels and the distance represented by each pixel. Determine the area of the indentation based on the lengths of the two diagonals; The hardness of the test object is determined based on the area of the indentation. Step S130 includes: Step S131: For each auxiliary pixel in the auxiliary cross line, determine a straight line that passes through the auxiliary pixel and is perpendicular to the diagonal of the auxiliary pixel. Starting from the auxiliary pixel, move outward along the vertical line and determine whether each pixel is white according to its RGB value. If it is white, increment the corresponding calibrated pixel by 1 until non-white pixels are determined at both ends of the vertical line starting from the auxiliary pixel. Step S132: Determine whether the calibration pixel corresponding to the auxiliary pixel is 0. If yes, proceed to step S133; otherwise, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Step S133: Determine whether the calibration pixel corresponding to the adjacent auxiliary pixel facing the center of the auxiliary cross line is 2. If yes, increment the number of auxiliary pixels in the diagonal direction within the diagonal exposure area by 1. Otherwise, determine that the auxiliary pixel is not within the diagonal exposure area.
7. The control method according to claim 6, characterized in that, After step S110 and before step S120, the method further includes: determining the clarity of the image captured by the camera, and adjusting the lifting of the lifting stage in the microhardness tester according to the clarity, so that the clarity of the image reaches a preset clarity.
8. The control method according to claim 6, characterized in that, Also includes: Step S150: Determine whether a hardness indenter wear detection signal has been received. If yes, proceed to step S160; otherwise, end the measurement process. Step S160: Determine the second test force loading parameters based on the relationship diagram of hardness, test force loading parameters and indentation area stored locally. The indentation area corresponding to the hardness obtained in the first loading under the second test force loading parameters is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameters. Step S170: According to the second test force loading parameters, perform a second test force loading on the test object according to steps S110 to S140 to obtain the indentation area for the second time. Step S180: Determine whether the indentation area obtained in the second test is equal to the indentation area obtained in the first test under the second test force loading parameters. If so, determine that the hardness indenter is not worn; otherwise, determine that the hardness indenter is worn.
9. The control method according to claim 8, characterized in that, Step S160 includes: Step S161: Take the hardness obtained from the first loading as the target hardness, and determine other hardnesses that are lower than the target hardness; Step S162: For each test force loading parameter, find the indentation area corresponding to the target hardness and other hardness from the relationship graph, take the other hardness whose indentation area is closest to the indentation area corresponding to the target hardness as the comparison hardness, and calculate the absolute value of the difference between the indentation area corresponding to the target hardness and the comparison hardness. Step S163: Compare the absolute values of the differences calculated for each test force loading parameter, select the absolute value of the largest difference, and use the test force loading parameter corresponding to the selected absolute value of the difference as the second test force loading parameter.
Citation Information
Patent Citations
Online detection method for opening width of cellulose acetate tow
CN116777979A
Reading microscope for field hardness indentation size measurement
CN210072182U
Indentation type hardness meter
JP2004271352A