A glass fiber cloth edge recognition method, device and storage medium
By grayscale processing and Canny filter recognition of the edge of fiberglass cloth, combined with threshold segmentation and non-maximum suppression technology, the problem of burr interference in fiberglass cloth edge recognition is solved, and the accuracy of edge recognition and the efficiency of the production process are improved. reliability.
Patent Information
- Application Number
- CN202410816792.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2044-06-24
AI Technical Summary
Incomplete cutting of fiberglass cloth during the production process leads to the formation of protruding burrs on the edges, which interferes with the machine vision system and edge recognition algorithms, leading to erroneous judgments during the production process, such as dimensional deviations and inaccurate shapes, affecting product quality and efficiency.
A glass fiber cloth edge recognition method is adopted, including obtaining images and grayscale, using Canny filtering to identify edges, extracting edge areas through threshold segmentation, separating non-connected areas for high-level screening, extracting skeletons with sub-pixel accuracy, connecting and performing straight lines Fitting creates edge vertical lines, and further performs non-maximum suppression and double threshold detection through Gaussian filtering and gradient value calculation to remove burr areas.
It improves the recognition accuracy of the edge of fiberglass cloth, removes non-connected and burr areas, reduces false alarms, and ensures the accuracy of edge recognition results and the reliability of the production process.
Smart Images

Figure CN118379317B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of digital image processing, and in particular to a method, device and storage medium for identifying an edge of a fiberglass cloth. Background Art
[0002] During the production process, fiberglass cloth needs to be precisely cut to obtain the required size and shape. During the cutting process, if the blade becomes blunt or is not installed firmly, it may cause incomplete cutting, resulting in protruding burrs on the edge of the fiberglass cloth. These protruding burrs will interfere with the machine vision system or edge recognition algorithm to accurately detect the edge of the fiberglass cloth. False alarms may lead to incorrect judgments in the production process, such as size deviation, inaccurate shape, etc., thus affecting product quality and production efficiency. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a method, device and storage medium for identifying the edge of a glass fiber cloth, which effectively solve the problems in the background technology.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is: a method for identifying the edge of a glass fiber cloth, comprising the following steps:
[0005] Get the image containing the edge of the cloth and grayscale it;
[0006] Use canny filtering to identify edges and extract edge areas through threshold segmentation;
[0007] After separating the non-connected regions, the regions are subjected to the first high-level screening;
[0008] Extract the skeleton with sub-pixel accuracy from the filtered area;
[0009] Connect adjacent sub-pixel skeletons and then perform height screening again;
[0010] Perform straight line fitting on the filtered sub-pixel skeleton, and the fitting result is the suspected edge;
[0011] The suspected edge is converted into a pixel area. After sorting the areas, a vertical line is created based on the rightmost pixel point of the first area. The vertical line is the edge of the cloth.
[0012] Furthermore, the canny filter is used to identify the edge, and the edge area is extracted by threshold segmentation. The specific steps are as follows:
[0013] First, perform Gaussian filtering on the image;
[0014] Secondly, calculate the gradient values in the horizontal and vertical directions respectively;
[0015] Calculate the gradient value and gradient direction;
[0016] Perform non-maximum suppression and compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient squares;
[0017] Perform dual threshold detection for edge connections.
[0018] Furthermore, the horizontal gradient value is g x (m,n), the vertical gradient value is g y (m,n), the gradient value is calculated as:
[0019]
[0020] Gradient direction .
[0021] Furthermore, non-maximum suppression is performed to compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient squares. If the gradient strength of the current pixel is the largest compared with the other two pixels, the pixel is retained as an edge point, otherwise the pixel will be suppressed.
[0022] Furthermore, when performing double threshold value detection on edge connections, first set two thresholds, high and low, and traverse the entire grayscale matrix. If the gradient of a point is higher than the high threshold, set it to 1 in the result; if the gradient value of the point is lower than the low threshold, set it to 0 in the result.
[0023] Furthermore, if the gradient value of the point is between the high and low thresholds, the following judgment is required: check the 8 neighboring points of the point (regard it as the center point) to see if there is a point with a gradient value higher than the high threshold. If so, it means that the center point is connected to the determined edge point, so set 1 in the result, otherwise set it to 0. The high threshold selected here is 20 and the low threshold is 40.
[0024] Furthermore, after separating the non-connected regions, the regions are preliminarily screened for height, and the height is set to 30 pixels.
[0025] Furthermore, adjacent sub-pixel skeletons are connected and then height screening is performed again, with the height set to 20 pixels.
[0026] The present invention also includes a computer device, including a camera, a memory, a processor, and a computer program stored in the memory and executable on the processor. The camera is communicatively connected to the processor, and when the processor executes the computer program, the method described above is implemented.
[0027] The present invention also includes a storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described above is implemented.
[0028] The beneficial effects of the present invention are as follows: the present invention obtains a picture containing the edge of the cloth and grayscales it, uses Canny filtering to identify the edge, extracts the edge area through threshold segmentation, separates the non-connected area, performs a first height screening on the area, extracts a skeleton with sub-pixel accuracy, performs linear fitting on the screened sub-pixel skeleton, and the fitting result is the suspected edge, converts the suspected edge into a pixel area, sorts the area, and creates a vertical line based on the rightmost pixel point of the first area, which is the edge of the cloth. Through image processing technologies such as grayscale and Canny filtering, the present invention can more accurately identify the edge of the glass fiber cloth. In particular, the sub-pixel accuracy skeleton extraction and linear fitting further improve the accuracy of edge recognition, making the recognition result closer to the real cloth edge, effectively removing the non-connected area and the possible burr area, thereby reducing the influence of the burr on the edge recognition result. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0030] Figure 1 Flow chart of a method for identifying an edge of a fiberglass cloth in an embodiment of the present invention;
[0031] Figure 2 Schematic diagram of the structure of a computer device in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments.
[0033] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only and do not represent the only implementation method.
[0034] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0035] like Figure 1 As shown, a method for identifying the edge of a fiberglass cloth comprises the following steps:
[0036] Get the image containing the edge of the cloth and grayscale it;
[0037] Use canny filtering to identify edges and extract edge areas through threshold segmentation;
[0038] After separating the non-connected regions, the regions are subjected to the first high-level screening;
[0039] Extract the skeleton with sub-pixel accuracy from the filtered area;
[0040] Connect adjacent sub-pixel skeletons and then perform height screening again;
[0041] Perform straight line fitting on the filtered sub-pixel skeleton, and the fitting result is the suspected edge;
[0042] The suspected edge is converted into a pixel area. After sorting the areas, a vertical line is created based on the rightmost pixel point of the first area. The vertical line is the edge of the cloth.
[0043] The specific implementation process of the present invention is to first obtain a picture containing the edge of the cloth and grayscale it; secondly, use Canny filtering to identify the edge, and extract the edge area through threshold segmentation; separate the non-connected area and perform the first height screening on the area; extract the skeleton of sub-pixel accuracy from the screened area; connect the adjacent sub-pixel skeletons, and then perform height screening again; perform straight line fitting on the screened sub-pixel skeleton, and the fitting result is the suspected edge; convert the suspected edge into a pixel area, sort the area, and create a vertical line based on the rightmost pixel point of the first area, and the vertical line is the edge of the cloth. Through image processing technologies such as grayscale and Canny filtering, the present invention can more accurately identify the edge of glass fiber cloth. In particular, the sub-pixel accuracy skeleton extraction and straight line fitting further improve the accuracy of edge recognition, making the recognition result closer to the real cloth edge, effectively removing the non-connected area and possible burr area, thereby reducing the influence of burrs on edge recognition results.
[0044] In the present invention, canny filtering is used to identify edges, and threshold segmentation is used to extract edge areas. The specific steps are as follows:
[0045] First, perform Gaussian filtering on the image;
[0046] Secondly, calculate the gradient values in the horizontal and vertical directions respectively;
[0047] Calculate the gradient value and gradient direction;
[0048] Perform non-maximum suppression and compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient squares;
[0049] Perform dual threshold detection for edge connections.
[0050] The horizontal gradient value is g x (m,n), the vertical gradient value is g y (m,n), the gradient value is calculated as:
[0051]
[0052] Gradient direction .
[0053] When performing non-maximum suppression, the gradient strength of the current pixel is compared with the two pixels along the positive and negative gradient squares. If the gradient strength of the current pixel is the largest compared with the other two pixels, the pixel point is retained as an edge point, otherwise the pixel point will be suppressed.
[0054] When performing double threshold value detection for edge connection, first set the high and low thresholds, traverse the entire grayscale matrix, and if the gradient of a point is higher than the high threshold, set it to 1 in the result, and if the gradient value of the point is lower than the low threshold, set it to 0 in the result. If the gradient value of the point is between the high and low thresholds, the following judgment is required: check the 8 neighboring points of the point (regard it as the center point) to see if there are points with gradient values higher than the high threshold. If so, it means that the center point is connected to the determined edge point, so set it to 1 in the result, otherwise set it to 0. The high threshold selected here is 20 and the low threshold is 40.
[0055] In the preferred embodiment of the present invention, after separating the non-connected areas, the areas are preliminarily screened with a height setting of 30 pixels, which can effectively remove those non-fabric edge areas with small areas that may be caused by noise or interference. This helps to reduce the amount of calculation for subsequent processing and improve the accuracy of edge recognition; connecting adjacent sub-pixel skeletons and then performing height screening again with a height setting of 20 pixels can further remove these unnecessary details and make the edge contour smoother and more continuous.
[0056] See also Figure 2A computer device provided in an embodiment of the present application includes: a camera, a processor 410 and a memory 420, wherein the memory 420 stores a computer program executable by the processor 410, and when the computer program is executed by the processor 410, the above method is executed.
[0057] The embodiment of the present application further provides a storage medium 430 on which a computer program is stored. When the computer program is run by the processor 410, the above method is executed.
[0058] Among them, the storage medium 430 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0059] In the description of the present invention, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. "Multiple" means two or more, unless otherwise clearly and specifically defined.
[0060] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0061] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.
[0062] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0063] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0064] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0065] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0066] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0067] Those skilled in the art should understand that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, and these changes and improvements fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for identifying the edge of a glass fiber cloth, characterized in that: The steps include: Get the image containing the edge of the cloth and grayscale it; Use Canny filtering to identify the edge, and extract the edge area through threshold segmentation, perform Gaussian filtering on the image, and then calculate the gradient values in the horizontal and vertical directions respectively, calculate the gradient value and gradient direction, perform non-maximum suppression, compare the gradient intensity of the current pixel with the two pixels along the positive and negative gradient squares, and perform double threshold detection edge connection; After separating the non-connected areas, the areas are screened for the first time with a height set to 30 pixels; Extract the skeleton with sub-pixel accuracy from the filtered area; Connect adjacent sub-pixel skeletons and then perform height screening again, with the height set to 20 pixels; Perform straight line fitting on the filtered sub-pixel skeleton, and the fitting result is the suspected edge; The suspected edge is converted into a pixel area. After sorting the areas, a vertical line is created based on the rightmost pixel point of the first area. The vertical line is the edge of the cloth.
2. The method for identifying the edge of a fiberglass cloth according to claim 1, characterized in that: The horizontal gradient value is g x (m,n), the vertical gradient value is g y (m,n), the gradient value is calculated as: Gradient direction .
3. The glass fiber cloth edge recognition method according to claim 1, characterized in that: Perform non-maximum suppression and compare the gradient strength of the current pixel with the two pixels along the positive and negative gradient squares. If the gradient strength of the current pixel is the largest compared to the other two pixels, the pixel is retained as an edge point, otherwise the pixel will be suppressed.
4. The method for identifying the edge of a fiberglass cloth according to claim 1, characterized in that: When performing dual threshold detection for edge connection, first set the high and low thresholds, traverse the entire grayscale matrix, and if the gradient of a point is higher than the high threshold, set it to 1 in the result; if the gradient value of the point is lower than the low threshold, set it to 0 in the result.
5. The method for identifying the edge of a fiberglass cloth according to claim 4, characterized in that: If the gradient value of the point is between the high and low thresholds, the following judgment is required: check the 8 neighboring points of the point (regard it as the center point) to see if there is a point with a gradient value higher than the high threshold. If so, it means that the center point is connected to the determined edge point, so set 1 in the result, otherwise set it to 0. The high threshold selected here is 20 and the low threshold is 40.
6. A computer device, characterized in that: The method comprises a camera, a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the camera is communicatively connected to the processor, and when the processor executes the computer program, the method according to any one of claims 1 to 5 is implemented.
7. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.
