Industrial automatic quality inspection device based on image recognition and control method
By using image recognition technology and auxiliary crossing lines in the hardness meter, the indentation area is automatically calculated, and the problems of manual error and low detection efficiency in hardness measurement are solved, and the hardness detection is achieved with high accuracy and high efficiency, and the hardness pressure is detected. Head wear.
Patent Information
- Application Number
- CN202411400165.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The existing hardness meter has problems such as large artificial error and low detection accuracy when measuring hardness. The image recognition method is complex and low efficiency. Especially when the base plate and indentation color are the same, it is difficult to distinguish the indentation area, resulting in detection. Low accuracy.
An industrial automation quality inspection device based on image recognition is designed. The camera and auxiliary cross-line are used to collect indentation images on the objective lens, and the indentation area is calculated by RGB value and the number of pixel points in the exposure area, the hardness of the object to be measured is determined, and the The lifting stage adjusts the image clarity to achieve automated hardness measurement.
It improves the accuracy and efficiency of hardness detection, reduces manual errors, accurately identify the indentation area, ensures high efficiency and accuracy of hardness measurement, and can detect wear of hardness indenter heads.
Smart Images

Figure CN119269232A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of industrial automation, and in particular relates to an industrial automation quality inspection device and a control method based on image recognition. Background Art
[0002] A hardness tester is a hardness testing instrument. Metal hardness is used to indicate the ability of a material to resist a hard object from pressing into its surface. It is one of the important performance indicators of metal materials. The existing hardness tester needs to manually operate the corresponding control button when measuring hardness. First, the hardness indenter is used to apply a test force to the object to be tested, so that an indentation is generated on the object to be tested. After that, the objective lens is placed directly above the indentation of the object to be tested, and the hardness of the object to be tested is determined according to the indentation of the object to be tested. There are currently two ways to determine the hardness of the object to be tested. One is to manually observe the indentation boundary point, manually move the boundary calibration line, calibrate the boundary of the indentation, and determine the hardness of the object to be tested according to the calibrated boundary. This method causes large manual errors and low detection accuracy. The other is an image recognition method, which is to collect indentation images, train the indentation images, etc. to obtain the indentation area, and then determine the hardness of the object to be tested according to the indentation area. This method requires the collection of a large number of indentation images, the method is relatively complex, and the detection efficiency is low. When the imaging color of the base plate of the object to be tested is the same as the indentation color, both are black, it is difficult to distinguish the indentation area from the base plate area, resulting in low detection accuracy. Summary of the invention
[0003] The present invention provides an industrial automation quality inspection device and a control method based on image recognition, so as to solve the problem that in the current hardness measurement process, the indentation boundary is manually calibrated, the detection accuracy is low when determining the hardness, and the indentation area is determined by image recognition, so the method for determining the hardness is complicated, and the detection efficiency and accuracy are low.
[0004] According to a first aspect of the present invention, there is provided an industrial automation quality inspection device based on image recognition, comprising a microhardness tester and a control platform thereof, wherein the microhardness tester comprises a camera, an eyepiece, an objective lens, a hardness indenter, an indenter rod, a stage and a reflector arranged between the eyepiece and the objective lens, the eyepiece is provided with an auxiliary cross line, the objective lens and the indenter rod are arranged on a turntable, the stage is arranged below the hardness indenter and the objective lens, the control platform is respectively connected to the turntable drive mechanism, the indenter rod and the camera of the microhardness tester, and after receiving a hardness detection signal, firstly controls the turntable drive mechanism to drive the hardness tester to move ... The turntable is driven to rotate so that the hardness indenter on the turntable rotates to the top of the object to be tested on the stage, and then the indenter rod is controlled to drive the hardness indenter to move downward, and a set test force is applied to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; thereafter, the turntable driving mechanism is controlled to drive the turntable to rotate so that the objective lens of the corresponding magnification on the turntable is placed just above the indentation, and at this time, the auxiliary cross line overlaps with the diagonal line 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 color of the object to be tested and the indentation imaging;
[0005] After the camera captures the image including the indentation and the auxiliary cross line in the eyepiece, the control platform determines the auxiliary cross line according to the RGB value of each pixel in the image; counts the number of auxiliary pixel points of the auxiliary cross line located in the diagonal exposure area along two diagonal directions according to the RGB values of the pixel points around each auxiliary pixel point in the auxiliary cross line; determines the distance represented by each pixel point according to the magnification of the eyepiece and the objective lens; determines the length of the two diagonals according to the counted number of auxiliary pixel points and the distance represented by each pixel point; determines the area of the indentation according to the length of the two diagonals; and determines the hardness of the object to be tested according to the area of the indentation.
[0006] In an optional implementation, the control platform further determines whether the hardness of the object to be tested is within a preset hardness range. If so, it indicates that the hardness of the object to be tested is qualified; otherwise, it indicates that the hardness of the object to be tested is unqualified.
[0007] In another optional 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 an objective lens of corresponding magnification on the turntable is placed directly above the indentation, the clarity of the image captured by the camera is determined, and the lifting and lowering of the lifting stage is adjusted according to the clarity so that the clarity of the image reaches a preset clarity.
[0008] In another optional implementation, the control platform locally stores a relationship diagram between hardness, test force loading parameters and indentation area. After the control platform receives a hardness indenter wear detection signal and determines the hardness of the object to be tested based on the area of the indentation, it determines the second test force loading parameters based on the relationship diagram, wherein the indentation area corresponding to the hardness obtained by 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 driving mechanism to drive the turntable to rotate according to the second test force loading parameter, so that the hardness indenter on the turntable rotates to the top of the object to be tested on the stage, and then controls the indenter rod to drive the hardness indenter to move downward, loads the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; thereafter, the turntable driving mechanism is controlled to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed above the indentation, and 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 the image including the indentation and the auxiliary cross line in the eyepiece, the control platform determines the auxiliary cross line according to the RGB value of each pixel in the image; according to the RGB values of the pixels around each pixel in the auxiliary cross line, the number of pixels of the auxiliary cross line located in the two diagonal exposure areas along the two diagonal directions is counted respectively; according to the magnifications of the eyepiece and the objective lens, the distance represented by each pixel is determined; according to the counted number of pixels and the distance represented by each pixel, the length of the two diagonals is determined; according to the length of the two diagonals, the area of the indentation is determined, and the indentation area is obtained for the second time;
[0011] It is determined whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for 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.
[0012] In another optional implementation, the hardness indenter is a regular quadrangular pyramid indenter, so as to produce a square indentation on the object to be tested, and two diagonal lines of the indentation are exposure areas.
[0013] According to a second aspect of the present invention, a control method for the industrial automation quality inspection device based on image recognition is provided, comprising a control platform executing the following steps:
[0014] Step S110, after receiving the hardness detection signal, first control the turntable driving mechanism in the microhardness tester to drive the turntable to rotate, so that the hardness indenter on the turntable rotates to just above the object to be tested on the stage, then control the indenter rod to drive the hardness indenter to move downward, load the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; control the turntable driving mechanism to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed just above the indentation, at this time, the auxiliary cross line overlaps with the diagonal line 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 object to be tested and the indentation;
[0015] Step S120, after the camera captures an image including the indentation and the auxiliary cross line in the eyepiece, the auxiliary cross line is determined according to the RGB value of each pixel in the image;
[0016] Step S130, counting the number of auxiliary pixel points of the auxiliary cross lines located in the diagonal exposure area along two diagonal directions according to the RGB values of the pixel points surrounding each auxiliary pixel point in the auxiliary cross line;
[0017] Step S140, determine the distance represented by each pixel according to the magnification of the eyepiece and the objective lens; determine the length of the two diagonals according to the counted number of auxiliary pixels and the distance represented by each pixel; determine the area of the indentation according to the length of the two diagonals; determine the hardness of the object to be tested according to the area of the indentation.
[0018] In an optional implementation, step S130 includes:
[0019] Step S131: for each auxiliary pixel point in the auxiliary intersection line, determine a straight line passing through the auxiliary pixel point and perpendicular to the diagonal line where the auxiliary pixel point is located, and start from the auxiliary pixel point and go outward along the vertical straight line respectively, and judge whether each pixel point is white according to the RGB value of each pixel point in turn. If so, add 1 to the calibration pixel point corresponding to the auxiliary pixel point, until non-white pixels are determined at both ends of the vertical straight line starting from the auxiliary pixel point and going outward respectively;
[0020] Step S132, determining whether the calibration pixel corresponding to the auxiliary pixel is 0, if so, executing step S133; otherwise, adding 1 to the number of auxiliary pixels in the diagonal exposure area in the diagonal direction;
[0021] Step S133, determine whether the calibration pixel point corresponding to the adjacent auxiliary pixel point of the auxiliary pixel point toward the center of the auxiliary intersection line is 2. If so, add 1 to the number of auxiliary pixel points in the diagonal direction in the diagonal exposure area. Otherwise, determine that the auxiliary pixel point is not in the diagonal exposure area.
[0022] In another optional implementation, after step S110 and before step S120, it also 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.
[0023] In another optional implementation, the method further includes:
[0024] Step S150, determining whether a hardness indenter wear detection signal is received, if so, executing step S160, otherwise, ending this measurement process;
[0025] Step S160, determining the second test force loading parameter according to the relationship diagram between the hardness, test force loading parameter and indentation area stored locally, wherein the indentation area corresponding to the hardness obtained by the first loading under the second test force loading parameter is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameter;
[0026] Step S170, performing a second test force loading on the object to be tested according to the second test force loading parameters and steps S110 to S140 to obtain an indentation area for a second time;
[0027] Step S180, determine whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for the first time 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 optional implementation, step S160 includes:
[0029] Step S161, taking the hardness obtained by the first loading as the target hardness, and determining other hardnesses with lower hardness than the target hardness;
[0030] Step S162, for each test force loading parameter, find out the target hardness and the indentation area corresponding to the other hardness from the relationship diagram, 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, comparing the absolute values of the differences calculated for each test force loading parameter, selecting the absolute value of the difference with the largest value, and using 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 the present invention are:
[0033] 1. The present invention sets auxiliary cross lines on the eyepiece, so that the color of the auxiliary cross lines is different from the imaging color of the object to be tested and the indentation, and the diagonal area of the indentation is the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal lines of the indentation and are located at the center of the diagonal exposure area. In this way, the lengths of the two diagonals can be determined according to the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions and the distance represented by each pixel, so as to determine the indentation area according to the lengths of the two diagonals, and determine the hardness of the object to be tested according to the indentation area; the present invention does not need to rely on manual calibration of the boundary points of the indentation, and will not introduce manual errors. In addition, when the indentation area is identified based on the image, it is achieved by counting the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions. The method is simple, and after the indentation area is identified, the hardness of the object to be tested is determined according to the indentation area. The hardness detection efficiency and accuracy are both high.
[0034] 2. The present invention uses a lifting platform as the loading platform, and connects the control platform to the lifting platform. The lifting platform is lifted and lowered according to the clarity of the image captured by the camera. In this way, a clear imaging image can be automatically captured, and the hardness of the object to be measured can be determined based on the clear imaging image, which can further ensure the accuracy of the hardness measurement.
[0035] 3. When detecting whether the hardness indenter is worn, the present invention first selects the second test force loading parameter, so that the object to be tested is loaded with two different test forces, and the indentation area when the two test forces are loaded is determined respectively. If the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for the first time under the second test force loading parameter, 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 is only slightly worn, the wear detection method of the present invention can detect it, and the detection accuracy is relatively high. After accurately eliminating the wear of the hardness indenter, the indentation area based on image recognition is more accurate, 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 object to be tested and other hardness under the second test force loading parameters, thereby ensuring the wear detection accuracy of the hardness indenter. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1It is a schematic diagram of the structure of an embodiment of an industrial automation quality inspection device based on image recognition of the present invention;
[0038] Figure 2 is an imaged image including indentations and auxiliary cross lines;
[0039] Figure 3 It is a flow chart of an embodiment of a control method of an industrial automation quality inspection device based on image recognition of the present invention. DETAILED DESCRIPTION
[0040] In order 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 purposes, features and advantages of the embodiments of the present invention more obvious and understandable, the technical solutions in the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings.
[0041] In the description of the present invention, unless otherwise specified and limited, it should be noted that the term "connection" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two elements. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.
[0042] See also Figure 1 , which is a schematic diagram of the structure of an embodiment of an industrial automation quality inspection device based on image recognition of the present invention. The device may include a microhardness tester 1 and a control platform 2 thereof. 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 is provided with an auxiliary cross line. 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 may be connected to a turntable drive mechanism 19, an indenter rod 15, and a camera 11 of the microhardness tester 1, respectively. After receiving a hardness detection signal, the control platform 2 first controls the turntable drive mechanism 19 to drive the turntable 18 to rotate so that the hardness on the turntable 18 is The hardness indenter 14 is rotated to the position just above the object to be tested on the stage 16, and then the indenter rod 15 is controlled to drive the hardness indenter 14 to move downward, and a set test force is applied to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas (this can be achieved by increasing the magnification of the eyepiece and / or the objective lens, or other methods can be used to achieve exposure); thereafter, the turntable drive mechanism 19 is controlled to drive the turntable 18 to rotate, so that the objective lens 13 of the corresponding magnification on the turntable 18 is placed just above the indentation, and at this time, the auxiliary cross line overlaps with the diagonal line 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 object to be tested and the indentation; Figure 2As shown, the auxiliary cross lines can be red.
[0043] After the camera captures the image of the indentation and the auxiliary cross lines in the eyepiece, the control platform 2 determines the auxiliary cross lines according to the RGB values of each pixel in the image; according to the RGB values of the pixels around each auxiliary pixel in the auxiliary cross lines, the number of auxiliary pixel points of the auxiliary cross lines located in the diagonal exposure area along the two diagonal directions is counted respectively; according to the magnifications of the eyepiece and the objective lens, the distance represented by each pixel point is determined; according to the counted number of auxiliary pixel points and the distance represented by each pixel point, the length of the two diagonals is determined; according to the lengths of the two diagonals, the area of the indentation is determined; and the hardness of the object to be tested is determined according to the area of the indentation.
[0044] In the present embodiment, the indentation is non-white except the exposure area, and the exposure area is white. The other areas except the indentation in the image collected by the camera can be black, white or other colors different from the auxiliary cross line color. The control platform can also determine whether the hardness of the object to be tested is within the preset hardness range. If so, 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. In addition, the stage 16 can be a lifting stage, and the control platform 2 is connected to the lifting stage. It controls the turntable drive mechanism 19 to drive the turntable 18 to rotate, so that the object lens of the corresponding multiple on the turntable 18 is placed directly above the indentation, and the clarity of the image collected by the camera is determined, and the lifting of the lifting stage is adjusted according to the clarity, so that the clarity of the image reaches the preset clarity. Wherein the determination of image clarity can adopt algorithms such as Tenengrad gradient method, Laplacian gradient method and variance method. The present invention makes the loading platform a lifting loading platform, and connects the control platform to the lifting loading platform. The lifting and lowering of the lifting loading platform is controlled according to the clarity of the image captured by the camera. In this way, a clear imaging image can be automatically captured, and the hardness of the object to be measured is determined based on the clear imaging image, which can further ensure the accuracy of the hardness measurement.
[0045] In addition, the wear of the hardness indenter will also affect the accuracy of hardness measurement. When the hardness indenter is worn, the identified indentation area will be reduced, and the measured hardness will increase accordingly. Therefore, it is necessary to regularly detect whether the hardness indenter is worn. However, when the hardness indenter is slightly worn, it is difficult to detect with the existing detection method. To this end, the control platform of the present invention can locally store a relationship diagram between hardness, test force loading parameters and indentation area. After the control platform receives the hardness indenter wear detection signal and determines the hardness of the object to be tested based on the area of the indentation, the second test force loading parameters can be determined based on the relationship diagram, wherein the indentation area corresponding to the hardness obtained by 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.
[0046] The control platform controls the turntable driving mechanism to drive the turntable to rotate according to the second test force loading parameter, so that the hardness indenter on the turntable rotates to just above the object to be tested on the stage, and then controls the indenter rod to drive the hardness indenter to move downward, loads the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; thereafter, the turntable driving mechanism is controlled to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed just above the indentation, at which time the auxiliary cross line overlaps with the diagonal of the indentation and is located at the center of the diagonal exposure area; when the camera captures After the eyepiece includes the image of the indentation and the auxiliary cross line, the control platform determines the auxiliary cross line according to the RGB value of each pixel in the image; according to the RGB values of the pixels around each pixel in the auxiliary cross line, the number of pixels of the auxiliary cross line located in the two diagonal exposure areas along the two diagonal directions is counted respectively; according to the magnifications of the eyepiece and the objective lens, the distance represented by each pixel is determined; according to the counted number of pixels and the distance represented by each pixel, the length of the two diagonals is determined; according to the length of the two diagonals, the area of the indentation is determined, and the indentation area is obtained for the second time.
[0047] The control platform determines whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained by 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. When detecting whether the hardness indenter is worn, the present invention first selects the second test force loading parameters so that the object to be tested is loaded with two different test forces, and the indentation areas when the two test forces are loaded are determined respectively. If the indentation area obtained for the second time is equal to the indentation area of the hardness obtained by 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 is only slightly worn, the wear detection method of the present invention can detect it, and the detection accuracy is relatively high. After accurately eliminating the wear of the hardness indenter, the indentation area based on image recognition is more accurate, thereby further ensuring the accuracy of hardness detection.
[0048] The hardness indenter 14 may be a regular tetrahedral indenter, so as to produce a square indentation on the object to be tested, and the two diagonal lines of the indentation are exposure areas. The microhardness tester may be a Vickers hardness tester.
[0049] As can be seen from the above embodiments, the present invention arranges auxiliary cross lines on the eyepiece, so that the color of the auxiliary cross lines is different from the imaging color of the object to be measured and the indentation, and the diagonal area of the indentation is the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal lines of the indentation and are located at the center of the diagonal exposure area. In this way, the lengths of the two diagonals can be determined according to the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions and the distance represented by each pixel, so as to determine the lengths of the two diagonals, and thus determine the indentation area according to the lengths of the two diagonals, and determine the hardness of the object to be measured according to the indentation area. The present invention does not need to rely on manual calibration of the boundary points of the indentation, and will not introduce manual errors. In addition, when the indentation area is identified based on the image, it is achieved by counting the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions. The method is simple, and after the indentation area is identified, the hardness of the object to be measured is determined according to the indentation area. The hardness detection efficiency and accuracy are both high.
[0050] See also Figure 3 , is a flow chart of an embodiment of a control method of an industrial automation quality inspection device based on image recognition according to the present invention. The control method may include the control platform 2 executing the following steps:
[0051] Step S110, after receiving the hardness detection signal, first 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 just above the object to be tested on the stage 16, and then control the indenter rod 15 to drive the hardness indenter 14 to move downward, load the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; 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 just above the indentation, at this time, the auxiliary cross line overlaps with the diagonal line 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 line); the color of the auxiliary cross line is different from the imaging color of the object to be tested and the indentation.
[0052] Step S120: After the camera captures the image including the indentation and the auxiliary cross line in the eyepiece, the auxiliary cross line is determined according to the RGB value of each pixel in the image.
[0053] Step S130: according to the RGB values of the pixels around each auxiliary pixel in the auxiliary cross line, respectively count the number of auxiliary pixel points of the auxiliary cross line located in the diagonal exposure area along two diagonal directions. The step S130 may include:
[0054] Step S131: for each auxiliary pixel point in the auxiliary intersection line, determine a straight line passing through the auxiliary pixel point and perpendicular to the diagonal line where the auxiliary pixel point is located, and start from the auxiliary pixel point and go outward along the vertical straight line respectively, and judge whether each pixel point is white according to the RGB value of each pixel point in turn. If so, add 1 to the calibration pixel point corresponding to the auxiliary pixel point, until non-white pixels are determined at both ends of the vertical straight line starting from the auxiliary pixel point and going outward respectively;
[0055] Step S132, determining whether the calibration pixel corresponding to the auxiliary pixel is 0, if so, executing step S133; otherwise, adding 1 to the number of auxiliary pixels in the diagonal exposure area in the diagonal direction;
[0056] Step S133, determine whether the calibration pixel point corresponding to the adjacent auxiliary pixel point of the auxiliary pixel point toward the center of the auxiliary intersection line is 2. If so, add 1 to the number of auxiliary pixel points in the diagonal direction in the diagonal exposure area. Otherwise, determine that the auxiliary pixel point is not in the diagonal exposure area.
[0057] Since the number of calibration pixels corresponding to the auxiliary pixel points gradually decreases as the auxiliary cross line center extends outward toward the corresponding end of the diagonal line, the direction of the auxiliary cross line center can be determined according to the number of calibration pixels corresponding to each auxiliary pixel point in step S133.
[0058] Step S140, determine the distance represented by each pixel according to the magnification of the eyepiece and the objective lens; determine the length of the two diagonals according to the counted number of auxiliary pixels and the distance represented by each pixel; determine the area of the indentation according to the length of the two diagonals; determine the hardness of the object to be tested according to the area of the indentation.
[0059] As can be seen from the above embodiments, the present invention arranges auxiliary cross lines on the eyepiece, so that the color of the auxiliary cross lines is different from the imaging color of the object to be measured and the indentation, and the diagonal area of the indentation is the exposure area. When the objective lens is placed directly above the indentation, the auxiliary cross lines overlap with the diagonal lines of the indentation and are located at the center of the diagonal exposure area. In this way, the lengths of the two diagonals can be determined according to the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions and the distance represented by each pixel, so as to determine the lengths of the two diagonals, and thus determine the indentation area according to the lengths of the two diagonals, and determine the hardness of the object to be measured according to the indentation area. The present invention does not need to rely on manual calibration of the boundary points of the indentation, and will not introduce manual errors. In addition, when the indentation area is identified based on the image, it is achieved by counting the number of pixels of the auxiliary cross lines in the exposure area in the two diagonal directions. The method is simple, and after the indentation area is identified, the hardness of the object to be measured is determined according to the indentation area. 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, determining whether a hardness indenter wear detection signal is received, if so, executing step S160, otherwise, ending this measurement process;
[0063] Step S160, determining the second test force loading parameter according to the relationship diagram between the hardness, test force loading parameter and indentation area stored locally, wherein the indentation area corresponding to the hardness obtained by the first loading under the second test force loading parameter is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameter;
[0064] Step S170, performing a second test force loading on the object to be tested according to the second test force loading parameters and steps S110 to S140 to obtain an indentation area for a second time;
[0065] Step S180, determine whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for the first time 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] The step S160 may include:
[0067] Step S161, taking the hardness obtained by the first loading as the target hardness, and determining other hardnesses with lower hardness than the target hardness;
[0068] Step S162, for each test force loading parameter, find out the target hardness and the indentation area corresponding to the other hardness from the relationship diagram, 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 difference with the largest value, and use the test force loading parameter corresponding to the selected absolute value of the difference as the second test force loading parameter. The present invention designs a method for selecting the second test force loading parameter, which can improve the difference in the indentation area between the hardness of the object to be tested and other hardness under the second test force loading parameter, thereby ensuring the wear detection accuracy of the hardness indenter.
[0070] Those skilled in the art will readily appreciate other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptations of the present invention that follow the general principles of the present invention and include common knowledge or customary techniques in the art that are not disclosed by the present invention. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present invention are indicated by the following claims.
[0071] It will be appreciated that the invention is not limited to the precise construction that has been described above and shown in the drawings and that various modifications and changes may be made without departing from its scope. The scope of the invention is governed solely by the appended claims.
Claims
1. An industrial automation quality inspection device based on image recognition, characterized in that: The invention comprises a microhardness tester and a control platform thereof. The microhardness tester comprises a camera, an eyepiece, an objective lens, a hardness indenter, an indenter rod, a stage and a reflector arranged between the eyepiece and the objective lens. The eyepiece is provided with an auxiliary cross line. The objective lens and the indenter rod are arranged on a turntable. The stage is arranged below the hardness indenter and the objective lens. The control platform is respectively connected with a turntable driving mechanism, an indenter rod and a camera of the microhardness tester. After receiving a hardness detection signal, the control platform first controls the turntable driving mechanism to drive the turntable to rotate so that the hardness on the turntable is The indenter is rotated to the top of the object to be tested on the stage, and then the indenter rod is controlled to drive the hardness indenter to move downward, and a set test force is applied to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; thereafter, the turntable driving mechanism is controlled to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed just above the indentation, and at this time, the auxiliary cross line overlaps with the diagonal line 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 color of the object to be tested and the indentation imaging; After the camera captures the image including the indentation and the auxiliary cross line in the eyepiece, the control platform determines the auxiliary cross line according to the RGB value of each pixel in the image; counts the number of auxiliary pixel points of the auxiliary cross line located in the diagonal exposure area along two diagonal directions according to the RGB values of the pixel points around each auxiliary pixel point in the auxiliary cross line; determines the distance represented by each pixel point according to the magnification of the eyepiece and the objective lens; determines the length of the two diagonals according to the counted number of auxiliary pixel points and the distance represented by each pixel point; determines the area of the indentation according to the length of the two diagonals; and determines the hardness of the object to be tested according to the area of the indentation.
2. The industrial automation quality inspection device based on image recognition according to claim 1 is characterized in that: The control platform also determines whether the hardness of the object to be tested is within a preset hardness range. If so, it indicates that the hardness of the object to be tested is qualified; otherwise, it indicates that the hardness of the object to be tested is unqualified.
3. The industrial automation quality inspection device based on image recognition according to claim 1, characterized in that: The loading platform is a lifting loading platform, and the control platform is connected to the lifting loading platform. After controlling the turntable driving mechanism to drive the turntable to rotate so that the objective lens of corresponding magnification on the turntable is placed directly above the indentation, the clarity of the image captured by the camera is determined, and the lifting and lowering of the lifting loading platform is adjusted according to the clarity so that the clarity of the image reaches a preset clarity.
4. The industrial automation quality inspection device based on image recognition according to claim 1, characterized in that: The control platform locally stores a relationship diagram between hardness, test force loading parameters and indentation area. After receiving a hardness indenter wear detection signal and determining the hardness of the object to be tested according to the area of the indentation, the control platform determines the second test force loading parameters according to the relationship diagram, wherein the indentation area corresponding to the hardness obtained by 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 driving mechanism to drive the turntable to rotate according to the second test force loading parameter, so that the hardness indenter on the turntable rotates to the top of the object to be tested on the stage, and then controls the indenter rod to drive the hardness indenter to move downward, loads the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; thereafter, the turntable driving mechanism is controlled to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed above the indentation, and 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 the image including the indentation and the auxiliary cross line in the eyepiece, the control platform determines the auxiliary cross line according to the RGB value of each pixel in the image; according to the RGB values of the pixels around each pixel in the auxiliary cross line, the number of pixels of the auxiliary cross line located in the two diagonal exposure areas along the two diagonal directions is counted respectively; according to the magnifications of the eyepiece and the objective lens, the distance represented by each pixel is determined; according to the counted number of pixels and the distance represented by each pixel, the length of the two diagonals is determined; according to the length of the two diagonals, the area of the indentation is determined, and the indentation area is obtained for the second time; It is determined whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for 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.
5. The industrial automation quality inspection device based on image recognition according to claim 1, characterized in that: The hardness indenter is a regular quadrangular pyramid indenter, so as to produce a square indentation on the object to be tested, and the two diagonal lines of the indentation are exposure areas.
6. A control method for an industrial automation quality inspection device based on image recognition according to 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, first control the turntable driving mechanism in the microhardness tester to drive the turntable to rotate, so that the hardness indenter on the turntable rotates to just above the object to be tested on the stage, then control the indenter rod to drive the hardness indenter to move downward, load the set test force to the object to be tested, so that a square indentation is generated on the object to be tested, and the two diagonals of the indentation are exposure areas; control the turntable driving mechanism to drive the turntable to rotate, so that the objective lens of the corresponding magnification on the turntable is placed just above the indentation, at this time, the auxiliary cross line overlaps with the diagonal line 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 object to be tested and the indentation; Step S120, after the camera captures an image including the indentation and the auxiliary cross line in the eyepiece, the auxiliary cross line is determined according to the RGB value of each pixel in the image; Step S130, counting the number of auxiliary pixel points of the auxiliary cross lines located in the diagonal exposure area along two diagonal directions according to the RGB values of the pixel points surrounding each auxiliary pixel point in the auxiliary cross line; Step S140, determine the distance represented by each pixel according to the magnification of the eyepiece and the objective lens; determine the length of the two diagonals according to the counted number of auxiliary pixels and the distance represented by each pixel; determine the area of the indentation according to the length of the two diagonals; determine the hardness of the object to be tested according to the area of the indentation.
7. The control method according to claim 6, characterized in that: The step S130 includes: Step S131: for each auxiliary pixel point in the auxiliary intersection line, determine a straight line passing through the auxiliary pixel point and perpendicular to the diagonal line where the auxiliary pixel point is located, and start from the auxiliary pixel point and go outward along the vertical straight line respectively, and judge whether each pixel point is white according to the RGB value of each pixel point in turn. If so, add 1 to the calibration pixel point corresponding to the auxiliary pixel point, until non-white pixels are determined at both ends of the vertical straight line starting from the auxiliary pixel point and going outward respectively; Step S132, determining whether the calibration pixel corresponding to the auxiliary pixel is 0, if so, executing step S133; otherwise, adding 1 to the number of auxiliary pixels in the diagonal exposure area in the diagonal direction; Step S133, determine whether the calibration pixel point corresponding to the adjacent auxiliary pixel point of the auxiliary pixel point toward the center of the auxiliary intersection line is 2. If so, add 1 to the number of auxiliary pixel points in the diagonal direction in the diagonal exposure area. Otherwise, determine that the auxiliary pixel point is not in the diagonal exposure area.
8. 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.
9. The control method according to claim 6, characterized in that: Also includes: Step S150, determining whether a hardness indenter wear detection signal is received, if so, executing step S160, otherwise, ending this measurement process; Step S160, determining the second test force loading parameter according to the relationship diagram between the hardness, test force loading parameter and indentation area stored locally, wherein the indentation area corresponding to the hardness obtained by the first loading under the second test force loading parameter is not equal to the indentation area corresponding to other hardnesses with lower hardness under the second test force loading parameter; Step S170, performing a second test force loading on the object to be tested according to the second test force loading parameters and steps S110 to S140 to obtain an indentation area for a second time; Step S180, determine whether the indentation area obtained for the second time is equal to the indentation area of the hardness obtained for the first time 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.
10. The control method according to claim 9, characterized in that: The step S160 includes: Step S161, taking the hardness obtained by the first loading as the target hardness, and determining other hardnesses with lower hardness than the target hardness; Step S162, for each test force loading parameter, find out the target hardness and the indentation area corresponding to the other hardness from the relationship diagram, 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, comparing the absolute values of the differences calculated for each test force loading parameter, selecting the absolute value of the difference with the largest value, and using 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
Non-contact type strain measurement method based on visual discrimination
CN101196390A
Detection method and apparatus of air-conditioning product
CN105719301A
Measuring method of opening width of tow
CN109855543A
Fiber length measuring method based on automatic identification measuring scale
CN116503346A
Online detection method for opening width of cellulose acetate tow
CN116777979A