Wood board edge sealing length detection method and system based on vision and medium

Through visual detection methods, the edge area of ​​the wooden board image is analyzed, the maximum connection area and detection enclosure box are generated, and the boundary coordinates are calculated, which solves the problem of sensor measurement position error and realizes accurate length detection of the wooden board edge seal.

CN119228864APending Publication Date: 2024-12-31HANGZHOU HUICUI INTELLIGENT TECH CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411225468.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing method of detecting length and short of wooden board edge seal strips is based on a distance sensor, which is susceptible to distortion of edge seal strips and burrs of wooden board edges, resulting in measurement position errors and the length of edge seals cannot be accurately detected.

Method used

Vision-based detection method is adopted, by acquiring the wooden board image for grayscale processing, analyzing the edge area to generate the maximum connectivity domain, establishing a detection enclosure box, obtaining the image pixel value to generate the wooden board boundary information, and calculating the boundary coordinates to determine the length of the edge seal.

Benefits of technology

It effectively avoids detection position errors, accurately analyzes the long and short sides of the wooden board edge seal, and improves the detection accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119228864A_ABST
    Figure CN119228864A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a vision-based wood board edge sealing length detection method and system and a medium, and the method comprises the steps: obtaining a wood board image, and carrying out the graying processing of the wood board image, and obtaining a gray image; analyzing the edge area of the wood board based on the gray level image, generating a maximum connected domain, and making a detection surrounding frame according to the maximum connected domain to obtain a detection area; acquiring an image pixel value in the detection area, generating wood board boundary information based on the image pixel value, and generating wood board contour information according to the wood board boundary information; establishing a reference point according to the board contour information, establishing a coordinate system based on the reference point, and generating board boundary coordinates according to the coordinate system; calculating the distance between two coordinates located on the same boundary based on the boundary coordinates of the wood board to obtain a distance value, and obtaining a long edge and a short edge of the sealed edge of the wood board according to the distance value; the measurement method based on vision is not limited by detection point positions, the problem of edge sealing detection position errors is effectively avoided, and the long edge and the short edge of the wood board edge sealing are accurately analyzed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of wood board edge banding detection, and in particular to a vision-based wood board edge banding length detection method, system and medium. Background Art

[0002] Edge banding is a very important process in wood processing, which is directly related to the service life and appearance of the wood. Traditional wood manufacturing is usually done manually, which requires sticking the edge banding strips to the edge of the wood board and then cutting the edge banding strips. With the development of science and technology, automated edge banding technology has gradually matured. At present, almost all wood manufacturers use automated equipment for edge banding. However, due to factors such as mechanical accuracy and edge banding material, the cut edge banding strips often have different lengths, and users need to process the edge banding strips again.

[0003] The existing methods for detecting the length of edge banding strips are mainly based on distance sensors. Although the distance measurement based on sensors is relatively accurate, the edge banding strips are usually relatively flexible, and they are easily distorted during the cutting process, resulting in the measured position not being the actual position to be measured. In addition, there may be burrs on the edge of the wooden board, resulting in errors in the detected over-length and over-short values. In response to the above problems, effective technical solutions are urgently needed. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a vision-based method, system and medium for detecting the length of wooden board edge banding. The visual measurement method is not limited by the detection point, effectively avoids the problem of edge banding detection position error, and accurately analyzes the long and short sides of the wooden board edge banding.

[0005] The embodiment of the present application also provides a method for detecting the length of a wooden board edge banding based on vision, comprising:

[0006] Acquire a wooden board image, and grayscale the wooden board image to obtain a grayscale image;

[0007] Analyze the edge area of ​​the wooden board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box according to the maximum connected domain, and obtain the detection area;

[0008] Obtain image pixel values ​​within the detection area, generate board boundary information based on the image pixel values, and generate board contour information based on the board boundary information;

[0009] Establish reference points according to the outline information of the board, establish a coordinate system based on the reference points, and generate the boundary coordinates of the board according to the coordinate system;

[0010] The distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value.

[0011] Optionally, in the vision-based wooden board edge length detection method described in the embodiment of the present application, obtaining a wooden board image and graying the wooden board image to obtain a grayscale image specifically includes:

[0012] Obtain a wooden board image, and analyze the R component, G component, and B component of the image color in the wooden board image;

[0013] Calculate the brightness values ​​of the R component, G component and B component respectively;

[0014] The brightness values ​​of the R component, the G component, and the B component are averaged to obtain the brightness mean;

[0015] Generate the gray value of each pixel based on the brightness mean;

[0016] The grayscale value of each pixel is fused to generate a grayscale image.

[0017] Optionally, in the vision-based wooden board edge length detection method described in the embodiment of the present application, the wooden board edge area is analyzed based on the grayscale image to generate the maximum connected domain, and a detection bounding box is formulated according to the maximum connected domain to obtain the detection area, which specifically includes:

[0018] Obtain a grayscale image, extract image features, calculate the grayscale value of the pixel, and compare the grayscale value of the pixel with the set grayscale threshold range;

[0019] Determine whether the grayscale value of the pixel is within a set grayscale threshold range;

[0020] If it is within the set grayscale threshold range, the image feature is determined to be a wood feature, and a wood feature set is generated;

[0021] Based on the wood feature set, the wood features at the edge are screened out, the maximum connected domain is generated based on the wood features at the edge, the minimum bounding box of the maximum connected domain is extracted, and the area of ​​the minimum bounding box is intercepted as the detection area of ​​the board;

[0022] If it is not within the set grayscale threshold range, the image feature is determined to be a background feature and the background feature is blurred.

[0023] Optionally, in the vision-based wooden board edge length detection method described in the embodiment of the present application, obtaining image pixel values ​​in the detection area, generating wooden board boundary information based on the image pixel values, and generating wooden board contour information based on the wooden board boundary information specifically includes:

[0024] Get the image pixel values ​​in the detection area, get the board boundary points, connect all the board boundary points one by one, and get the maximum connected domain;

[0025] The boundary points of the wooden board in the maximum connected domain are screened out to obtain boundary vertices, and two adjacent boundary vertices are fitted to form a connecting straight line to obtain a boundary straight line function;

[0026] Analyze the distance between the boundary point and the connecting line based on the boundary line function to obtain the distance value;

[0027] If the distance value is positive, the boundary point is determined to be outside the connecting line, and wood burr information is generated;

[0028] If the distance value is negative, the corresponding boundary points are removed and the outline information of the board is generated.

[0029] Optionally, in the vision-based wooden board edge length detection method described in the embodiment of the present application, a reference point is established according to the wooden board contour information, a coordinate system is established based on the reference point, and the wooden board boundary coordinates are generated according to the coordinate system, specifically including:

[0030] Obtain the outline information of the board, generate a contour map of the board detection area, and select the edge of the board as a reference point based on the contour map;

[0031] Take the reference point as the origin, establish a coordinate system, and obtain the contour coordinates of the detection area;

[0032] The board boundary coordinates are generated based on the contour coordinates of the detection area and the edge area of ​​the board.

[0033] Optionally, in the vision-based wooden board edge length detection method described in the embodiment of the present application, the distance between two coordinates located at the same boundary is calculated based on the wooden board boundary coordinates to obtain a distance value, and the long side and the short side of the wooden board edge are obtained according to the distance value, specifically including:

[0034] Obtain the boundary coordinates of the wooden board, analyze the boundary coordinates of the wooden board, and filter out the boundary coordinates of the wooden board located on the same boundary line;

[0035] Calculate the distance between two random boundary coordinates of the board boundary coordinates on the same boundary line to obtain the maximum distance value;

[0036] The number of boundary points located on the boundary line is analyzed based on the maximum distance value, and the optimal boundary line is generated. The maximum distance value is calculated based on the optimal boundary line to obtain the long side and the short side of the board edge sealing.

[0037] In a second aspect, an embodiment of the present application provides a vision-based wooden board edge length detection system, the system comprising: a memory and a processor, the memory comprising a program of a vision-based wooden board edge length detection method, and the program of the vision-based wooden board edge length detection method is executed by the processor to implement the following steps:

[0038] Acquire a wooden board image, and grayscale the wooden board image to obtain a grayscale image;

[0039] Analyze the edge area of ​​the wooden board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box according to the maximum connected domain, and obtain the detection area;

[0040] Obtain image pixel values ​​within the detection area, generate board boundary information based on the image pixel values, and generate board contour information based on the board boundary information;

[0041] Establish reference points according to the outline information of the board, establish a coordinate system based on the reference points, and generate the boundary coordinates of the board according to the coordinate system;

[0042] The distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value.

[0043] Optionally, in the vision-based wooden board edge length detection system described in the embodiment of the present application, obtaining a wooden board image and graying the wooden board image to obtain a grayscale image specifically includes:

[0044] Obtain a wooden board image, and analyze the R component, G component, and B component of the image color in the wooden board image;

[0045] Calculate the brightness values ​​of the R component, G component and B component respectively;

[0046] The brightness values ​​of the R component, the G component, and the B component are averaged to obtain the brightness mean;

[0047] Generate the gray value of each pixel based on the brightness mean;

[0048] The grayscale value of each pixel is fused to generate a grayscale image.

[0049] Optionally, in the vision-based wooden board edge length detection system described in the embodiment of the present application, the wooden board edge area is analyzed based on the grayscale image to generate the maximum connected domain, and a detection bounding box is formulated according to the maximum connected domain to obtain the detection area, which specifically includes:

[0050] Obtain a grayscale image, extract image features, calculate the grayscale value of the pixel, and compare the grayscale value of the pixel with the set grayscale threshold range;

[0051] Determine whether the grayscale value of the pixel is within a set grayscale threshold range;

[0052] If it is within the set grayscale threshold range, the image feature is determined to be a wood feature, and a wood feature set is generated;

[0053] Based on the wood feature set, the wood features located at the edge are screened out, a detection bounding box is generated, and a detection area is obtained;

[0054] If it is not within the set grayscale threshold range, the image feature is determined to be a background feature and the background feature is blurred.

[0055] In the third aspect, an embodiment of the present application also provides a computer-readable storage medium, which includes a vision-based wooden board edge banding length detection method program. When the vision-based wooden board edge banding length detection method program is executed by a processor, the steps of the vision-based wooden board edge banding length detection method as described in any one of the above items are implemented.

[0056] As can be seen from the above, the embodiments of the present application provide a method, system and medium for detecting the length of a wooden board edge banding based on vision. The method obtains a wooden board image, performs grayscale processing on the wooden board image, and obtains a grayscale image; analyzes the edge area of ​​the wooden board based on the grayscale image, generates a maximum connected domain, and formulates a detection bounding box based on the maximum connected domain to obtain a detection area; obtains image pixel values ​​within the detection area, generates wooden board boundary information based on the image pixel values, and generates wooden board contour information based on the wooden board boundary information; establishes a reference point based on the wooden board contour information, establishes a coordinate system based on the reference point, and generates wooden board boundary coordinates based on the coordinate system; calculates the distance between two coordinates located on the same boundary based on the wooden board boundary coordinates to obtain a distance value, and obtains the long and short sides of the wooden board edge banding based on the distance value; the vision-based measurement method is not limited by the detection point position, effectively avoids the problem of edge banding detection position error, and accurately analyzes the long and short sides of the wooden board edge banding. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments of the present application will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0058] Figure 1 A flow chart of a method for detecting the length of a wooden board edge banding based on vision provided in an embodiment of the present application;

[0059] Figure 2 A flow chart of a grayscale image acquisition method for a vision-based wood board edge length detection method provided in an embodiment of the present application;

[0060] Figure 3 A flow chart of a detection area acquisition method of a vision-based wood board edge length detection method provided in an embodiment of the present application;

[0061] Figure 4A detection block diagram of a vision-based wooden board edge length detection method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0063] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0064] Please refer to Figure 1 , Figure 1 The flowchart of a method for detecting the length of a wooden board edge banding based on vision in some embodiments of the present application is shown in FIG. The method for detecting the length of a wooden board edge banding based on vision is used in a terminal device, and the method for detecting the length of a wooden board edge banding based on vision includes the following steps:

[0065] S101, obtaining a wooden board image, and graying the wooden board image to obtain a grayscale image;

[0066] S102, analyzing the edge area of ​​the wooden board based on the grayscale image, generating a maximum connected domain, formulating a detection bounding box according to the maximum connected domain, and obtaining a detection area;

[0067] S103, obtaining image pixel values ​​within the detection area, generating board boundary information based on the image pixel values, and generating board contour information based on the board boundary information;

[0068] S104, establishing reference points according to the outline information of the board, establishing a coordinate system based on the reference points, and generating the boundary coordinates of the board according to the coordinate system;

[0069] S105, calculating the distance between two coordinates located at the same boundary based on the boundary coordinates of the wooden board to obtain a distance value, and obtaining the long side and the short side of the edge sealing of the wooden board according to the distance value.

[0070] It should be noted that the wooden board area is generally the largest connected area in the image. The largest connected domain area can be extracted as the detection area of ​​the wooden board, and the length of the edge banding strip exceeding the boundary of the wooden board or being shorter than the boundary of the wooden board can be effectively calculated to determine whether the edge banding of the wooden board is qualified.

[0071] Please refer to Figure 2 , Figure 2 The flowchart of the grayscale image acquisition method of a method for detecting the length of a wooden board edge banding based on vision in some embodiments of the present application is as follows. According to an embodiment of the present invention, obtaining a wooden board image and graying the wooden board image to obtain a grayscale image specifically includes:

[0072] S201, acquiring a wooden board image, and analyzing the R component, G component, and B component of the image color in the wooden board image;

[0073] S202, respectively calculating the brightness values ​​of the R component, the G component, and the B component;

[0074] S203, performing mean processing on the brightness values ​​of the R component, the G component, and the B component to obtain a brightness mean;

[0075] S204, generating a grayscale value for each pixel based on the brightness mean;

[0076] S205, merging the grayscale value of each pixel to generate a grayscale image.

[0077] It should be noted that in grayscale, in the RGB model, if R=G=B, the color represents a grayscale color, where the value of R=G=B is called the grayscale value. Therefore, each pixel of the grayscale image only needs one byte to store the grayscale value (also known as intensity value, brightness value), and the grayscale range is 0-255. Generally, there are four methods to grayscale color images: component method, maximum value method, average method, and weighted average method.

[0078] Please refer to Figure 3 , Figure 3 This is a flow chart of a detection area acquisition method of a vision-based wooden board edge length detection method in some embodiments of the present application. According to an embodiment of the present invention, the edge area of ​​the wooden board is analyzed based on the grayscale image, the maximum connected domain is generated, and a detection bounding box is formulated according to the maximum connected domain to obtain the detection area, which specifically includes:

[0079] S301, obtaining a grayscale image, extracting image features, calculating the grayscale value of a pixel, and comparing the grayscale value of the pixel with a set grayscale threshold range;

[0080] S302, determining whether the gray value of the pixel is within a set gray threshold range;

[0081] S303, if it is within the set gray threshold range, determine that the image feature is a wood feature, and generate a wood feature set;

[0082] S304, screening out wood features at the edge based on the wood feature set, generating a maximum connected domain based on the wood features at the edge, extracting a minimum bounding box of the maximum connected domain, and intercepting an area of ​​the minimum bounding box as a detection area of ​​the wooden board;

[0083] S305: If the image feature is not within the set grayscale threshold range, the image feature is determined to be a background feature, and the background feature is blurred.

[0084] It should be noted that the threshold segmentation method is used to accurately segment the wood features and background features, thereby capturing the minimum bounding box.

[0085] According to an embodiment of the present invention, obtaining image pixel values ​​within the detection area, generating board boundary information based on the image pixel values, and generating board contour information according to the board boundary information specifically includes:

[0086] Get the image pixel values ​​in the detection area, get the board boundary points, connect all the board boundary points one by one, and get the maximum connected domain;

[0087] The boundary points of the wooden board in the maximum connected domain are screened out to obtain boundary vertices, and two adjacent boundary vertices are fitted to form a connecting straight line to obtain a boundary straight line function;

[0088] Analyze the distance between the boundary point and the connecting line based on the boundary line function to obtain the distance value;

[0089] If the distance value is positive, the boundary point is determined to be outside the connecting line, and wood burr information is generated;

[0090] If the distance value is negative, the corresponding boundary points are removed and the outline information of the board is generated.

[0091] It should be noted that the pixel coordinates of the contour points of the local contour image are obtained, the contour point coordinates are fitted with a straight line function, the vertical distance from the contour points of the local contour image to the straight line function is calculated, and they are sorted from the smallest to the smallest, and the first 50% of the contour points closest to the straight line are taken, and the straight line function is re-fitted, which is the edge function of the wooden board.

[0092] Furthermore, after obtaining the detection area image, the following steps are also included:

[0093] Obtain the detection area image, erase pixels in a specified direction on the detection area image, erase the pixels if the number of consecutive pixels is less than a set value, and erase all consecutive pixels to obtain a pixel erasure image;

[0094] The specified direction can be understood as if the upper and lower edges of the board are detected, the vertical pixels are erased; if the left and right edges of the board are detected, the horizontal pixels are erased;

[0095] The set value must be smaller than the horizontal or vertical length of the wooden board area. The erased area is generally the interference area.

[0096] After obtaining the maximum connected domain of the pixel erasure graph, start from the edge and search for edge points toward the side of the board;

[0097] Obtain the edge point closest to the inner side of the board (excluding the edge banding area) as the board edge reference point. The board edge reference point represents the approximate position of the real edge of the board to a certain extent.

[0098] Among them, being closest to the inner side of the wooden board can be understood as: for example, if the wooden board is located at the top and the lower edge is detected, then the point with the smallest coordinate y is closest to the inner side of the wooden board.

[0099] The exclusion of the edge banding area can be understood as: for example, the edge banding is on the right side, and the normal thickness is 50 pixels. If the edge point is within 50 pixels on the right side, no detection is performed.

[0100] The innermost area is generally not subject to interference, which can effectively ensure that it is the main body of the board.

[0101] Extract the contour of the binary image of the detection area, obtain the contour image corresponding to the local area near the reference point on the edge of the wooden board, expand it vertically by the specified pixel height with the vertical coordinate of the reference point as the center, and expand it horizontally by the specified pixel width with the horizontal coordinate of the reference point as the center.

[0102] According to an embodiment of the present invention, establishing a reference point according to the outline information of the board, establishing a coordinate system based on the reference point, and generating the board boundary coordinates according to the coordinate system specifically include:

[0103] Obtain the outline information of the board, generate a contour map of the board detection area, and select the edge of the board as a reference point based on the contour map;

[0104] Take the reference point as the origin, establish a coordinate system, and obtain the contour coordinates of the detection area;

[0105] The board boundary coordinates are generated based on the contour coordinates of the detection area and the edge area of ​​the board.

[0106] It should be noted that the local contour map of the outermost edge area in the contour map of the wooden board detection area is obtained;

[0107] If the lower edge of the board is detected, the lowest point of the board area outline is used as the reference point, and the appropriate pixel height and width are expanded upward and left and right;

[0108] If the upper edge of the wooden board is detected, the top point of the wooden board area contour map is used as the reference point, and the appropriate pixel height and width are expanded downward and left and right;

[0109] If the left edge of the board is detected, the leftmost point of the board area contour map is used as the reference point, and the appropriate pixel height and width are expanded to the right and up and down;

[0110] If the right edge of the board is detected, the rightmost point of the board area outline is used as the reference point, and the appropriate pixel height and width are expanded to the left and up and down;

[0111] Get the coordinates of all contour points in the outermost local area, and calculate the maximum distance to the straight line function of the edge of the board, which is the maximum distance value of the edge banding beyond the boundary. The calculation method is to calculate the perpendicular distance from the point to the straight line function.

[0112] According to an embodiment of the present invention, the distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value, specifically including:

[0113] Obtain the boundary coordinates of the wooden board, analyze the boundary coordinates of the wooden board, and filter out the boundary coordinates of the wooden board located on the same boundary line;

[0114] Calculate the distance between two random boundary coordinates of the board boundary coordinates on the same boundary line to obtain the maximum distance value;

[0115] The number of boundary points located on the boundary line is analyzed based on the maximum distance value, and the optimal boundary line is generated. The maximum distance value is calculated based on the optimal boundary line to obtain the long side and the short side of the board edge sealing.

[0116] like Figure 4 As shown, according to an embodiment of the present invention, it also includes: calculating the maximum distance value of the edge seal being shorter than the boundary;

[0117] If the edge seal exceeds the boundary distance value greater than the set value, it is judged that the edge seal is too long, and the maximum distance value and its position that exceed the boundary value are output, and the recognition is ended (there is only one possibility: the edge seal is too long or too short).

[0118] The maximum distance that the edge is shorter than the boundary is calculated as follows:

[0119] If the edge band is on the right side, it is only necessary to identify the contour points within the specified area on the right side;

[0120] If the edge band is on the left, it is only necessary to identify the contour points within the specified area on the left;

[0121] If the edge banding is on the upper side, it is only necessary to identify the contour points within the specified area on the upper side;

[0122] If the edge banding is on the lower side, it is only necessary to identify the contour points within the specified area on the lower side.

[0123] The method for obtaining the designated area takes the edge banding on the right side as an example. The width of the standard edge banding is known to be W. The right boundary x1 of the board is known through the board area contour map. The reference center coordinates of the edge banding are (x, y). The calculation formula of the x coordinate is:

[0124] x=x1-w / 2

[0125] According to the calculated x-coordinate value, if the lower edge of the wooden board is detected, the wooden board area contour map is traversed from bottom to top with x as the horizontal coordinate to find the y-coordinate. If the traversed pixel value is 255, the traversal is stopped, and this position is the reference point of the edge banding strip.

[0126] Taking the edge banding reference point as the center, expand the specified pixel position up, down, left, and right to obtain the local area contour map of the edge banding (the horizontal expansion distance must be less than w / 2 to avoid interference with the contour points of the wooden board area and the edge area).

[0127] The traversal direction can be understood as: if the lower edge of the board is detected, it is traversed from bottom to top; if the upper edge of the board is detected, it is traversed from top to bottom; if the left edge of the board is detected, it is traversed from left to right; if the right edge of the board is detected, it is traversed from right to left.

[0128] Get the coordinates of all contour points in the local area of ​​the edge banding strip, calculate the maximum distance to the straight line function of the edge of the board, that is, the maximum distance value of the edge banding shorter than the boundary. The calculation method is to calculate the vertical distance from the point to the straight line function. If the short boundary distance value of the edge banding strip is greater than the set value, it is judged that the edge banding is too short, and the maximum distance value and its position that are shorter are output. Otherwise, it is judged that the length of the edge banding strip is normal and the recognition ends.

[0129] In a second aspect, an embodiment of the present application provides a vision-based wooden board edge length detection system, the system comprising: a memory and a processor, the memory comprising a program of a vision-based wooden board edge length detection method, and when the program of the vision-based wooden board edge length detection method is executed by the processor, the following steps are implemented:

[0130] Acquire a wooden board image, and grayscale the wooden board image to obtain a grayscale image;

[0131] Analyze the edge area of ​​the wooden board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box according to the maximum connected domain, and obtain the detection area;

[0132] Obtain image pixel values ​​within the detection area, generate board boundary information based on the image pixel values, and generate board contour information based on the board boundary information;

[0133] Establish reference points according to the outline information of the board, establish a coordinate system based on the reference points, and generate the boundary coordinates of the board according to the coordinate system;

[0134] The distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value.

[0135] It should be noted that the wooden board area is generally the largest connected area in the image. The largest connected domain area can be extracted as the detection area of ​​the wooden board, and the length of the edge banding strip exceeding the boundary of the wooden board or being shorter than the boundary of the wooden board can be effectively calculated to determine whether the edge banding of the wooden board is qualified.

[0136] According to an embodiment of the present invention, obtaining a wooden board image and graying the wooden board image to obtain a grayscale image specifically includes:

[0137] Obtain a wooden board image, and analyze the R component, G component, and B component of the image color in the wooden board image;

[0138] Calculate the brightness values ​​of the R component, G component and B component respectively;

[0139] The brightness values ​​of the R component, the G component, and the B component are averaged to obtain the brightness mean;

[0140] Generate the gray value of each pixel based on the brightness mean;

[0141] The grayscale value of each pixel is fused to generate a grayscale image.

[0142] It should be noted that in grayscale, in the RGB model, if R=G=B, the color represents a grayscale color, where the value of R=G=B is called the grayscale value. Therefore, each pixel of the grayscale image only needs one byte to store the grayscale value (also known as intensity value, brightness value), and the grayscale range is 0-255. Generally, there are four methods to grayscale color images: component method, maximum value method, average method, and weighted average method.

[0143] According to an embodiment of the present invention, the edge area of ​​the wooden board is analyzed based on the grayscale image to generate the maximum connected domain, and a detection bounding box is formulated according to the maximum connected domain to obtain the detection area, which specifically includes:

[0144] Obtain a grayscale image, extract image features, calculate the grayscale value of the pixel, and compare the grayscale value of the pixel with the set grayscale threshold range;

[0145] Determine whether the gray value of the pixel is within the set gray threshold range;

[0146] If it is within the set grayscale threshold range, the image feature is determined to be a wood feature, and a wood feature set is generated;

[0147] Based on the wood feature set, the wood features located at the edge are screened out, a detection bounding box is generated, and a detection area is obtained;

[0148] If it is not within the set grayscale threshold range, the image feature is determined to be a background feature and the background feature is blurred.

[0149] It should be noted that the threshold segmentation method is used to accurately segment the wood features and background features, thereby capturing the minimum bounding box.

[0150] According to an embodiment of the present invention, obtaining image pixel values ​​within the detection area, generating board boundary information based on the image pixel values, and generating board contour information according to the board boundary information specifically includes:

[0151] Get the image pixel values ​​in the detection area, get the board boundary points, connect all the board boundary points one by one, and get the maximum connected domain;

[0152] The boundary points of the wooden board in the maximum connected domain are screened out to obtain boundary vertices, and two adjacent boundary vertices are fitted to form a connecting straight line to obtain a boundary straight line function;

[0153] Analyze the distance between the boundary point and the connecting line based on the boundary line function to obtain the distance value;

[0154] If the distance value is positive, the boundary point is determined to be outside the connecting line, and wood burr information is generated;

[0155] If the distance value is negative, the corresponding boundary points are removed and the outline information of the board is generated.

[0156] It should be noted that the pixel coordinates of the contour points of the local contour image are obtained, the contour point coordinates are fitted with a straight line function, the vertical distance from the contour points of the local contour image to the straight line function is calculated, and they are sorted from the smallest to the smallest, and the first 50% of the contour points closest to the straight line are taken, and the straight line function is re-fitted, which is the edge function of the wooden board.

[0157] According to an embodiment of the present invention, establishing a reference point according to the outline information of the board, establishing a coordinate system based on the reference point, and generating the board boundary coordinates according to the coordinate system specifically include:

[0158] Obtain the outline information of the board, generate a contour map of the board detection area, and select the edge of the board as a reference point based on the contour map;

[0159] Take the reference point as the origin, establish a coordinate system, and obtain the contour coordinates of the detection area;

[0160] The board boundary coordinates are generated based on the contour coordinates of the detection area and the edge area of ​​the board.

[0161] It should be noted that the local contour map of the outermost edge area in the contour map of the wooden board detection area is obtained;

[0162] If the lower edge of the board is detected, the lowest point of the board area outline is used as the reference point, and the appropriate pixel height and width are expanded upward and left and right;

[0163] If the upper edge of the wooden board is detected, the top point of the wooden board area contour map is used as the reference point, and the appropriate pixel height and width are expanded downward and left and right;

[0164] If the left edge of the board is detected, the leftmost point of the board area contour map is used as the reference point, and the appropriate pixel height and width are expanded to the right and up and down;

[0165] If the right edge of the board is detected, the rightmost point of the board area outline is used as the reference point, and the appropriate pixel height and width are expanded to the left and up and down;

[0166] Get the coordinates of all contour points in the outermost local area, and calculate the maximum distance to the straight line function of the edge of the board, which is the maximum distance value of the edge banding beyond the boundary. The calculation method is to calculate the perpendicular distance from the point to the straight line function.

[0167] According to an embodiment of the present invention, the distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value, specifically including:

[0168] Obtain the boundary coordinates of the wooden board, analyze the boundary coordinates of the wooden board, and filter out the boundary coordinates of the wooden board located on the same boundary line;

[0169] Calculate the distance between two random boundary coordinates of the board boundary coordinates on the same boundary line to obtain the maximum distance value;

[0170] The number of boundary points located on the boundary line is analyzed based on the maximum distance value, and the optimal boundary line is generated. The maximum distance value is calculated based on the optimal boundary line to obtain the long side and the short side of the board edge sealing.

[0171] According to an embodiment of the present invention, the method further includes: calculating a maximum distance value where the edge seal is shorter than the boundary;

[0172] If the edge seal exceeds the boundary distance value greater than the set value, it is judged that the edge seal is too long, and the maximum distance value and its position that exceed the boundary value are output, and the recognition is ended (there is only one possibility: the edge seal is too long or too short).

[0173] The maximum distance that the edge is shorter than the boundary is calculated as follows:

[0174] If the edge band is on the right side, it is only necessary to identify the contour points within the specified area on the right side;

[0175] If the edge band is on the left, it is only necessary to identify the contour points within the specified area on the left;

[0176] If the edge banding is on the upper side, it is only necessary to identify the contour points within the specified area on the upper side;

[0177] If the edge banding is on the lower side, it is only necessary to identify the contour points within the specified area on the lower side.

[0178] The method for obtaining the designated area takes the edge banding on the right side as an example. The width of the standard edge banding is known to be W. The right boundary x1 of the board is known through the board area contour map. The reference center coordinates of the edge banding are (x, y). The calculation formula of the x coordinate is:

[0179] x=x1-w / 2

[0180] According to the calculated x-coordinate value, if the lower edge of the wooden board is detected, the wooden board area contour map is traversed from bottom to top with x as the horizontal coordinate to find the y-coordinate. If the traversed pixel value is 255, the traversal is stopped, and this position is the reference point of the edge banding strip.

[0181] Taking the edge banding reference point as the center, expand the specified pixel position up, down, left, and right to obtain the local area contour map of the edge banding (the horizontal expansion distance must be less than w / 2 to avoid interference with the contour points of the wooden board area and the edge area).

[0182] The traversal direction can be understood as: if the lower edge of the board is detected, it is traversed from bottom to top; if the upper edge of the board is detected, it is traversed from top to bottom; if the left edge of the board is detected, it is traversed from left to right; if the right edge of the board is detected, it is traversed from right to left.

[0183] Get the coordinates of all contour points in the local area of ​​the edge banding strip, calculate the maximum distance to the straight line function of the edge of the board, that is, the maximum distance value of the edge banding shorter than the boundary. The calculation method is to calculate the vertical distance from the point to the straight line function. If the short boundary distance value of the edge banding strip is greater than the set value, it is judged that the edge banding is too short, and the maximum distance value and its position that are shorter are output. Otherwise, it is judged that the length of the edge banding strip is normal and the recognition ends.

[0184] A third aspect of the present invention provides a computer-readable storage medium, which includes a vision-based wooden board edge banding length detection method program. When the vision-based wooden board edge banding length detection method program is executed by a processor, the steps of any of the vision-based wooden board edge banding length detection methods described above are implemented.

[0185] The present invention discloses a method, system and medium for detecting the length of a wooden board edge banding based on vision. The method comprises the following steps: acquiring a wooden board image, graying the wooden board image and obtaining a gray image; analyzing an edge area of ​​the wooden board based on the gray image and generating a maximum connected domain; formulating a detection bounding box according to the maximum connected domain and obtaining a detection area; acquiring image pixel values ​​within the detection area, generating wooden board boundary information based on the image pixel values, and generating wooden board contour information based on the wooden board boundary information; establishing a reference point based on the wooden board contour information, establishing a coordinate system based on the reference point, and generating wooden board boundary coordinates based on the coordinate system; calculating the distance between two coordinates located at the same boundary based on the wooden board boundary coordinates and obtaining a distance value, and obtaining the long side and short side of the wooden board edge banding according to the distance value; the vision-based measurement method is not limited by the detection point position, effectively avoiding the problem of edge banding detection position error, and accurately analyzing the long side and short side of the wooden board edge banding.

[0186] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0187] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0188] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0189] Those skilled in the art can understand that: all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a readable storage medium. When the program is executed, it executes the steps of the above method embodiments; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, and other media that can store program codes.

[0190] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.

Claims

1. A method for detecting the length of a wooden board edge banding based on vision, characterized in that: include: Acquire a wooden board image, and grayscale the wooden board image to obtain a grayscale image; Analyze the edge area of ​​the wooden board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box according to the maximum connected domain, and obtain the detection area; Obtain image pixel values ​​within the detection area, generate board boundary information based on the image pixel values, and generate board contour information based on the board boundary information; Establish reference points according to the outline information of the board, establish a coordinate system based on the reference points, and generate the boundary coordinates of the board according to the coordinate system; The distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value.

2. The method for detecting the length of wooden board edge banding based on vision according to claim 1, characterized in that: Obtain a wooden board image and perform grayscale processing on the wooden board image to obtain a grayscale image, specifically including: Obtain a wooden board image, and analyze the R component, G component, and B component of the image color in the wooden board image; Calculate the brightness values ​​of the R component, G component and B component respectively; The brightness values ​​of the R component, the G component, and the B component are averaged to obtain the brightness mean; Generate the gray value of each pixel based on the brightness mean; The grayscale value of each pixel is fused to generate a grayscale image.

3. The method for detecting the length of wooden board edge banding based on vision according to claim 2, characterized in that: Analyze the edge area of ​​the board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box based on the maximum connected domain, and obtain the detection area, which includes: Obtain a grayscale image, extract image features, calculate the grayscale value of the pixel, and compare the grayscale value of the pixel with the set grayscale threshold range; Determine whether the grayscale value of the pixel is within a set grayscale threshold range; If it is within the set grayscale threshold range, the image feature is determined to be a wood feature, and a wood feature set is generated; Based on the wood feature set, the wood features at the edge are screened out, the maximum connected domain is generated based on the wood features at the edge, the minimum bounding box of the maximum connected domain is extracted, and the area of ​​the minimum bounding box is intercepted as the detection area of ​​the board; If it is not within the set grayscale threshold range, the image feature is determined to be a background feature and the background feature is blurred.

4. The method for detecting the length of wooden board edge banding based on vision according to claim 3 is characterized in that: Obtaining image pixel values ​​within the detection area, generating board boundary information based on the image pixel values, and generating board contour information based on the board boundary information, specifically including: Get the image pixel values ​​in the detection area, get the board boundary points, connect all the board boundary points one by one, and get the maximum connected domain; The boundary points of the wooden board in the maximum connected domain are screened out to obtain boundary vertices, and two adjacent boundary vertices are fitted to form a connecting straight line to obtain a boundary straight line function; Analyze the distance between the boundary point and the connecting line based on the boundary line function to obtain the distance value; If the distance value is positive, the boundary point is determined to be outside the connecting line, and wood burr information is generated; If the distance value is negative, the corresponding boundary points are removed and the outline information of the board is generated.

5. The method for detecting the length of wooden board edge banding based on vision according to claim 4, characterized in that: The reference points are established according to the outline information of the board, a coordinate system is established based on the reference points, and the boundary coordinates of the board are generated according to the coordinate system, specifically including: Obtain the outline information of the board, generate a contour map of the board detection area, and select the edge of the board as a reference point based on the contour map; Take the reference point as the origin, establish a coordinate system, and obtain the contour coordinates of the detection area; The board boundary coordinates are generated based on the contour coordinates of the detection area and the edge area of ​​the board.

6. The method for detecting the length of wooden board edge banding based on vision according to claim 5, characterized in that: Based on the coordinates of the board boundary, the distance between two coordinates located on the same boundary is calculated to obtain the distance value. According to the distance value, the long side and the short side of the board edge sealing are obtained, including: Obtain the boundary coordinates of the wooden board, analyze the boundary coordinates of the wooden board, and filter out the boundary coordinates of the wooden board located on the same boundary line; Calculate the distance between two random boundary coordinates of the board boundary coordinates on the same boundary line to obtain the maximum distance value; The number of boundary points located on the boundary line is analyzed based on the maximum distance value, and the optimal boundary line is generated. The maximum distance value is calculated based on the optimal boundary line to obtain the long side and the short side of the board edge sealing.

7. A vision-based wood board edge length detection system, characterized in that: The system includes: a memory and a processor, wherein the memory includes a program of a method for detecting the length of a wooden board edge banding based on vision, and when the program of the method for detecting the length of a wooden board edge banding based on vision is executed by the processor, the following steps are implemented: Acquire a wooden board image, and grayscale the wooden board image to obtain a grayscale image; Analyze the edge area of ​​the wooden board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box according to the maximum connected domain, and obtain the detection area; Obtain image pixel values ​​within the detection area, generate board boundary information based on the image pixel values, and generate board contour information based on the board boundary information; Establish reference points according to the outline information of the board, establish a coordinate system based on the reference points, and generate the boundary coordinates of the board according to the coordinate system; The distance between two coordinates located at the same boundary is calculated based on the boundary coordinates of the wooden board to obtain a distance value, and the long side and the short side of the edge sealing of the wooden board are obtained according to the distance value.

8. The vision-based wood board edge length detection system according to claim 7, characterized in that: Obtain a wooden board image and perform grayscale processing on the wooden board image to obtain a grayscale image, specifically including: Obtain a wooden board image, and analyze the R component, G component, and B component of the image color in the wooden board image; Calculate the brightness values ​​of the R component, G component and B component respectively; The brightness values ​​of the R component, the G component, and the B component are averaged to obtain the brightness mean; Generate the gray value of each pixel based on the brightness mean; The grayscale value of each pixel is fused to generate a grayscale image.

9. The vision-based wood board edge length detection system according to claim 8, characterized in that: Analyze the edge area of ​​the board based on the grayscale image, generate the maximum connected domain, formulate the detection bounding box based on the maximum connected domain, and obtain the detection area, which includes: Obtain a grayscale image, extract image features, calculate the grayscale value of the pixel, and compare the grayscale value of the pixel with the set grayscale threshold range; Determine whether the grayscale value of the pixel is within a set grayscale threshold range; If it is within the set grayscale threshold range, the image feature is determined to be a wood feature, and a wood feature set is generated; Based on the wood feature set, the wood features located at the edge are screened out, a detection bounding box is generated, and a detection area is obtained; If it is not within the set grayscale threshold range, the image feature is determined to be a background feature and the background feature is blurred.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a vision-based wooden board edge length detection method program. When the vision-based wooden board edge length detection method program is executed by a processor, the steps of the vision-based wooden board edge length detection method as described in any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Method and system for measuring height of wood board higher than veneer and storage medium

    CN119810134A

  • Method, system and storage medium for measuring wood panels above veneer

    CN119810134B

  • Fiberboard production quality online detection method and system based on machine vision

    CN120598432A

  • A machine vision-based fiberboard production quality online detection method and system

    CN120598432B