A method and system for detecting defects in wooden boards

By acquiring images through alternating tilted light sources and cameras illuminating the surface of wooden boards, defects in the boards can be automatically identified, solving the problem of low efficiency in manual inspection and achieving highly efficient defect identification.

CN121409984BActive Publication Date: 2026-03-06GUANGZHOU SHENLU AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-24
Publication Date
2026-03-06

AI Technical Summary

Technical Problem

Current technologies rely on manual inspection for detecting defects in wooden boards, which is inefficient and cannot achieve automated detection.

Method used

A camera is positioned perpendicular to the surface of the wooden board. The surface is illuminated alternately by a first and a second symmetrical light source, and images of the first odd-numbered rows and the first even-numbered rows are acquired. A brightness difference map is generated by comparing the brightness differences of the images, and the defect type is identified by combining the image features.

Benefits of technology

It has achieved automated detection of defects in wooden boards, improving detection efficiency and accuracy, and can effectively identify defects such as protrusions and dents.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121409984B_ABST
    Figure CN121409984B_ABST
Patent Text Reader

Abstract

This invention discloses a method and system for detecting defects in wooden boards. The method includes: controlling a camera perpendicular to the surface of the wooden board to be tested, acquiring a first odd-numbered row of images of the surface of the wooden board under illumination by a first light source and a first even-numbered row of images under illumination by a second light source; wherein the first and second light sources are symmetrically set with the camera as a reference, and the first and second light sources alternately illuminate the surface of the wooden board to be tested at different angles; comparing the brightness differences of pixels at the same position in the first odd-numbered row of images and the first even-numbered row of images to generate a brightness difference map; comparing the first brightness difference value corresponding to each pixel in the brightness difference map with a standard difference value, and selecting the region where the first brightness difference value is greater than the standard difference value as a first defect candidate region; determining the defect type of the wooden board to be tested based on the image features of the corresponding regions of the first defect candidate regions in the first odd-numbered row of images and the first even-numbered row of images. By implementing this embodiment of the invention, the efficiency of wooden board defect detection can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of wood panel inspection, and more particularly to a method and system for detecting defects in wood panels. Background Technology

[0002] During the processing of boards, it is usually necessary to first detect defects on the surface of the boards. Common defects on the surface of wood boards include bumps and dents.

[0003] Currently, in the processing of technical wood panels, it is usually necessary for processing personnel to manually inspect each wood panel and manually screen out boards with various defects. Manual screening is time-consuming and labor-intensive, and the efficiency of defect identification is too low. Summary of the Invention

[0004] This invention provides a method and system for detecting defects in wooden boards, which can achieve automated detection of defects in wooden boards and improve the efficiency of defect detection.

[0005] An embodiment of the present invention provides a method for detecting defects in a wooden board, comprising: controlling a camera perpendicular to the surface of the wooden board to be tested, and acquiring a first odd-numbered row of images of the surface of the wooden board to be tested under illumination by a first light source and a first even-numbered row of images under illumination by a second light source; wherein the first light source and the second light source are symmetrically arranged with the camera as a reference, and the first light source and the second light source alternately and obliquely illuminate the surface of the wooden board to be tested.

[0006] Compare the brightness differences of pixels at the same positions in the first odd-numbered row image and the first even-numbered row image to generate a brightness difference map;

[0007] The first brightness difference value corresponding to each pixel in the brightness difference map is compared with the standard difference value. The area where the first brightness difference value is greater than the standard difference value is taken as the first defect candidate area.

[0008] Based on the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row image and the first even-numbered row image, the defect type of the wooden board to be tested is determined; wherein, the image features include any one or a combination of the following: brightness and contour shape.

[0009] Furthermore, the determination of the standard difference value includes:

[0010] Under the same lighting conditions, acquire the second odd-numbered row image and the second even-numbered row image corresponding to the defect-free wooden board area;

[0011] By comparing the brightness differences of corresponding pixels in the second odd-numbered row image and the second even-numbered row image, the second brightness difference value is determined;

[0012] Generate a difference value distribution based on each second brightness difference value;

[0013] The quantile at a predetermined position in the distribution of difference values ​​is taken as the standard difference value.

[0014] Furthermore, based on the image features of the corresponding regions of the first defect candidate regions in the first odd-numbered row images and the first even-numbered row images, the defect type of the wooden board to be tested is determined, including:

[0015] The region corresponding to the defect candidate region in the first odd-numbered row of the image is taken as the first region, and the region corresponding to the defect candidate region in the first even-numbered row of the image is taken as the second region.

[0016] Compare the first region with the second region. If the first region and the second region show complementary light and dark outlines, and the first region shows left bright and right dark, while the second region shows left dark and right bright, then it is determined that there is a protrusion on the wooden board to be tested.

[0017] If the first and second regions exhibit complementary light and dark outlines, with the first region showing a darker left and brighter right, and the second region showing a brighter left and darker right, then it is determined that the wooden board under test has a depression.

[0018] Furthermore, it also includes calculating the average brightness of the second odd-numbered rows of images to obtain the first average brightness; and calculating the average brightness of the second even-numbered rows of images to obtain the second average brightness.

[0019] The first normal brightness range is determined based on the first average brightness value, and the second normal brightness range is determined based on the second average brightness value.

[0020] If there exists a region where the first brightness difference value is less than the standard difference value, the brightness of the region corresponding to the first odd-numbered row of the image is not within the first normal brightness range, and the brightness of the region corresponding to the first even-numbered row of the image is not within the second normal brightness range, then it is determined that there is a stain on the wooden board to be tested.

[0021] Furthermore, before generating a brightness difference map by comparing the brightness differences of pixels at the same positions in the first odd-numbered row image and the first even-numbered row image, the process also includes:

[0022] The first odd-numbered row image and the first even-numbered row image are subjected to brightness normalization processing to obtain the first odd-numbered row image and the first even-numbered row image after brightness normalization.

[0023] The brightness normalization process includes:

[0024] For an image to be normalized, calculate the global average brightness of the image to be normalized;

[0025] Calculate the difference between the global average brightness and the target average brightness to obtain the brightness compensation value;

[0026] The brightness compensation value is used to perform brightness compensation on the image to be normalized, and the brightness-compensated image is obtained.

[0027] Calculate the extreme values ​​of brightness in the brightness-compensated image, and map the brightness values ​​of each pixel in the brightness-compensated image to a preset brightness standard range based on the extreme values ​​of brightness to obtain a brightness-normalized image.

[0028] The average brightness of the target corresponding to the first odd-numbered row of images and the first even-numbered row of images is the same.

[0029] Furthermore, the surface of the wooden board to be tested is fixed with circular protrusions for positioning; the camera is a line scan camera;

[0030] Before generating a brightness difference map by comparing the brightness differences of pixels at the same positions in the first odd-numbered row image and the first even-numbered row image, the method further includes:

[0031] Extract the first raised region containing the circular protrusions in the first odd-numbered rows of the image, and the second raised region containing the circular protrusions in the first even-numbered rows of the image;

[0032] Calculate the horizontal gradient of brightness in the bright area of ​​the first raised region, and take the point with the maximum absolute value of the gradient as the first light-dark boundary.

[0033] Calculate the horizontal gradient of brightness in the bright area of ​​the second raised region, and take the point with the maximum absolute value of the gradient as the second light-dark boundary.

[0034] Calculate the distance between the first and second light-dark boundaries;

[0035] The theoretical fixed spacing is calculated based on the height of the circular protrusion, the tilt angle of the first or second light source, and the pixel resolution of the line scan camera.

[0036] Calculate the translation amount based on the boundary spacing and the theoretical fixed spacing;

[0037] Align the first odd-numbered row of images with the first even-numbered row of images based on the translation amount.

[0038] Furthermore, after aligning the first odd-numbered row images with the first even-numbered row images according to the translation amount, the method further includes:

[0039] Calculate the distance between the light and dark boundaries in the first odd-numbered row image and the first even-numbered row image after alignment to obtain the corrected distance between the boundaries.

[0040] If the difference between the corrected boundary spacing and the theoretical fixed spacing is greater than the preset difference, a prompt message will be generated to check the camera setting position and the light source setting position.

[0041] Furthermore, the tilt angles of both the first light source and the second light source are 45°.

[0042] Based on the above method embodiments, the present invention provides corresponding system embodiments;

[0043] An embodiment of the present invention provides a wood board defect detection system, comprising: an image acquisition controller, at least one camera, and at least two light sources; the two light sources are a first light source and a second light source; the camera is disposed perpendicular to the surface of the wood board to be tested; the first light source and the second light source are symmetrically disposed with respect to the camera;

[0044] An image acquisition controller is used to control the first light source and the second light source to alternately tilt and illuminate the surface of the wooden board to be tested;

[0045] The camera is used to acquire the first odd-numbered rows of images of the surface of the wooden board under the illumination of the first light source and the first even-numbered rows of images under the illumination of the second light source.

[0046] The image controller is also used to compare the brightness differences of pixels at the same position in the first odd-numbered row image and the first even-numbered row image to generate a brightness difference map;

[0047] The first brightness difference value corresponding to each pixel in the brightness difference map is compared with the standard difference value. The area where the first brightness difference value is greater than the standard difference value is taken as the first defect candidate area.

[0048] Based on the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row image and the first even-numbered row image, the defect type of the wooden board to be tested is determined; wherein, the image features include any one or a combination of the following: brightness and contour shape.

[0049] Furthermore, the surface of the wooden board to be tested is fixed with circular protrusions for positioning; the camera is a line scan camera;

[0050] The image acquisition controller is further configured to extract the first protrusion region where the circular protrusion is located in the first odd-numbered row image and the second protrusion region where the circular protrusion is located in the first even-numbered row image before comparing the brightness differences of pixels at the same position in the first odd-numbered row image and generating a brightness difference map.

[0051] Calculate the horizontal gradient of brightness in the bright area of ​​the first raised region, and take the point with the maximum absolute value of the gradient as the first light-dark boundary.

[0052] Calculate the horizontal gradient of brightness in the bright area of ​​the second raised region, and take the point with the maximum absolute value of the gradient as the second light-dark boundary.

[0053] Calculate the distance between the first and second light-dark boundaries;

[0054] The following beneficial effects can be achieved by implementing the embodiments of the present invention:

[0055] This invention provides a method and system for detecting defects in wooden boards. The method involves setting a camera perpendicular to the surface of the wooden board to be tested, and symmetrically setting two light sources, a first light source and a second light source, with the camera as a reference. During the detection process, the first and second light sources are controlled to alternately tilt and illuminate the surface of the wooden board. Simultaneously, under the illumination of the first light source, the camera is controlled to acquire the first odd-numbered rows of images of the surface of the wooden board, and under the illumination of the second light source, the camera is controlled to acquire the first even-numbered rows of images of the surface of the wooden board. Next, the brightness differences of pixels at the same positions in the first odd-numbered rows of images and the first even-numbered rows of images are compared to generate a brightness difference map. Based on the first brightness difference value and the standard difference value corresponding to each pixel in the brightness difference map, a first defect candidate region is determined. Finally, based on the image features of the corresponding regions of the first defect candidate regions in the first odd-numbered rows of images and the first even-numbered rows of images, the defect type of the wooden board to be tested is determined. In this invention, wooden board defects are detected based on two different light sources with alternating tilted illumination. If the wooden board is defect-free, when the two light sources are tilted symmetrically, the diffuse reflection angle of the light on the flat surface is consistent, and the reflected light can enter the vertical camera perpendicularly. Therefore, the brightness of pixels at the same position in the first odd-numbered row image and the first even-numbered row image is basically consistent, with minimal and stable brightness difference. However, if the wooden board has defects such as holes, protrusions, or cracks, the above brightness pattern will be broken, resulting in a difference in brightness of pixels at the same position in the first odd-numbered row image and the first even-numbered row image. Therefore, the automatic detection of wooden board defects can be achieved based on the brightness difference of pixels in the first odd-numbered row image and the first even-numbered row image, thereby improving the efficiency of wooden board defect detection. Attached Figure Description

[0056] Figure 1 This is a flowchart illustrating a method for detecting defects in wooden boards according to an embodiment of the present invention;

[0057] Figure 2 This is a schematic diagram illustrating the principle of a wood board defect detection method according to an embodiment of the present invention for detecting protrusions.

[0058] Figure 3 This is a schematic diagram illustrating the principle of a wood board defect detection method according to an embodiment of the present invention for detecting dents.

[0059] Figure 4 This is a system architecture diagram of a wood board defect detection system provided in an embodiment of the present invention. Detailed Implementation

[0060] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0061] To resolve the above issues, please refer to [link / reference]. Figure 1 An embodiment of the present invention provides a method for detecting defects in wooden boards, comprising:

[0062] S1. Control the camera perpendicular to the surface of the wooden board to be tested, and acquire the first odd-numbered rows of images of the surface of the wooden board under the illumination of the first light source and the first even-numbered rows of images under the illumination of the second light source; wherein the first light source and the second light source are symmetrically set with the camera as a reference, and the first light source and the second light source alternately illuminate the surface of the wooden board to be tested at an angle.

[0063] The preferred camera is a line scan camera. The tilt angles of the first light source and the second light source are both within the range of 30°-60°. The optimal tilt angle between the first light source and the second light source is 45°, that is, the incident angle of light when the light from the first light source and the second light source shines on the surface of the wooden board to be tested is 45°. The first light source can be set on the left side of the camera, and the second light source can be set on the right side of the camera.

[0064] The incident angle of the light is within a moderate range of the cosine value that conforms to Lambert's law of diffuse reflection. The intensity of the reflected light is such that it can produce clear light and shadow on normal contours without being too strong and causing overexposure. Secondly, the 45° light has little difference in reflection on slight wood grain texture (height <0.1mm), and will not produce a lot of false light and shadow due to wood grain. However, it has a large difference in reflection on defect-level protrusions / depressions (height ≥0.2mm), which can effectively distinguish normal textures from defects. In addition, if the first light source and the second light source are symmetrically set at 45°, the complementary light and shadow pattern of the rising / falling edge of the positive protrusion is completely symmetrical, which is conducive to rapid identification.

[0065] During image acquisition, the first light source is turned on when the camera acquires odd-numbered rows of images, and the second light source is turned on when acquiring even-numbered rows of images. The first and second light sources are alternately lit to complete the image acquisition of the entire wooden board surface, thus obtaining the aforementioned first odd-numbered row of images and first even-numbered row of images.

[0066] S2. Compare the brightness differences of pixels at the same positions in the first odd-numbered row image and the first even-numbered row image to generate a brightness difference map.

[0067] Specifically, the brightness difference is obtained by taking the absolute value of the difference between the brightness values ​​of pixels at the same position in the first odd-numbered row image and the first even-numbered row image. This difference is then used to create the aforementioned brightness difference map. In the brightness difference map, "bright pixels" represent pixels with a large brightness difference at that position in the two images, while "dark pixels" represent pixels with a small difference.

[0068] In a preferred embodiment, to eliminate the overall brightness shift caused by the power difference between the first light source and the second light source (e.g., to avoid misjudging the difference as a difference due to the first light source being brighter), thereby leading to errors in wood board defect detection and improving the accuracy of defect detection, brightness normalization processing can be performed on the first odd-numbered row image and the first even-numbered row image to scale the brightness of the two images to the same range [0-255].

[0069] Preferably, the brightness normalization process includes: for an image to be normalized, calculating the global average brightness of the image to be normalized;

[0070] Calculate the difference between the global average brightness and the target average brightness to obtain the brightness compensation value;

[0071] The brightness compensation value is used to perform brightness compensation on the image to be normalized, and the brightness-compensated image is obtained.

[0072] Calculate the extreme values ​​of brightness in the brightness-compensated image, and map the brightness values ​​of each pixel in the brightness-compensated image to a preset brightness standard range based on the extreme values ​​of brightness to obtain a brightness-normalized image.

[0073] The average brightness of the target corresponding to the first odd-numbered row of images and the first even-numbered row of images is the same.

[0074] Specifically, the target average brightness is set to 128, the brightness values ​​of all pixels in the image to be normalized are iterated, and then the average value is calculated to obtain the above global average brightness.

[0075] Calculate the difference between the global average brightness and the target average brightness, and take the absolute value to obtain the brightness compensation value. If the global average brightness is greater than the target average brightness, it means that the image to be normalized is too bright overall. In this case, subtract the brightness compensation value from the brightness value of all pixels in the image to be normalized to obtain the brightness-compensated image. If the global average brightness is less than the target average brightness, it means that the image to be normalized is too dark overall. In this case, add the brightness compensation value to the brightness value of all pixels in the image to be normalized to obtain the brightness-compensated image.

[0076] Next, the maximum and minimum luminance values ​​of the luminance-compensated image are calculated. Then, the luminance values ​​of each pixel in the luminance-compensated image are mapped to a preset luminance standard range using the following formula to obtain the luminance-normalized image:

[0077] ;

[0078] in, For pixels after brightness normalization ( The brightness value of ) For pixels in the brightness-compensated image ( The brightness value of ) This represents the minimum brightness value of the image after brightness compensation. This represents the maximum brightness value of the image after brightness compensation. ( ) indicates rounding. For example: In a brightness-compensated image, a pixel has a brightness of 125, a minimum brightness of 20, and a maximum brightness of 230; then the normalized brightness value is: (125-20) / (230-20) ×255 = (105 / 210)×255=127.5, which is rounded to 128.

[0079] The above embodiments can smooth out differences in light source power based on average brightness alignment, thereby improving the accuracy of detection.

[0080] In a preferred embodiment, in order to eliminate pixel misalignment (such as lateral offset or slight tilt) caused by the movement deviation of the wooden board, and to ensure that the same pixel coordinates in the first odd-numbered row image and the first even-numbered row image correspond to the same physical position of the wooden board, and to avoid the problem of "false difference" caused by misalignment, the first odd-numbered row image and the first even-numbered row image need to be aligned before generating a brightness difference map by comparing the brightness difference of pixels at the same position in the first odd-numbered row image and the first even-numbered row image.

[0081] To illustrate, first fix a circular protrusion for positioning on the surface of the wooden board to be tested. For example, it can be a white, hemispherical protrusion that can be pasted on. Then, paste it on the upper left corner of the surface of the wooden board to be tested.

[0082] Next, the first raised region containing the circular protrusions in the first odd-numbered rows of the image, and the second raised region containing the circular protrusions in the first even-numbered rows of the image are extracted;

[0083] Calculate the horizontal gradient of brightness in the bright area of ​​the first raised region, and take the point with the maximum absolute value of the gradient as the first light-dark boundary.

[0084] Calculate the horizontal gradient of brightness in the bright area of ​​the second raised region, and take the point with the maximum absolute value of the gradient as the second light-dark boundary.

[0085] Calculate the distance between the first and second light-dark boundaries;

[0086] The theoretical fixed spacing is calculated based on the height of the circular protrusion, the tilt angle of the first or second light source, and the pixel resolution of the line scan camera.

[0087] Calculate the translation amount based on the boundary spacing and the theoretical fixed spacing;

[0088] Align the first odd-numbered row of images with the first even-numbered row of images based on the translation amount.

[0089] Specifically, firstly, based on the known physical coordinates of the circular protrusion, its coordinate position in the image is determined, and the preset coordinate range is appropriately expanded to determine the ROI region corresponding to the circular protrusion in the first odd-numbered row image and the first even-numbered row image, thus obtaining the aforementioned first protrusion region and second protrusion region respectively.

[0090] Next, adaptive threshold segmentation is performed on the ROI regions in the first odd-numbered row image and the first even-numbered row image to filter out connected regions with brightness higher than the surrounding 30 gray values. These regions are the circular raised bright ring regions, and the raised bright areas of the first raised region and the second raised region are obtained respectively.

[0091] Calculate the horizontal gradient of the first bright area and find the pixel column with the largest absolute gradient value. Its X coordinate is the pixel position of the first light-dark boundary.

[0092] Calculate the horizontal gradient of the second raised bright area, find the pixel column with the largest absolute gradient value, and its X coordinate is the pixel position of the second light-dark boundary.

[0093] Calculate the difference in X coordinates between the first and second light-dark boundaries to obtain the aforementioned boundary spacing;

[0094] Based on physical laws, the theoretical fixed distance between the first and second light-dark boundaries is calculated using the following formula: Δx = 2 × (h × tanα) / s. Δx is the theoretical fixed distance between the first and second light-dark boundaries, h is the height of the convexity, α is the angle between the incident light ray and the surface of the wooden board, and s is the pixel resolution of the line scan camera.

[0095] The above translation amount can be obtained by calculating the difference between the boundary spacing and the theoretical fixed spacing;

[0096] Then, align the first odd-numbered row of images with the first even-numbered row of images based on the translation amount.

[0097] This embodiment can strictly align the pixel coordinates of the first odd-numbered row image and the first even-numbered row image, ensuring that pixels at the same physical location have consistent coordinates in the two images, avoiding false differences caused by misalignment, and improving the accuracy of wood board defect detection.

[0098] In a preferred embodiment, after aligning the first odd-numbered row images with the first even-numbered row images according to the translation amount, the method further includes:

[0099] Calculate the distance between the light and dark boundaries in the first odd-numbered row image and the first even-numbered row image after alignment to obtain the corrected distance between the boundaries.

[0100] If the difference between the corrected boundary spacing and the theoretical fixed spacing is greater than the preset difference, a prompt message will be generated to check the camera setting position and the light source setting position.

[0101] In this embodiment, after aligning the first odd-numbered row of images with the first even-numbered row of images, the boundary spacing is recalculated for verification. If the difference between the corrected boundary spacing and the theoretical fixed spacing is greater than the preset difference, it indicates that the position of the camera or light source may be improper, causing a deviation in the theoretical fixed spacing. At this time, a prompt message is generated to check the position of the camera and the light source, so as to prompt the user to adjust the position of the camera and the light source.

[0102] S3. Compare the first brightness difference value corresponding to each pixel in the brightness difference map with the standard difference value, and take the area where the first brightness difference value is greater than the standard difference value as the first defect candidate area.

[0103] Specifically, the brightness difference value corresponding to each pixel in the brightness difference map is compared with the standard difference value to identify pixels that are greater than the standard difference value, and finally the first defect candidate region is formed.

[0104] In a preferred embodiment, determining the standard difference value includes:

[0105] Under the same lighting conditions, acquire the second odd-numbered row image and the second even-numbered row image corresponding to the defect-free wooden board area;

[0106] By comparing the brightness differences of corresponding pixels in the second odd-numbered row image and the second even-numbered row image, the second brightness difference value is determined;

[0107] Generate a difference value distribution based on each second brightness difference value;

[0108] The quantile at a predetermined position in the distribution of difference values ​​is taken as the standard difference value.

[0109] Specifically, before testing, under the same light source settings, select a defect-free area on the surface of the wooden board to be tested, illuminate it with the same lighting method and take pictures to obtain the second odd-numbered row of images and the second even-numbered row of images;

[0110] Then, based on the brightness difference of corresponding pixels in the second odd-numbered row image and the second even-numbered row image, several second brightness difference values ​​are determined, and the second brightness difference values ​​are arranged in ascending order to generate a difference value distribution.

[0111] Take the quantile at a preset position in the distribution of difference values, such as the 95th percentile, as the standard difference value.

[0112] S4. Determine the defect type of the wooden board to be tested based on the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row image and the first even-numbered row image; wherein, the image features include any one or a combination of the following: brightness and contour shape.

[0113] In a preferred embodiment, the defect type of the wooden board to be tested is determined based on the image features of the corresponding regions of the first defect candidate regions in the first odd-numbered row images and the first even-numbered row images, including:

[0114] The region corresponding to the defect candidate region in the first odd-numbered row of the image is taken as the first region, and the region corresponding to the defect candidate region in the first even-numbered row of the image is taken as the second region.

[0115] Compare the first region with the second region. If the first region and the second region show complementary light and dark outlines, and the first region shows left bright and right dark, while the second region shows left dark and right bright, then it is determined that there is a protrusion on the wooden board to be tested.

[0116] If the first and second regions exhibit complementary light and dark outlines, with the first region showing a darker left and brighter right, and the second region showing a brighter left and darker right, then it is determined that the wooden board under test has a depression.

[0117] Indicative, such as Figure 2 , 3 As shown, the wooden planks are conveyed from right to left. The first light source (light source 1 in the diagram) is located on the left side, and the second light source (light source 2 in the diagram) is located on the right side.

[0118] According to the imaging rules, if the surface of the wooden board is flat and without defects, the brightness of each pixel in the first odd-numbered row image and the first even-numbered row image is uniform and there is no obvious change in brightness. In addition, the brightness difference between the two images is small.

[0119] If there are protrusions on the surface of the wooden board, the imaging brightness of the rising side of the protrusion in the first odd-numbered row image is greater than that of the rising side of the protrusion in the first even-numbered row image, and the imaging brightness of the falling side of the protrusion in the first odd-numbered row image is less than that of the falling edge of the protrusion in the first even-numbered row image. Furthermore, the two images have a fixed contour with complementary brightness and darkness.

[0120] Figure 2 (a) in the diagram is a schematic diagram showing the first light source illuminating the rising side of the protrusion when acquiring images of an odd number of rows. Figure 2 (b) is a schematic diagram showing the second light source illuminating the rising side of the protrusion when acquiring images of even-numbered rows. Figure 2 (c) in the diagram shows the first light source illuminating the descending edge of the protrusion when acquiring images of odd-numbered rows. Figure 2 (d) in the diagram illustrates the second light source illuminating the descending edge of the protrusion when capturing images of an even number of rows. In this scenario, the camera is mounted vertically, and two sets of light sources illuminate the surface of the wooden board at an angle. When the surface of the wooden board has a protruding outline, the image brightness of the rising side of the protrusion illuminated by light source 1 (the first light source) is higher than that of the rising side of the protrusion illuminated by light source 2 (the second light source), while the image brightness of the descending edge of the protrusion illuminated by light source 1 (the first light source) is lower than that illuminated by light source 2 (the second light source).

[0121] If there is a depression on the surface of the wooden board, the imaging brightness of the descending edge of the depression in the first odd-numbered row image is less than that of the descending edge of the depression in the first even-numbered row image, and the imaging brightness of the ascending edge of the depression in the first odd-numbered row image is greater than that of the ascending edge of the depression in the first even-numbered row image, and the two images have a fixed contour with complementary brightness.

[0122] Figure 3 Image (a) is a schematic diagram showing the falling edge of the depression illuminated by the first light source when acquiring images of odd-numbered rows. Figure 3 (b) is a schematic diagram showing the falling edge of the depression illuminated by the second light source when acquiring images of even-numbered rows. Figure 3 (c) in the diagram shows the first light source illuminating the rising edge of the depression when acquiring images of odd-numbered rows. Figure 3 (d) in the figure is a schematic diagram of the second light source illuminating the rising edge of the depression when the image of an even number of rows is acquired.

[0123] In this embodiment, by comparing the brightness of the first region and the second region, if a complementary region with consistent outlines is found, it can be indicated that there is a protrusion or depression on the surface of the wood board to be tested, thus realizing the detection of defects.

[0124] In a preferred embodiment, the method further includes calculating the average brightness of the second odd-numbered rows of images to obtain a first average brightness; and calculating the average brightness of the second even-numbered rows of images to obtain a second average brightness.

[0125] The first normal brightness range is determined based on the first average brightness value, and the second normal brightness range is determined based on the second average brightness value.

[0126] If there exists a region where the first brightness difference value is less than the standard difference value, the brightness of the region corresponding to the first odd-numbered row of the image is not within the first normal brightness range, and the brightness of the region corresponding to the first even-numbered row of the image is not within the second normal brightness range, then it is determined that there is a stain on the wooden board to be tested.

[0127] In this embodiment, if there are no areas with large brightness differences in the first odd-numbered row image and the first even-numbered row image, but there are areas with brightness that deviates significantly from the normal brightness range, it indicates the presence of stains, such as mold or oil stains.

[0128] Based on the above method embodiments, the present invention provides corresponding system embodiments;

[0129] like Figure 4 As shown, an embodiment of the present invention provides a wood board defect detection system, including: an image acquisition controller, at least one camera, and at least two light sources; the two light sources are a first light source and a second light source, respectively; the camera is arranged perpendicular to the surface of the wood board to be tested; the first light source and the second light source are arranged symmetrically with respect to the camera;

[0130] An image acquisition controller is used to control the first light source and the second light source to alternately tilt and illuminate the surface of the wooden board to be tested;

[0131] The camera is used to acquire the first odd-numbered rows of images of the surface of the wooden board under the illumination of the first light source and the first even-numbered rows of images under the illumination of the second light source.

[0132] The image controller is also used to compare the brightness differences of pixels at the same position in the first odd-numbered row image and the first even-numbered row image to generate a brightness difference map;

[0133] The first brightness difference value corresponding to each pixel in the brightness difference map is compared with the standard difference value. The area where the first brightness difference value is greater than the standard difference value is taken as the first defect candidate area.

[0134] Based on the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row image and the first even-numbered row image, the defect type of the wooden board to be tested is determined; wherein, the image features include any one or a combination of the following: brightness and contour shape.

[0135] Preferably, the surface of the wooden board to be tested is fixed with circular protrusions for positioning; the camera is a line scan camera;

[0136] The image acquisition controller is further configured to extract the first protrusion region where the circular protrusion is located in the first odd-numbered row image and the second protrusion region where the circular protrusion is located in the first even-numbered row image before comparing the brightness differences of pixels at the same position in the first odd-numbered row image and generating a brightness difference map.

[0137] Calculate the horizontal gradient of brightness in the bright area of ​​the first raised region, and take the point with the maximum absolute value of the gradient as the first light-dark boundary.

[0138] Calculate the horizontal gradient of brightness in the bright area of ​​the second raised region, and take the point with the maximum absolute value of the gradient as the second light-dark boundary.

[0139] Calculate the distance between the first and second light-dark boundaries;

[0140] The theoretical fixed spacing is calculated based on the height of the circular protrusion, the tilt angle of the first or second light source, and the pixel resolution of the line scan camera.

[0141] Calculate the translation amount based on the boundary spacing and the theoretical fixed spacing;

[0142] Align the first odd-numbered row of images with the first even-numbered row of images based on the translation amount.

[0143] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method of wood board defect detection, characterized by, The method comprises the following steps: controlling a camera perpendicular to the surface of a wood board to be tested to capture first odd-numbered row images of the surface of the wood board to be tested under illumination of a first light source and first even-numbered row images of the surface of the wood board to be tested under illumination of a second light source; wherein the first light source and the second light source are symmetrically arranged with the camera as a reference, and the first light source and the second light source alternately irradiate the surface of the wood board to be tested at an angle; wherein the surface of the wood board to be tested is fixed with a circular protrusion for positioning; and the camera is a linear array camera; extracting a first protrusion region in which the circular protrusion is located in the first odd-numbered row images and a second protrusion region in which the circular protrusion is located in the first even-numbered row images; performing horizontal direction gradient calculation on the bright area of the protrusion in the first protrusion region, and taking the position with the maximum gradient absolute value as a first light-dark boundary; performing horizontal direction gradient calculation on the bright area of the protrusion in the second protrusion region, and taking the position with the maximum gradient absolute value as a second light-dark boundary; calculating the boundary interval of the first light-dark boundary and the second light-dark boundary; calculating a theoretical fixed interval according to the height of the circular protrusion, the angle of the first light source or the second light source, and the pixel resolution of the linear array camera; calculating a translation amount according to the boundary interval and the theoretical fixed interval; and aligning the first odd-numbered row images and the first even-numbered row images according to the translation amount; comparing the brightness difference of the pixel points at the same position in the first odd-numbered row images and the first even-numbered row images to generate a brightness difference image; comparing the first brightness difference value corresponding to each pixel point in the brightness difference image with a standard difference value, and taking the region with the first brightness difference value greater than the standard difference value as a first defect candidate region; wherein the determination of the standard difference value comprises: under the same illumination condition, acquiring second odd-numbered row images and second even-numbered row images corresponding to a defect-free wood board region; comparing the brightness difference of the corresponding pixels in the second odd-numbered row images and the second even-numbered row images to determine a second brightness difference value; and generating a difference value distribution according to each second brightness difference value; taking the quantile number of a preset position in the difference value distribution as the standard difference value; determining the defect type of the wood board to be tested according to the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row images and the first even-numbered row images; wherein the image features include any one or a combination of the following: brightness and contour shape; wherein determining the defect type of the wood board to be tested according to the image features of the corresponding regions of the first defect candidate region in the first odd-numbered row images and the first even-numbered row images comprises: taking the region corresponding to the first defect candidate region in the first odd-numbered row images as a first region, and taking the region corresponding to the first defect candidate region in the first even-numbered row images as a second region; comparing the first region and the second region, if the first region and the second region present a light-dark complementary contour, and the first region presents left bright and right dark, and the second region presents left dark and right bright, it is determined that the wood board to be tested has a protrusion; if the first region and the second region present a light-dark complementary contour, and the first region presents left dark and right bright, and the second region presents left bright and right dark, it is determined that the wood board to be tested has a depression.

2. A method of wood board defect detection according to claim 1, characterized in that, It also comprises the following steps: calculating the brightness average value of the second odd-numbered row images to obtain a first brightness average value; calculating the brightness average value of the second even-numbered row images to obtain a second brightness average value; The first normal brightness interval is determined according to the first brightness mean value, and the second normal brightness interval is determined according to the second brightness mean value; If the first brightness difference value corresponding to a region is less than the standard difference value, the brightness of the region corresponding to the first odd row image is not in the first normal brightness interval, and the brightness of the region corresponding to the first even row image is not in the second normal brightness interval, it is determined that the wood board to be tested has a stain.

3. A method of wood board defect detection according to claim 2, c h a r a c t e r i z e d in that Before comparing the brightness difference of the pixel points at the same position of the first odd row image and the first even row image to generate the brightness difference map, the method further comprises: Performing brightness normalization processing on the first odd row image and the first even row image to obtain the first odd row image after brightness normalization and the first even row image after brightness normalization; The brightness normalization processing comprises: For any image to be normalized, the global average brightness of the image to be normalized is calculated; The difference between the global average brightness and the target average brightness is calculated to obtain a brightness compensation value; The image to be normalized is compensated for brightness according to the brightness compensation value to obtain an image after brightness compensation; The brightness extreme value of the image after brightness compensation is calculated, and the brightness value of each pixel point in the image after brightness compensation is mapped to a preset brightness standard interval according to the brightness extreme value to obtain an image after brightness normalization; The target average brightness corresponding to the first odd row image and the first even row image is consistent.

4. The method of claim 1, wherein the step of detecting a defect in the wood board is characterized by, After aligning the first odd row image and the first even row image according to the translation amount, the method further comprises: The interval distance of the light-dark boundary in the aligned first odd row image and the first even row image is calculated to obtain a corrected interval distance; If the difference between the corrected interval distance and the theoretical fixed interval distance is greater than a preset difference value, a prompt information for checking the camera setting position and the light source setting position is generated.

5. The method of claim 1, wherein the step of detecting a defect in the wood board is characterized by, The inclination angles of the first light source and the second light source are both 45°.

6. A system for detecting defects in a wood board, characterized by Comprise: An image acquisition controller, at least one camera, and at least two light sources; the two light sources are a first light source and a second light source respectively; the camera is arranged vertically to the surface of the wood board to be tested; the first light source and the second light source are symmetrically arranged with the camera as a reference; The image acquisition controller is configured to control the first light source and the second light source to alternately and obliquely irradiate the surface of the wood board to be tested; The camera is configured to acquire a first odd row image of the surface of the wood board to be tested under the irradiation of the first light source and a first even row image under the irradiation of the second light source; The image acquisition controller is further configured to execute the wood board defect detection method of claim 1.

Citation Information

Patent Citations

  • On-line detection method for continuous plate blank surface crack

    CN101644684A

  • Computer visual defect detection system and method on electric control board production line

    CN121120584A