A monitoring method and system for the production of hardware parts

By blocking the screw surface image and determining the excellent value, the fuzzy entropy is used to characterize the complexity of the blur membership between different sub-image blocks in the image block, the problem of difficulty in accurately monitoring the screw surface defects in the prior art is solved, and efficient monitoring of the screw production process is achieved.

CN119941743BActive Publication Date: 2025-06-13东莞金源五金机械有限公司
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510437787.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-06-13
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

The prior art is difficult to accurately monitor the screw production process, especially when there are indentation defects on the surface of the screw.

Method used

By acquiring the screw surface image, performing chunking processing and determining the excellent degree of the sub-image block, the fuzzy entropy is used to characterize the complexity of the blur membership between different sub-image blocks in the image block, thereby realizing the monitoring of screw surface defects.

Benefits of technology

It effectively improves the accuracy of monitoring surface defects in the screw production process, and can better reflect the probability of the screw defects at the target image block.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119941743B_ABST
    Figure CN119941743B_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of production process monitoring, and in particular to a monitoring method and system for hardware production. The method includes: obtaining a surface image of a screw to be detected, and determining a target image block from the surface image; intercepting a plurality of sub-image blocks from the target image block, and determining the goodness value of the sub-image block according to the number of modes in the chain code sequence of the pixel points in the sub-image block; determining the similarity tolerance between two different sub-image blocks according to the sum value of the goodness values of the two different sub-image blocks in the target image block; using the similarity tolerance between different sub-image blocks to determine the fuzzy membership degree between different sub-image blocks, so as to obtain the fuzzy entropy of the target image block; and outputting a prompt message when the fuzzy entropy of the target image block is greater than a preset threshold. Through the above technical solution, the monitoring of the screws completed in production can be effectively realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of production process monitoring, and particularly to a monitoring method and system for hardware production. Background Art

[0002] A screw is a hardware fastener used to connect two or more objects. Screws are usually used in conjunction with nuts; a screw typically consists of a head, a threaded portion, and a shank. During the production process of screws, indentation defects may form on the surface of the screws.

[0003] The indentations present on the surface of the screws not only affect the appearance quality of the screws, but deeper indentations may also cause penetrating damage to the screws. For example, when there are indentations in the threaded portion of the screw, it will affect the fit between the screw and the nut, thereby reducing the fastening performance. Therefore, it is necessary to monitor the surface indentations of screws during the production stage.

[0004] In order to detect defects in threaded metal components and monitor the production process of threaded metal components, a method for detecting production defects of lead screw threads based on image processing is provided in the Chinese patent application document with the publication number CN116958136A, including: obtaining an inflection point sequence and an inflection point standard sequence according to a reference pixel point sequence; matching the inflection point sequence with the inflection point standard sequence to obtain the first inflection point offset degree; obtaining the second inflection point offset degree according to the number of inflection points where the inflection point sequence matches the inflection point standard sequence; obtaining the third inflection point offset degree according to the second inflection point offset degree; obtaining the position correlation degree according to the third inflection point offset degree; obtaining the defect confidence degree according to the position correlation degree; obtaining the optimal deviation parameter of each reference pixel point sequence under several deviation parameters according to the defect confidence degree; and obtaining several defect regions according to the optimal deviation parameter to complete the detection of production defects of lead screw threads.

[0005] The detection process of defects in the related art for threads is carried out according to the inflection point sequence of the reference pixel point sequence, and fails to combine the characteristics of threaded metal components. Therefore, it is difficult for the related art to accurately monitor the production process of screws. Summary of the Invention

[0006] To overcome the problem in the related art that it is difficult to accurately monitor the production process of screws, this application provides a monitoring method and system for hardware production.

[0007] According to the first aspect of the embodiments of the present application, a monitoring method for the production of hardware parts is provided, including: obtaining a surface image of a screw to be detected that has been produced, and performing block processing on the surface image to obtain a plurality of image blocks, so as to determine a target image block from the plurality of image blocks; intercepting a plurality of sub-image blocks with the same size from the target image block according to a preset sliding step length, and determining the goodness value of the sub-image blocks according to the number of modes in the chain code sequence of the pixel points in the sub-image blocks; the goodness value is used to characterize the straightness of the texture extension direction in the sub-image blocks; according to the sum value of the goodness values of two different sub-image blocks in the target image block, determining the similarity tolerance between the two different sub-image blocks; using the similarity tolerance between different sub-image blocks to determine the fuzzy membership degree between different sub-image blocks, so as to obtain the fuzzy entropy of the target image block; the fuzzy entropy is used to characterize the complexity of the fuzzy membership degree between different sub-image blocks in the image block; when the fuzzy entropy of the target image block is greater than a preset threshold, outputting a prompt message; the prompt message is used to prompt that there are defects in the corresponding part of the screw in the target image block.

[0008] In this way, obtain the surface image of the screw to be detected on the production line, perform block processing on the surface image to obtain a plurality of image blocks, and determine the goodness value of the sub-image blocks in the target image block. The goodness value is used to characterize the straightness of the texture extension direction in the sub-image blocks. Since the texture extension direction of the threaded part of the screw is straighter than that of the defective part, therefore, the fuzzy entropy obtained by using the sum value of the goodness values of two different sub-image blocks in the target image block can better characterize the probability that there are defects in the corresponding part of the screw in the target image block, thus effectively realizing the monitoring of the produced screws.

[0009] Optionally, the goodness value of the sub-image block is determined by the following method: , where is the goodness value of the sub-image block, norm is the normalization processing function; U is the number of modes in the chain code sequence of the pixel points in the sub-image block; D is the gray diversity value of the sub-image block, which is used to characterize the diversity of the gray values of the pixel points in the sub-image block; is the maximum value of the included angle between the gradient direction of the pixel points in the sub-image block and the horizontal direction, is the minimum value of the included angle between the gradient direction of the pixel points in the sub-image block and the horizontal direction.

[0010] In this way, the goodness value of the sub-image block can be obtained according to the pixel characteristics of the sub-image block itself and the characteristic that the texture extension directions of the non-defective threaded parts in the screw are consistent, so as to reflect the probability that there are no defects in the screw at the sub-image block through the goodness value.

[0011] Optionally, the gray diversity value of the sub-image block is determined by the following method: , where D is the gray diversity value of the sub-image block, norm is the normalization function, F is the variance of the gray values of the pixel points within the sub-image block, is the number of types of gray values of the pixel points within the sub-image block, is the number of pixel points within the sub-image block.

[0012] In this way, through the obtained gray diversity value of the sub-image block, the diversity of the gray values of the pixel points in the sub-image of the screw can be better characterized.

[0013] Optionally, the chain code sequence of the pixel points in the sub-image block is determined in the following manner: Use an edge detection algorithm to determine the boundary pixel points in the sub-image block, and determine the starting boundary pixel point from multiple boundary pixel points; starting from the starting boundary pixel point, traverse the boundary pixel points in the specified traversal direction, and obtain the chain code value according to the position relationship between the subsequent boundary pixel point and the previous pixel point during the traversal process, so as to obtain the chain code sequence composed of multiple chain code values.

[0014] In this way, by traversing the position relationship between adjacent boundary pixel points of the sub-image block in the specified direction, the shape characteristics of the boundary of the sub-image block can be described through the obtained chain code sequence; it is also convenient to use the number of the mode of the chain codes in the chain code sequence to describe the feature with the most frequent change in the position relationship between adjacent boundary pixel points.

[0015] Optionally, the similarity tolerance between two different sub-image blocks is determined in the following manner: , where R is the similarity tolerance between two different sub-image blocks, is the goodness value of one of the two different sub-image blocks, is the goodness value of the other sub-image block among the two different sub-image blocks, and r is the preset initial similarity tolerance.

[0016] Optionally, the fuzzy membership degree between different sub-image blocks is determined in the following manner: , P is the fuzzy membership degree between two different sub-image blocks, exp is the exponential function with the natural constant as the base, is the maximum of the gray differences between the pixel points at the corresponding positions of the two different sub-image blocks, R is the similarity tolerance between the two different sub-image blocks, and n is the integer corresponding to the side length of the target image block.

[0017] Optionally, the fuzzy entropy of the target image block is determined as follows: The average value of the fuzzy membership degrees between different sub-image blocks of the target image block is used as the eigenvalue of the target image block; The first eigenvalue when the target image block is intercepted into sub-image blocks at the first side length is obtained, and the second eigenvalue when the target image block is intercepted into sub-image blocks at the second side length is obtained; The second side length is greater than the first side length; The difference between the first eigenvalue and the second eigenvalue is used as the fuzzy entropy of the target image block.

[0018] In this way, since the first eigenvalue corresponds to the feature when the image block of the screw is intercepted into sub-image blocks at the first side length, and the second eigenvalue corresponds to the feature when the image block of the screw is intercepted into sub-image blocks at the second side length, using the difference between the first eigenvalue and the second eigenvalue as the fuzzy entropy of the target image block, the obtained fuzzy entropy can better reflect the differences in texture features of the image block at different scales, and can also characterize the complexity of the fuzzy membership degrees between different sub-image blocks in the image block, thereby reflecting the probability that there are defects in the screw at the image block.

[0019] According to the second aspect of the embodiments of the present application, a monitoring system for hardware production is provided, including: a processor and a memory, the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the monitoring method for hardware production provided in the first aspect of the present application are implemented.

[0020] The technical solution provided by the embodiments of the present application may include the following beneficial effects: Obtain the surface image of the screw to be detected on the production line, and perform block processing on the surface image to obtain a plurality of image blocks, and determine the goodness value of the sub-image blocks in the target image block, and the goodness value is used to characterize the straightness of the texture extension direction in the sub-image block; Since the texture extension direction of the threaded part of the screw is straighter than that of the defective part, therefore, using the sum value of the goodness values of two different sub-image blocks in the target image block, the obtained fuzzy entropy can better characterize the probability that there are defects in the part of the screw in the target image block, thereby effectively realizing the monitoring of the screws that have been produced.

[0021] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present application. Brief Description of the Drawings

[0022] The drawings here are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present application, and are used together with the specification to explain the principles of the present application.

[0023] Figure 1 is a flowchart of a monitoring method for hardware production shown according to an exemplary embodiment;

[0024] Figure 2 It is a schematic diagram showing the process of intercepting sub-image blocks according to an exemplary embodiment;

[0025] Figure 3 It is a schematic structural diagram of a monitoring system for hardware production according to an exemplary embodiment. Detailed implementation manners

[0026] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application.

[0027] First, a brief introduction to the application scenario of the embodiments of the present application is given. In the application scenario of the present application, for screws with threaded parts, the surface image of the side of the screw can be used to detect defects in the screw. However, the related technology mainly detects defects based on the consistency of the screws and does not combine the characteristics of the screws themselves to achieve defect detection of the screws. Therefore, it is difficult to effectively monitor the screws after production to achieve feedback adjustment of the production control parameters of the screws.

[0028] To solve the above technical problems, the embodiments of the present application provide a monitoring method and system for hardware production. Figure 1 It is a flowchart of a monitoring method for hardware production according to an exemplary embodiment, as Figure 1 shown, and the method includes the following steps.

[0029] In step S101, obtain the surface image of the to-be-detected screw after production is completed, and perform block processing on the surface image to obtain a plurality of image blocks, so as to determine the target image block from the plurality of image blocks.

[0030] For the to-be-detected screw after production is completed, an image acquisition device can be used to obtain the surface image of the threaded part on the side of the screw; by performing block processing on the surface image, a plurality of image blocks with the same size can be obtained, and different image blocks together form a complete surface image.

[0031] The size of the image block can be, for example, 7×7, 9×9, and 20×20, etc. The actual size of the image block can be determined according to the actual needs of the user and the specific size of the screw. The embodiments of the present application do not limit the size of the image block.

[0032] For the plurality of image blocks obtained after block processing, any image block that has not been detected can be used as the target image block to achieve detection of all image blocks in the surface image of the screw.

[0033] In step S102, a plurality of sub-image blocks with the same size are intercepted from the target image block according to a preset sliding step length, and the goodness value of the sub-image block is determined according to the number of modes in the chain code sequence of the pixel points in the sub-image block.

[0034] For example, Figure 2 is a schematic diagram of the interception process of the sub-image block in the embodiment of the present application. As Figure 2 shown, for an image block of size 5×5, when intercepting a 2×2 sub-image block, the sub-image block can be intercepted with a sliding step length of 1; here, for a 5×5 image block, (5 - 2 + 1)×(5 - 2 + 1) = 16 sub-image blocks can be obtained.

[0035] In the case where there are no defects on the surface of the screw, among the threads existing on the surface of the screw, the texture extension direction in the thread area has a relatively high straightness; in the case where there are defects on the surface of the screw, the straightness of the texture extension direction in the thread area is damaged, so that the straightness of the texture extension direction in the area with defects in the thread is reduced.

[0036] According to the number of modes in the chain code sequence of the pixel points in the sub-image block, the goodness value of the sub-image block can be determined. The goodness value is used to characterize the straightness of the texture extension direction in the sub-image block; the larger the goodness value of the sub-image block, the higher the straightness of the texture extension direction in the sub-image block, and the more likely the sub-image block corresponds to the part of the screw surface without defects; on the contrary, the smaller the goodness value of the sub-image block, the lower the straightness of the texture extension direction in the sub-image block, and the more likely the sub-image block corresponds to the part of the screw surface with defects.

[0037] In one embodiment, the goodness value of the sub-image block is determined in the following manner: , where is the goodness value of the sub-image block, norm is the normalization processing function; U is the number of modes in the chain code sequence of the pixel points in the sub-image block; D is the gray diversity value of the sub-image block, which is used to characterize the diversity of the gray values of the pixel points in the sub-image block; is the maximum value of the included angle between the gradient direction of the pixel points in the sub-image block and the horizontal direction, is the minimum value of the included angle between the gradient direction of the pixel points in the sub-image block and the horizontal direction.

[0038] The number of modes in the chain code sequence of the pixel points in the sub-image block can reflect the regularity of the texture of the sub-image block, and the thread area of the screw has a relatively high regularity. Therefore, the number of modes in the chain code sequence of the pixel points in the sub-image block can characterize the probability that there are no defects on the surface of the thread at the sub-image block.

[0039] The gray diversity value of the sub-image block is used to characterize the diversity of the gray values of the pixel points within the sub-image block; when there are defects such as dents on the surface of the screw at the sub-image block, the light reflection ability of the screw surface at the defect is different from that at the position without defects, resulting in different gray values at the defect and the position without defects, and the gray value of the sub-image block becomes more diverse. Therefore, the gray diversity value of the sub-image block can reflect the probability that the sub-image block belongs to the surface defect of the screw.

[0040] In the case where there are defects on the surface of the screw, in addition to changing the gray values in the surface image of the screw, it will also change the direction of the gradient change of the screw at the sub-image block. Therefore, through the maximum value of the angle between the gradient direction of the pixel points within the sub-image block and the horizontal direction, and the minimum value of the angle between the gradient direction of the pixel points within the sub-image block and the horizontal direction, the probability that the gradient direction of the sub-image block of the screw is affected by the defect can be reflected.

[0041] In this way, based on the pixel characteristics of the sub-image block itself and the consistency of the texture extension direction of the non-defective thread part in the screw, the goodness value of the sub-image block can be obtained to reflect the probability that there are no defects at the sub-image block of the screw through the goodness value.

[0042] In one embodiment, the gray diversity value of the sub-image block is determined in the following manner: , where D is the gray diversity value of the sub-image block, norm is the normalization function, F is the variance of the gray values of the pixel points within the sub-image block, is the number of types of gray values of the pixel points within the sub-image block, is the number of pixel points within the sub-image block.

[0043] Compared with the sub-image block with defects such as dents, the number of types of gray values of the pixel points in the sub-image block without defects is less; by comparing the number of types of gray values of the pixel points within the sub-image block with the number of pixel points within the sub-image block, not only can the normalization processing of the number of types of gray values be realized, but also it is convenient to reflect the diversity of the gray values of the pixel points within the sub-image block.

[0044] The greater the variance of the gray values of the pixel points within the sub-image block, the greater the difference degree of the gray values of the pixel points in the sub-image block, and the gray values of the pixel points in the sub-image block are usually more diverse.

[0045] In this way, through the obtained gray diversity value of the sub-image block, the diversity of the gray values of the pixel points in the sub-image of the screw can be better characterized.

[0046] In one embodiment, the chain code sequence of the pixel points in the sub-image block is determined in the following manner: an edge detection algorithm is used to determine the boundary pixel points in the sub-image block, and a starting boundary pixel point is determined from among the multiple boundary pixel points; starting from the starting boundary pixel point, the boundary pixel points are traversed in a specified traversal direction, and the chain code value is obtained based on the positional relationship of the subsequent boundary pixel point relative to the previous pixel point during the traversal, so as to obtain a chain code sequence composed of multiple chain code values.

[0047] Chain code is a coding method used to represent the boundaries or shapes in digital images. Chain code can describe the relative positional relationship between adjacent pixels on the boundary of a digital image through preset numbers; when determining the chain code, 4-neighbor coding or 8-neighbor coding can be adopted, and those skilled in the art can select the specific coding method according to actual needs.

[0048] Among them, in 4-neighbor coding, 0 means that the current boundary pixel point moves to the right relative to the previous boundary pixel point, 1 means that the current boundary pixel point moves down relative to the previous boundary pixel point, 2 means that the current boundary pixel point moves to the left relative to the previous boundary pixel point, and 3 means that the current boundary pixel point moves up relative to the previous boundary pixel point.

[0049] The outer contour line of the sub-image block can be obtained by using the edge detection algorithm, and the pixel points located on the outer contour line are boundary pixel points; any one of the multiple boundary pixel points can be used as the starting boundary pixel point, and traversal can be performed in any one of the clockwise or counterclockwise directions; according to the positional relationship of the subsequent boundary pixel point relative to the previous pixel point during the traversal and the preset corresponding relationship, the chain code value can be obtained; the preset corresponding relationship is used to represent the corresponding relationship between different positional relationships and different chain code values.

[0050] In this way, by traversing the positional relationship between adjacent boundary pixel points of the sub-image block in a specified direction, the shape characteristics of the boundary of the sub-image block can be described through the obtained chain code sequence; it is also convenient to use the number of the mode of the chain codes in the chain code sequence to describe the feature with the most frequent change in the positional relationship between adjacent boundary pixel points.

[0051] In step S103, according to the sum value of the goodness values of two different sub-image blocks in the target image block, the similarity tolerance between the two different sub-image blocks is determined.

[0052] For two sub-image blocks located in the same target image block, the larger the sum value of the goodness values of the two different sub-image blocks, the more likely the two different sub-image blocks are sub-image blocks without defects in the target image block.

[0053] The similarity tolerance between two different sub-image blocks is used to determine the fuzzy membership degree between two different sub-image blocks, and the fuzzy membership degree is positively correlated with the similarity tolerance; according to the sum value of the goodness values of two different sub-image blocks in the target image block, the similarity tolerance between two different sub-image blocks can be determined, which can determine a higher similarity tolerance between two different sub-image blocks and improve the fuzzy membership degree between the sub-image blocks in the normal area belonging to the screw in the image block.

[0054] In one embodiment, the similarity tolerance between two different sub-image blocks is determined in the following manner: , where R is the similarity tolerance between two different sub-image blocks, is the goodness value of one sub-image block among two different sub-image blocks, is the goodness value of the other sub-image block among two different sub-image blocks, and r is the preset initial similarity tolerance.

[0055] The preset initial similarity tolerance can be set according to actual needs. For example, the preset initial similarity tolerance can be set between 0.65 and 0.7.

[0056] Adding the goodness values of two different sub-image blocks, for the combination composed of two sub-image blocks belonging to the normal area of the screw, the corresponding similarity tolerance of the combination is larger, and the similarity tolerance is positively correlated with the fuzzy membership degree. Therefore, the fuzzy membership degree of the combination composed of two sub-image blocks in the normal area of the screw can be improved.

[0057] In step S104, using the similarity tolerance between different sub-image blocks, the fuzzy membership degree between different sub-image blocks is determined to obtain the fuzzy entropy of the target image block.

[0058] The fuzzy entropy is used to characterize the complexity of the fuzzy membership degree between different sub-image blocks in the image block; the larger the value of the fuzzy entropy of the image block, the greater the complexity of the fuzzy membership degree between different sub-image blocks in the image block, and among the different sub-image blocks included in the image block, it is more likely to include both the defective part and the non-defective part of the screw, and the screw is more likely to have a defect at the position corresponding to the image block.

[0059] In one embodiment, the fuzzy membership degree between different sub-image blocks is determined in the following manner: , P is the fuzzy membership degree between two different sub-image blocks, exp is the exponential function with the natural constant as the base, is the maximum value among the gray differences between the pixel points at the corresponding positions of two different sub-image blocks, R is the similarity tolerance between two different sub-image blocks, and n is the integer corresponding to the side length of the target image block.

[0060] When there are defects such as scratches, stains, and dents on the surface of the screw, compared with the surface of the screw without defects, the degree of difference between different parts in the surface image of the screw with defects is greater, and the similarity tolerance between regions with different features in the surface image of the screw with defects is different.

[0061] The fuzzy membership degree between different sub-image blocks obtained through the maximum value of the gray-scale differences between corresponding pixels of two different sub-image blocks and the similarity tolerance between the two different sub-image blocks can characterize the probability that at least one of the two sub-image blocks has a defect.

[0062] In this way, compared with the degree of difference between sub-image blocks without defects, the degree of difference between sub-image blocks with defects in the screw is greater, or the degree of difference between a sub-image block with a defect and a sub-image block without a defect is greater. Therefore, the fuzzy membership degree between different sub-image blocks can characterize the probability of defects in the combination composed of the two sub-image blocks.

[0063] In one embodiment, the fuzzy entropy of the target image block is determined as follows: the average value of the fuzzy membership degrees between different sub-image blocks of the target image block is used as the characteristic value of the target image block; the first characteristic value when the target image block is intercepted into sub-image blocks at the first side length and the second characteristic value when the target image block is intercepted into sub-image blocks at the second side length are obtained; the second side length is greater than the first side length; the difference between the first characteristic value and the second characteristic value is used as the fuzzy entropy of the target image block.

[0064] Since the fuzzy membership degree is calculated based on the similarity between sub-image blocks, the greater the fuzzy membership degree between different sub-image blocks of the screw, the greater the similarity between different sub-image blocks of the screw; the fuzzy entropy is used to characterize the degree of difference between different fuzzy membership degrees, or the fuzzy entropy is used to characterize the complexity of the fuzzy membership degrees between different sub-image blocks. Therefore, the greater the fuzzy entropy of the target image block, the more complex the surface texture of the target image block in the surface image of the screw.

[0065] When there are defects such as scratches or dents on the screw surface, these defects will cause the similarity between different sub-image blocks of the screw to decrease, resulting in an increase in the fuzzy entropy value. Therefore, the obtained fuzzy entropy can better characterize the probability of defects in the screw at the target image block.

[0066] Since the second side length is greater than the first side length, the second eigenvalue takes into account the information of the screw in a larger range. If the difference between the two eigenvalues corresponding to different side lengths is large, it indicates that there are significant changes in the texture of the screw surface at different scales. This significant change can reflect the non-uniformity existing in the manufacturing process of the screw, thereby reflecting whether there are defects in the screw.

[0067] On the contrary, if the obtained fuzzy entropy of the corresponding target image block is small, for example, the obtained fuzzy entropy of the corresponding target image block is close to 0, it indicates that the surface of the screw has similar texture features at different scales of the target image block, and there are no defects on the surface of the screw at the target image block.

[0068] The first side length and the second side length can be selected according to actual needs. For example, the selected first side length can be 7, and the size of the sub-image block intercepted at the first side length is 7×7; the selected second side length can be 9, and the size of the sub-image block intercepted at the second side length is 9×9; the obtained fuzzy entropy can characterize the texture feature differences at two different scales of 9×9 and 7×7, so as to determine whether there are defects such as dents on the surface of the screw at the target image block.

[0069] In this way, since the first eigenvalue corresponds to the feature when the sub-image block is intercepted from the image block of the screw at the first side length, and the second eigenvalue corresponds to the feature when the sub-image block is intercepted from the image block of the screw at the second side length, the difference between the first eigenvalue and the second eigenvalue is used as the fuzzy entropy of the target image block. The obtained fuzzy entropy can better reflect the texture feature differences of the image block at different scales, and can also characterize the complexity of the fuzzy membership degrees between different sub-image blocks in the image block, thereby reflecting the probability of defects existing in the screw at the image block.

[0070] In step S105, when the fuzzy entropy of the target image block is greater than the preset threshold, a prompt message is output.

[0071] The fuzzy entropy of the target image block is used to characterize the complexity of the fuzzy membership degrees between different sub-image blocks in the target image block. When the fuzzy entropy of the target image block is greater than the preset threshold, it indicates that there are large differences in the features of different sub-image blocks of the screw at the target image block, while the differences in the features between different sub-regions in the same region of the screw when there are no defects are small. Therefore, there are defects such as dents on the screw at the target image block.

[0072] On the contrary, when the fuzzy entropy of the target image block is less than or equal to the preset threshold, it indicates that there are no defects on the screw at the target image block. Referring to the obtaining process of the fuzzy entropy of the target image block, the fuzzy entropy of other image blocks in the surface image of the screw can be obtained to realize the detection of all image blocks of the screw to be monitored.

[0073] The prompt message is used to prompt that there are defects in the part of the screw corresponding to the target image block. Since the screws with surface defects will affect the appearance, and the defects on the surface of the screw may also be caused by internal defects of the screw. By outputting the prompt message, it helps to process the defective screws in time, avoid using the defective screws for fastening components, and thus ensure the safety of the components fastened by the screws.

[0074] Through the monitoring method for hardware production provided by the embodiments of the present application, the surface image of the screw to be detected on the production line is obtained, and the surface image is block-processed to obtain a plurality of image blocks. The excellent degree value of the sub-image block in the target image block is determined. The excellent degree value is used to characterize the straightness of the texture extension direction in the sub-image block. Since the texture extension direction of the threaded part of the screw is higher than that of the defective part, therefore, the fuzzy entropy obtained by using the sum value of the excellent degree values of two different sub-image blocks in the target image block can better characterize the probability that there are defects in the part of the screw corresponding to the target image block, thus effectively realizing the monitoring of the screws after production is completed.

[0075] Figure 3 FIG. 1 is a schematic structural diagram of a monitoring system 1000 for hardware production shown according to an exemplary embodiment. Refer to Figure 3 , the monitoring system 1000 for hardware production includes: a processor 1100 and a memory 1200. The memory 1200 stores computer program instructions. When the computer program instructions are executed by the processor 1100, all or part of the steps of the monitoring method for hardware production in the present application are implemented.

[0076] Those skilled in the art will readily think of other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any variations, uses, or adaptations of the present application. These variations, uses, or adaptations follow the general principles of the present application and include common general knowledge or conventional technical means in the technical field not disclosed in the present application. The specification and embodiments are only regarded as exemplary.

[0077] It should be understood that the present application is not limited to the exact structure already described and shown in the drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A monitoring method for hardware production, characterized in that: include: Acquire a surface image of the screw to be inspected after production, and perform block processing on the surface image to obtain a plurality of image blocks, so as to determine a target image block from the plurality of image blocks; According to the preset sliding step, multiple sub-image blocks of the same size are intercepted from the target image block, and the goodness value of the sub-image block is determined according to the number of modes in the chain code sequence of the pixel points in the sub-image block; the goodness value is used to characterize the straightness of the texture extension direction in the sub-image block, and is determined by the following method: ,in, is the goodness value of the sub-image block, norm is the normalization function; U is the number of modes in the chain code sequence of pixels in the sub-image block; D is the grayscale diversity value of the sub-image block, which is used to characterize the diversity of the grayscale values ​​of the pixels in the sub-image block; is the maximum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction, is the minimum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction; The grayscale diversity value of the sub-image block is determined in the following way: , where D is the grayscale diversity value of the sub-image block, norm is the normalization function, and F is the variance of the grayscale value of the pixel points in the sub-image block. is the number of types of grayscale values ​​of pixels in the sub-image block, is the number of pixels in the sub-image block; Determine the similarity tolerance between the two different sub-image blocks according to the sum of the excellence values ​​of the two different sub-image blocks in the target image block; Determine the fuzzy membership between different sub-image blocks by using the similarity tolerance between different sub-image blocks to obtain the fuzzy entropy of the target image block; the fuzzy entropy is used to characterize the complexity of the fuzzy membership between different sub-image blocks in the image block; When the fuzzy entropy of the target image block is greater than a preset threshold, a prompt message is output; the prompt message is used to prompt that there is a defect in the portion of the screw corresponding to the target image block.

2. The monitoring method for hardware production according to claim 1, characterized in that: The chain code sequence of pixels in a sub-image block is determined in the following way: Determine the boundary pixel points in the sub-image block by using an edge detection algorithm, and determine the starting boundary pixel point from multiple boundary pixel points; Taking the starting boundary pixel point as the starting point, the boundary pixel points are traversed in the specified traversal direction, and the chain code value is obtained according to the position relationship of the subsequent boundary pixel point relative to the previous pixel point during the traversal process to obtain a chain code sequence composed of multiple chain code values.

3. The monitoring method for hardware production according to claim 1, characterized in that: The similarity tolerance between two different sub-image blocks is determined as follows: , where R is the similarity tolerance between two different sub-image blocks, is the quality value of one sub-image block in two different sub-image blocks, is the excellence value of the other sub-image block in two different sub-image blocks, and r is the preset initial similarity tolerance.

4. The monitoring method for hardware production according to claim 1, characterized in that: The fuzzy membership between different sub-image blocks is determined in the following way: , P is the fuzzy membership between two different sub-image blocks, exp is an exponential function with a natural constant as the base, is the maximum grayscale difference between pixels at corresponding positions of two different sub-image blocks, R is the similarity tolerance between two different sub-image blocks, and n is an integer corresponding to the side length of the target image block.

5. The monitoring method for hardware production according to claim 1, characterized in that: The fuzzy entropy of the target image block is determined as follows: The average value of the fuzzy membership between different sub-image blocks of the target image block is used as the feature value of the target image block; Acquire a first eigenvalue when the target image block is cut into sub-image blocks with a first side length, and a second eigenvalue when the target image block is cut into sub-image blocks with a second side length; The second side is longer than the first side; The difference between the first eigenvalue and the second eigenvalue is used as the fuzzy entropy of the target image block.

6. A monitoring system for hardware production, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the monitoring method for hardware production according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Lead screw thread production defect detection method based on image processing

    CN116958136A

  • Cervical spondylotic myelopathy movement function auxiliary evaluation system based on multi-modal data

    CN116504393A

  • Connector surface defect detection method and system based on image processing

    CN119693358A