Monitoring method and system for hardware production
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 effective monitoring of the screw production process is achieved.
Patent Information
- Application Number
- CN202510437787.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-09
- Publication Date
- 2025-05-06
- Estimated Expiration
- 2045-04-09
AI Technical Summary
The prior art is difficult to accurately monitor the screw production process, especially when there are indentation defects on the surface of the screw.
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.
It effectively improves the accuracy of monitoring the surface defects of the screw, can better characterize the probability of the screw defects in the target image block, and achieves effective monitoring of the production completion screw.
Smart Images

Figure CN119941743A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of production process monitoring, and in particular 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. It is usually used in conjunction with a nut. A screw usually consists of a head, a threaded portion, and a rod. During the production process of the screw, a concave indentation defect may be formed on the surface of the screw.
[0003] The indentations on the surface of the screw will not only affect the appearance quality of the screw, but deeper indentations may also cause penetrating damage to the screw. For example, when there are indentations on the threaded part of the screw, it will affect the fit between the screw and the nut and reduce the fastening performance. Therefore, it is necessary to monitor the surface indentations of the screws during the production stage.
[0004] In order to detect defects in metal parts with threads and monitor the production process of metal parts with threads, a Chinese patent application document with publication number CN116958136A provides a method for detecting production defects of screw threads based on image processing, 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 a first inflection point offset degree; obtaining a second inflection point offset degree according to the number of inflection points that match the inflection point sequence with the inflection point standard sequence; obtaining a third inflection point offset degree according to the second inflection point offset degree; obtaining a position correlation degree according to the third inflection point offset degree; obtaining a 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; obtaining several defect areas according to the optimal deviation parameter to complete the production defect detection of screw threads.
[0005] The related art detects thread defects based on the inflection point sequence of the reference pixel point sequence, but fails to take into account the characteristics of the metal parts with threads. Therefore, the related art is difficult to accurately monitor the production process of screws. Summary of the invention
[0006] In order to overcome the problem in the related art that it is difficult to accurately monitor the production process of screws, the present application provides a monitoring method and system for hardware production.
[0007] According to a first aspect of an embodiment of the present application, a monitoring method for hardware production is provided, comprising: obtaining a surface image of a screw to be inspected after production is completed, 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 of the same size from the target image block according to a preset sliding step, and determining a goodness value of the sub-image block according to the number of modes in a chain code sequence of pixels in the sub-image block; the goodness value is used to characterize the straightness of a texture extension direction in the sub-image block; determining a similarity tolerance between two different sub-image blocks according to a sum of goodness values of two different sub-image blocks in the target image block; determining a fuzzy membership between different sub-image blocks using the similarity tolerance between different sub-image blocks, so as to obtain a 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; outputting a prompt message when the fuzzy entropy of the target image block is greater than a preset threshold; the prompt message is used to prompt that there is a defect in the portion of the screw corresponding to the target image block.
[0008] In this way, the surface image of the screw to be inspected on the production line is obtained, and the surface image is divided into blocks to obtain multiple image blocks, and the excellence value of the sub-image block in the target image block is determined. The excellence value is used to characterize the straightness of the texture extension direction in the sub-image block; because the texture extension direction of the threaded part of the screw is straighter than that of the defective part, the fuzzy entropy obtained by using the sum of the excellence values of two different sub-image blocks in the target image block can better characterize the probability that the screw has defects in the part of the target image block, thereby effectively realizing the monitoring of the screws that have been produced.
[0009] Optionally, the quality value of the sub-image block is determined by: ,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 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, It is the minimum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction.
[0010] In this way, the excellence value of the sub-image block can be obtained based on the pixel characteristics of the sub-image block itself and the consistency of the texture extension direction of the threaded part of the screw without defects, so as to reflect the probability that the screw does not have defects in the sub-image block through the excellence value.
[0011] Optionally, the grayscale diversity value of the sub-image block is determined by: , 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.
[0012] In this way, the diversity of the grayscale values of the pixels in the sub-image of the screw can be better represented by the obtained grayscale diversity value of the sub-image block.
[0013] Optionally, the chain code sequence of pixel points in the sub-image block is determined in the following manner: using an edge detection algorithm to determine the boundary pixel points in the sub-image block, and determining the starting boundary pixel point from multiple boundary pixel points; taking the starting boundary pixel point as the starting point, traversing the boundary pixel points in a specified traversal direction, and obtaining the chain code value according to the positional relationship of the subsequent boundary pixel point relative to the previous pixel point during the traversal process, so as to obtain a chain code sequence composed of multiple chain code values.
[0014] 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 majority of chain codes in the chain code sequence to describe the most frequently changing characteristics in the positional 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 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.
[0016] Optionally, the fuzzy membership between different sub-image blocks is determined in the following manner: , 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.
[0017] Optionally, the fuzzy entropy of the target image block is determined in the following manner: taking the average value of the fuzzy membership between different sub-image blocks of the target image block as the eigenvalue of the target image block; obtaining the first eigenvalue when the target image block is cut into sub-image blocks at a first side length, and the second eigenvalue when the target image block is cut into sub-image blocks at a second side length; the second side length is greater than the first side length; and taking the difference between the first eigenvalue and the second eigenvalue as the fuzzy entropy of the target image block.
[0018] In this way, since the first eigenvalue corresponds to the characteristics of the image block of the screw when the sub-image block is cut out at the first side length, and the second eigenvalue corresponds to the characteristics of the image block of the screw when the sub-image block is cut out 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 differences in texture features of the image block at different scales, and can also characterize the complexity of the fuzzy membership between different sub-image blocks in the image block, thereby reflecting the probability of defects in the screw at the image block.
[0019] According to a second aspect of an embodiment of the present application, a monitoring system for hardware production is provided, comprising: a processor and a memory, wherein 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: obtaining a surface image of a screw to be inspected on a production line, and performing block processing on the surface image to obtain a plurality of image blocks, and determining a quality value of a sub-image block in a target image block, wherein the quality 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 portion of the screw is straighter than that of the defective portion, the fuzzy entropy obtained by utilizing the sum of the quality values of two different sub-image blocks in the target image block can better characterize the probability that the screw has defects in the portion of the target image block, thereby effectively realizing the monitoring of the screws that have been produced.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0023] Figure 1 is a flow chart of a monitoring method for hardware production according to an exemplary embodiment; Figure 2 is a schematic diagram showing a sub-image block capture process according to an exemplary embodiment; Figure 3 The diagram is a schematic structural diagram of a monitoring system for hardware production according to an exemplary embodiment. DETAILED DESCRIPTION
[0024] Here, exemplary embodiments are described in detail, and examples thereof are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application.
[0025] First, the application scenario of the embodiment of the present application is briefly introduced. In the application scenario of the present application, for a screw with a threaded portion, the surface image of the side of the screw can be used to detect defects in the screw. However, the related art mainly performs defect detection based on the consistency of the screw, and does not realize defect detection of the screw in combination with the characteristics of the screw itself. Therefore, it is difficult to effectively monitor the produced screws in order to achieve feedback adjustment of the production control parameters of the screws.
[0026] In view of the above technical problems, the present application provides a monitoring method and system for hardware production. Figure 1 is a flow chart of a monitoring method for hardware production according to an exemplary embodiment. Figure 1 As shown, the method includes the following steps.
[0027] In step S101, a surface image of a manufactured screw to be inspected is obtained, and the surface image is divided into blocks to obtain a plurality of image blocks, so as to determine a target image block from the plurality of image blocks.
[0028] For the finished screws to be inspected, an image acquisition device can be used to obtain a surface image of the threaded part on the side of the screw; by dividing the surface image into blocks, multiple image blocks of the same size can be obtained, and different image blocks together constitute a complete surface image.
[0029] 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 embodiment of the present application does not limit the size of the image block.
[0030] For the multiple image blocks obtained after the block processing, any image block that has not been detected can be used as a target image block, so as to detect all the image blocks in the surface image of the screw.
[0031] In step S102, a plurality of sub-image blocks of the same size are intercepted from the target image block according to a preset sliding step size, and the quality 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.
[0032] For example, Figure 2 FIG. 1 is a schematic diagram of a sub-image block capture process in an embodiment of the present application. Figure 2 As shown, for an image block of size 5×5, when extracting a 2×2 sub-image block, the sub-image block can be extracted with a sliding step of 1; here, for an image block of size 5×5, (5-2+1)×(5-2+1)=16 sub-image blocks can be obtained.
[0033] When there are no defects on the surface of the screw, the texture extension direction of the threaded area in the threads existing on the surface of the screw is relatively straight; when there are defects on the surface of the screw, the straightness of the texture extension direction of the threaded area is destroyed, so that the straightness of the texture extension direction of the area with defects in the thread is reduced.
[0034] 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, and 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.
[0035] In one embodiment, the quality value of the sub-image block is determined in the following manner: ,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 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, It is the minimum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction.
[0036] The number of modes in the chain code sequence of pixel points in the sub-image block can reflect the regularity of the texture of the sub-image block, and the threaded area of the screw has a high regularity. Therefore, the number of modes in the chain code sequence of 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.
[0037] The grayscale diversity value of the sub-image block is used to characterize the diversity of the grayscale values of the pixels in the sub-image block. When there are defects such as dents on the surface of the screw at the sub-image block, the ability of the screw surface to reflect light at the defect is different from that at a position without the defect, so that the grayscale value at the defect is different from that at a position without the defect, and the grayscale value of the sub-image block becomes more diverse. Therefore, the grayscale diversity value of the sub-image block can reflect the probability that the sub-image block belongs to a surface defect of the screw.
[0038] When there are defects on the surface of the screw, in addition to changing the grayscale value in the surface image of the screw, the direction of the gradient change of the screw in the sub-image block will also change. Therefore, the maximum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction, as well as the minimum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction, can reflect the probability that the gradient direction of the sub-image block of the screw is affected by the defect.
[0039] In this way, the excellence value of the sub-image block can be obtained based on the pixel characteristics of the sub-image block itself and the consistency of the texture extension direction of the threaded part of the screw without defects, so as to reflect the probability that the screw does not have defects in the sub-image block through the excellence value.
[0040] In one embodiment, the grayscale diversity value of the sub-image block is determined in the following manner: , 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.
[0041] Compared with sub-image blocks with defects such as dents, sub-image blocks without defects have fewer types of grayscale values of pixels; the number of types of grayscale values of pixels in the sub-image blocks is compared with the number of pixels in the sub-image blocks, which can not only normalize the number of grayscale value types, but also facilitate reflecting the diversity of grayscale values of pixels in the sub-image blocks.
[0042] The larger the variance of the grayscale values of the pixels in the sub-image block, the greater the difference in the grayscale values of the pixels in the sub-image block, and the grayscale values of the pixels in the sub-image block are usually more diverse.
[0043] In this way, the diversity of the grayscale values of the pixels in the sub-image of the screw can be better represented by the obtained grayscale diversity value of the sub-image block.
[0044] In one embodiment, the chain code sequence of pixel points in a sub-image block is determined in the following manner: using an edge detection algorithm to determine the boundary pixel points in the sub-image block, and determining a starting boundary pixel point from multiple boundary pixel points; taking the starting boundary pixel point as the starting point, traversing the boundary pixel points in a specified traversal direction, and obtaining a chain code value according to the positional relationship of a subsequent boundary pixel point relative to a previous pixel point during the traversal process, so as to obtain a chain code sequence composed of multiple chain code values.
[0045] Chain code is a coding method used to represent the boundary or shape in a digital image. The chain code can describe the relative position relationship between adjacent pixels on the boundary of a digital image through pre-set numbers. When determining the chain code, 4-adjacency coding or 8-adjacency coding can be used. Those skilled in the art can select a specific coding method according to actual needs.
[0046] Among them, in the 4-adjacent coding, 0 means that the current boundary pixel moves to the right relative to the previous boundary pixel, 1 means that the current boundary pixel moves downward relative to the previous boundary pixel, 2 means that the current boundary pixel moves to the left relative to the previous boundary pixel, and 3 means that the current boundary pixel moves upward relative to the previous boundary pixel.
[0047] The outer contour line of the sub-image block can be obtained by using the edge detection algorithm, and the pixels located on the outer contour line are boundary pixels; any pixel point among multiple boundary pixels can be used as the starting boundary pixel point, and traversed in either clockwise or counterclockwise direction; according to the position relationship of the latter boundary pixel point relative to the previous pixel point during the traversal process and the preset corresponding relationship, the chain code value can be obtained; the preset corresponding relationship is used to characterize the correspondence between different position relationships and different chain code values.
[0048] 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 majority of chain codes in the chain code sequence to describe the most frequently changing characteristics in the positional relationship between adjacent boundary pixel points.
[0049] In step S103, the similarity tolerance between two different sub-image blocks in the target image block is determined according to the sum of the excellence values of the two different sub-image blocks.
[0050] For two sub-image blocks located in the same target image block, the larger the sum of the excellence values of the two different sub-image blocks is, the more likely the two different sub-image blocks are sub-image blocks without defects in the target image block.
[0051] The similarity tolerance between two different sub-image blocks is used to determine the fuzzy membership between the two different sub-image blocks, and the fuzzy membership is positively correlated with the similarity tolerance; the similarity tolerance between the two different sub-image blocks is determined according to the sum of the excellence values of the two different sub-image blocks in the target image block, and a higher similarity tolerance can be determined between the two different sub-image blocks, thereby improving the fuzzy membership between the sub-image blocks in the normal area of the screw in the image block.
[0052] 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 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.
[0053] 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.
[0054] The excellence values of two different sub-image blocks are added together. For the combination composed of the two sub-image blocks belonging to the normal area of the screw, the similarity tolerance corresponding to the combination is larger, and the similarity tolerance is positively correlated with the fuzzy membership. Therefore, the fuzzy membership of the combination composed of the two sub-image blocks in the normal area of the screw can be improved.
[0055] In step S104, the fuzzy membership between different sub-image blocks is determined by using the similarity tolerance between different sub-image blocks to obtain the fuzzy entropy of the target image block.
[0056] Fuzzy entropy is used to characterize the complexity of the fuzzy membership between different sub-image blocks in an image block; the larger the value of the fuzzy entropy of the image block, the greater the complexity of the fuzzy membership between different sub-image blocks in the image block, the more likely it is that the different sub-image blocks included in the image block will include both defective parts and non-defective parts of the screw, and the more likely it is that the screw has defects at the position corresponding to the image block.
[0057] In one embodiment, the fuzzy membership between different sub-image blocks is determined in the following manner: , 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.
[0058] When there are defects such as scratches, stains and dents on the surface of the screw, the difference between different parts in the surface image of the screw with defects is greater than that of the surface of the screw without defects, and the similarity tolerance between regions with different features in the surface image of the screw with defects is different.
[0059] The fuzzy membership between different sub-image blocks obtained by the maximum of the grayscale differences between the pixels at corresponding positions 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 defects.
[0060] In this way, the degree of difference between the sub-image blocks with defects in the screw is greater than the degree of difference between the sub-image blocks without defects, or the degree of difference between the sub-image blocks with defects and the sub-image blocks without defects is greater. Therefore, the fuzzy membership between different sub-image blocks can characterize the probability of defects in the combination composed of two sub-image blocks.
[0061] In one embodiment, the fuzzy entropy of the target image block is determined in the following manner: taking the average value of the fuzzy membership between different sub-image blocks of the target image block as the eigenvalue of the target image block; obtaining the first eigenvalue when the sub-image block is cut off at a first side length of the target image block, and the second eigenvalue when the sub-image block is cut off at a second side length of the target image block; the second side length is greater than the first side length; and taking the difference between the first eigenvalue and the second eigenvalue as the fuzzy entropy of the target image block.
[0062] Since the fuzzy membership is calculated based on the similarity between sub-image blocks, the larger the fuzzy membership 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 memberships, or the fuzzy entropy is used to characterize the complexity of the fuzzy membership between different sub-image blocks. Therefore, the larger 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.
[0063] When there are defects such as scratches or dents on the surface of the screw, these defects will cause the similarity between different sub-image blocks of the screw to decrease, thereby increasing the fuzzy entropy value. Therefore, the obtained fuzzy entropy can better characterize the probability that the screw has defects in the target image block.
[0064] 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 means that the texture of the screw surface has more significant changes at different scales. This more significant change can reflect the unevenness of the screw in the manufacturing process, and thus reflect whether there are defects in the screw.
[0065] 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 is no defect on the surface of the screw at the target image block.
[0066] 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 under the first side length is 7×7; the selected second side length can be 9, and the size of the sub-image block intercepted under the second side length is 9×9; the obtained fuzzy entropy can characterize the difference in texture features at two different scales of 9×9 and 7×7, thereby determining whether there are defects such as dents on the surface of the screw at the target image block.
[0067] In this way, since the first eigenvalue corresponds to the characteristics of the image block of the screw when the sub-image block is cut out at the first side length, and the second eigenvalue corresponds to the characteristics of the image block of the screw when the sub-image block is cut out 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 differences in texture features of the image block at different scales, and can also characterize the complexity of the fuzzy membership between different sub-image blocks in the image block, thereby reflecting the probability of defects in the screw at the image block.
[0068] In step S105, when the fuzzy entropy of the target image block is greater than a preset threshold, prompt information is output.
[0069] The fuzzy entropy of the target image block is used to characterize the complexity of the fuzzy membership 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 means that there are large differences in the features of the screw in different sub-image blocks of the target image block, while when there is no defect in the screw, the difference in features between different sub-regions of the same region of the screw is small. Therefore, the screw has defects such as dents at the target image block.
[0070] On the contrary, when the fuzzy entropy of the target image block is less than or equal to the preset threshold, it means that there is no defect in the screw at the target image block. By referring to the process of obtaining 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.
[0071] The prompt information is used to indicate that the screw has defects in the portion corresponding to the target image block. Since a screw with defects on the surface 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 information, it helps to deal with the defective screws in time to avoid the defective screws being used to fasten components, thereby ensuring the safety of the components fastened by the screws.
[0072] Through the monitoring method for hardware production provided by the embodiment of the present application, the surface image of the screw to be detected on the production line is obtained, and the surface image is divided into blocks to obtain multiple image blocks, and the excellence value of the sub-image block in the target image block is determined, and the excellence value is used to characterize the straightness of the texture extension direction in the sub-image block; because the texture extension direction of the threaded part of the screw is straighter than that of the defective part, the fuzzy entropy obtained by using the sum of the excellence values of two different sub-image blocks in the target image block can better characterize the probability that the screw has defects in the part of the target image block, thereby effectively realizing the monitoring of the screws that have been produced.
[0073] Figure 3 FIG. 1 is a schematic diagram of a monitoring system 1000 for hardware production according to an exemplary embodiment. Figure 3 The monitoring system 1000 for hardware production includes: a processor 1100 and a memory 1200, wherein the memory 1200 stores computer program instructions, and 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 this application are implemented.
[0074] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary technical means in the art that are not disclosed in the present application, and the specification and embodiments are only considered as exemplary.
[0075] It will be appreciated that the present application is not limited to the exact construction that has been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof.
Claims
1. A monitoring method for hardware production, characterized in that: include: Acquire a surface image of the produced screw to be inspected, and perform block processing on the surface image to obtain multiple image blocks, so as to determine a target image block from the multiple image blocks; According to a 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; 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; Using the similarity tolerance between different sub-image blocks, the fuzzy membership between different sub-image blocks is determined 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 information 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 goodness value of the sub-image block is determined in the following way: ,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 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, It is the minimum value of the angle between the gradient direction of the pixel point in the sub-image block and the horizontal direction.
3. The monitoring method for hardware production according to claim 2, characterized in that: 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.
4. The monitoring method for hardware production according to claim 2, 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.
5. 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.
6. 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.
7. 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.
8. 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 7 is implemented.
Citation Information
Patent Citations
Lead screw thread production defect detection method based on image processing
CN116958136A
Pupil image segmentation method
CN115115641A
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
Identification of mitotic cells within a tumor region
WO2014006421A1