Intelligent veneer sorting method and system and medium
By using a material feeding recognition model and a deep learning model to identify the direction, quantity, and location of veneer, as well as image enhancement processing, the problem of veneer classification and detection has been solved, achieving efficient and accurate sorting results.
Patent Information
- Application Number
- CN202411492700.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-24
- Publication Date
- 2025-01-21
AI Technical Summary
Existing technologies are difficult to classify and test thin wood veneers with a thickness of less than 0.6 mm efficiently and accurately, and they are easily damaged during the loading process.
The material feeding identification model identifies the direction, quantity, and location of the veneer, while a deep learning model detects defects. Combined with image enhancement processing, this achieves accurate material feeding and efficient grading.
It enables precise feeding of thin wood veneers and efficient and accurate defect detection, improving sorting efficiency and accuracy.
Smart Images

Figure CN119327749A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of veneer detection methods, and in particular to a thin veneer intelligent sorting method, system and medium. Background Art
[0002] Veneer is a thin piece of wood cut from a cylindrical piece of wood. It is widely used in the veneer decoration of furniture and other products. It is a thin wooden veneer or veneer material with tree species characteristics. After the production of veneer, it needs to be inspected and graded to select qualified veneer for use. There are few studies on wood cortex inspection based on machine vision abroad. The existing data only shows that foreign laboratories use industrial machine vision technology to grade the size of wood shavings and determine the proportion of various shavings in the board and the arrangement direction of shavings. Domestic wood cortex inspection mainly relies on manual visual inspection. Therefore, domestic intelligent veneer sorting is a very promising machine vision application field. Especially for thin veneer with a thickness of less than 0.6mm, on the one hand, it cannot meet the needs of classification and inspection. On the other hand, during inspection, due to the extremely thin veneer, it is easy to cause damage during feeding inspection. Summary of the invention
[0003] In order to overcome the above-mentioned shortcomings, the object of the present invention is to provide a thin veneer intelligent sorting method, system and medium, which can accurately feed relatively thin veneer and detect various defects to grade the veneer.
[0004] In order to achieve the above purpose, the technical solution adopted by the present invention is: a veneer intelligent sorting method, comprising: Acquire a first image of a group of veneers to be loaded on the uppermost layer; Inputting the first image into a preset loading recognition model to recognize the direction, quantity and position of the veneer to be loaded and outputting the veneer recognition result; According to the veneer identification result, the qualified veneer to be loaded is placed on the testing line in the specified direction as the veneer to be tested; Acquire a second image of the wood veneer to be tested; Performing enhancement processing on the second image to obtain an enhanced image; Input the enhanced image into the deep learning model for defect recognition and output the defect recognition results; The grade comparison is carried out according to the defect identification results to obtain the final grade of the tested veneer. The beneficial effects of the present invention are: The loading identification model is used to identify the position of the veneer to be loaded, ensuring the accuracy of the veneer loading, in preparation for the subsequent testing and grading steps; Through enhanced processing, a second image can meet the detection of all defects; The deep learning model can detect all set defects through advance training; It can adaptively grade veneer according to defect standards, achieving high-efficiency and high-precision veneer sorting.
[0005] Specifically, inputting the first image into a preset loading recognition model to recognize the direction, quantity and position of the veneer to be loaded and outputting the veneer recognition result specifically includes: The detection network yolov8 is used to identify the direction of the veneer to be loaded in the first image; Determine whether the direction of the veneer to be loaded is the set direction; If yes, the first image is used as the image to be identified, and the image to be identified is used to identify the quantity and position of the veneer to be loaded through the detection network yolov8; Compare the position of the veneer to be loaded with a set threshold to determine whether the veneer to be loaded has serious displacement; If not, a first instruction is issued and the newly acquired first image is recognized; if so, a second instruction is issued and an alarm is given. Further, when it is determined that the direction of the veneer to be loaded is not the set direction, the veneer to be loaded is rotated to the set direction, and a rotated image after rotation is obtained as the image to be recognized.
[0006] Further, the detection network yolov8 is used to identify the direction of the veneer to be loaded in the first image, specifically including: Based on the detection network yolov8, the veneer to be loaded on the first image is extracted to obtain feature maps of different sizes; Use the long edge definition method to represent the rotation detection box in the feature map; In the box regression task, binary coding labeling technology is used to transform the angle regression problem into an angle classification problem to obtain the direction of the veneer to be loaded.
[0007] Further, performing enhancement processing on the second image to obtain an enhanced image specifically includes: The second image is copied into three images, and the three second images are respectively subjected to image deexposure and contrast enhancement algorithms, histogram equalization, and gamma correction to form three enhanced images.
[0008] Furthermore, the defect identification results include the categories and corresponding sizes of all defects. The defect categories include: Defect class: Defect recognition of defect class uses an enhanced image processed by image de-exposure and contrast enhancement algorithm, and this enhanced image is segmented to ensure that the downsampling ratio is close to 1 before being input into the deep learning model; Color class, color defect recognition uses two enhanced images processed by histogram equalization and gamma correction.
[0009] Furthermore, the deep learning model uses the yolov8 detection framework, and the deep learning model uses an uncertainty loss function for constraints during training.
[0010] Furthermore, the final grade of the tested veneer is obtained by comparing the grades according to the defect identification results, including: Load defect criteria; Summarize the defect detection results of a veneer to be tested, compare the defect results with the defect standard, and obtain the defect level of each defect; The defect levels are summed up and the lowest defect level is taken as the final grade of the tested veneer.
[0011] The present invention also discloses a veneer intelligent sorting system, which adopts the veneer intelligent sorting method. The veneer intelligent sorting system includes a feeding device and a detection device: The loading device includes a first visual inspection mechanism, a first controller and a transport mechanism. The visual inspection mechanism is used to obtain a first image of a group of veneers to be loaded on the top layer. The first controller identifies the direction, quantity and position of the veneers to be loaded according to the first image and outputs the veneer identification result. The transport mechanism places the qualified veneers to be loaded on the inspection device in a specified direction as the veneers to be tested according to the veneer identification result. The detection device includes a detection line, a second visual detection mechanism and a second controller. The detection line is used to transmit the veneer to be tested. The second visual detection mechanism is used to obtain a second image of the veneer to be tested. The second controller includes a preprocessing module, a defect detection module and a grading module. The preprocessing module is used to enhance the second image to obtain an enhanced image. The defect detection module identifies defects in the enhanced image through a built-in deep learning model and outputs a defect identification result. The grading module compares the grades according to the defect identification result to obtain the final grade of the veneer to be tested.
[0012] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the above-mentioned veneer intelligent sorting method are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 The process of the first embodiment of the present invention Figure 1 ; Figure 2 The process of the first embodiment of the present invention Figure 2 ; Figure 3 The process of the first embodiment of the present invention Figure 3 ; Figure 4 The process of the first embodiment of the present invention Figure 4 ; Figure 5 The process of the first embodiment of the present invention Figure 5 ; Figure 6 is a system block diagram of Embodiment 2 of the present invention; Figure 7 It is a structural schematic diagram of a feeding device in Embodiment 2 of the present invention; Figure 8 It is a schematic diagram of the structure of the detection device in the second embodiment of the present invention. DETAILED DESCRIPTION
[0014] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings so that the advantages and features of the present invention can be more easily understood by those skilled in the art, thereby making a clearer and more definite definition of the protection scope of the present invention.
[0015] Embodiment 1 See attached Figure 1 As shown, a veneer intelligent sorting method of the present invention comprises: S100, a loading step, placing the veneer to be loaded onto the testing line in a specified direction as the veneer to be tested.
[0016] S200, a detection and grading step, performing visual inspection on the veneer to be tested to obtain a final grade of the veneer to be tested.
[0017] See attached Figure 2 As shown, the loading steps include: S1. Obtain a first image of a group of veneers to be loaded on the top layer.
[0018] S2. Input the first image into a preset loading recognition model to recognize the direction, quantity and position of the veneer to be loaded and output the veneer recognition result.
[0019] S3. According to the veneer identification result, the qualified veneer to be loaded is placed on the detection line in a specified direction as the veneer to be tested.
[0020] In this embodiment, because the veneer is thin with a thickness of less than 0.6 mm, stable and accurate feeding of this veneer is the basis for the subsequent detection and grading steps. Therefore, a feeding step is required to identify the veneer to be fed, remove abnormal wood objects to be fed, and improve the feeding accuracy.
[0021] In this embodiment, see the attached Figure 7As shown in the figure, wooden products are usually stacked horizontally and vertically on pallets, and veneers are stacked in 6 rows and 6 columns in a "well" shape on empty pallets, with a spacing of 2 cm between each layer of veneer to form a stack. Among them, the stacking height of a layer of veneer is about 10 cm, and with 10 layers, the height of a stack of veneer is about 1m. This stack of veneer is transported to the loading station by a forklift, because the inspection and grading step needs to detect whether there are defects on each piece of veneer (the veneer is extremely thin, and the characteristics of the front and back sides are the same, so the front and back sides of the veneer are not distinguished), so each piece of veneer needs to be accurately loaded.
[0022] Therefore, in this embodiment, each group of veneers to be loaded on the top layer is photographed, and a loading identification model is added to identify the direction, quantity and position of the veneers to be loaded. Only when the direction, quantity and position are qualified can the veneers with normal veneer identification results be loaded through the conveying mechanism. Only then can it be ensured that the veneers are placed on the designated position on the inspection line, providing a basis for subsequent inspection and grading steps.
[0023] See attached Figure 3 As shown, the first image is input into a preset loading recognition model to identify the direction, quantity and position of the veneer to be loaded and output the veneer recognition result, which specifically includes: S201, using the detection network yolov8 to identify the direction of the veneer to be loaded in the first image.
[0024] Directions usually include horizontal (X direction) and vertical (Y direction).
[0025] S202, determining whether the direction of the veneer to be loaded is the set direction.
[0026] In this embodiment, the direction is set to be vertical.
[0027] S203: If yes, use the first image as the image to be recognized.
[0028] At this time, the veneer does not need to be turned, and the quantity and position of the veneer to be loaded can be directly identified.
[0029] S204: If not, rotate the veneer to be loaded to a set direction, and obtain a rotated image as an image to be recognized.
[0030] At this time, the veneer to be loaded is distributed horizontally, and the machine needs to be rotated 90° to re-acquire the image.
[0031] S205, the image to be identified is used to identify the quantity and position of the veneer to be loaded through the detection network yolov8.
[0032] Ideally, since the thickness of each pile of veneer is about 10cm, the number of sheets is consistent. However, due to the different moisture content of the veneer, the fluffiness is different, and the number of sheets in each column of veneer is not completely consistent. Therefore, it is necessary to identify the number of veneers to be loaded on the top layer before intelligent loading can be achieved. When Yolov8 identifies the veneer in the image to be identified, it will get the position of the veneer. Through the post-processing algorithm, the number of valid positions (mainly the number of veneers on the pallet area in the image to be identified, the pallet position is fixed relative to the machine, so the position is known information) can be counted to get the number of veneers.
[0033] In this implementation, the number of identifications can provide a strong constraint for the subsequent position identification. The identification of the veneer position is usually interfered by the environment. By constraining the accuracy of the veneer position by the number of veneers, the situation where the veneer position is incorrectly identified due to interference can be eliminated. If the number of veneers is 3 and 4 veneer positions are detected, then one position is an interference item. In this case, the interference item can be removed by calculating the intersection and union ratio of the 4 veneer positions.
[0034] If the machine does not need to be rotated, the number of veneers can be directly identified; if the machine needs to be rotated 90°, it is necessary to take a bird's-eye view of the rotated veneer again and then identify the number of veneers.
[0035] S206: Compare the position of the veneer to be loaded with a set threshold value to determine whether the veneer to be loaded has serious displacement.
[0036] After knowing the position of the veneer, compare the position with the offset of the pallet in the longitudinal direction, and set the threshold to determine whether the veneer is longitudinally disordered; because the veneer width is a fixed value, if the width value of the veneer position is particularly large (the value is determined by setting the threshold), it means that the veneer is horizontally disordered. If the veneer is disordered in the horizontal and vertical directions, even if the feeding signal is given, the mechanism cannot feed the veneer correctly, affecting subsequent detection. Therefore, it is necessary to determine the position of the veneer to be fed here.
[0037] S207: If not, issue a first instruction and perform recognition on the newly acquired first image.
[0038] That is, the process returns to step S201 until all the veneers are loaded.
[0039] S208: If yes, issue a second instruction and sound an alarm.
[0040] The first instruction is 1, and the second instruction is 0. If there are veneers in all 6 columns on the upper surface, the returned results are all 1 (if there are 6 columns of veneers, return [1, 1, 1, 1, 1, 1]). If there is no veneer at any position or the veneer position is seriously offset, the corresponding position returns the result 0 (for example, there is no veneer at the second position, and the veneer at the third position is seriously offset, return [1, 0, 0, 1, 1, 1]). When the transport mechanism receives the first instruction, it transports the veneer to be loaded at the corresponding position; when the transport mechanism receives the second instruction, it does not transport it, and an alarm is triggered to remind the workers to sort it out.
[0041] Through the above loading steps, the loading of all the veneers to be loaded on the pallet is completed.
[0042] In this embodiment, the loading recognition model can detect veneers with rotation angles. Although veneers have their own inherent stacking rules, in actual applications, the stacked veneers are not completely symmetrical. In addition, due to the imaging characteristics of overhead imaging, the near is larger and the far is smaller (the area directly below the camera is closest to the camera), the veneers at the edge and the center are slightly distorted. Under the influence of these two factors, the veneer tends to incline more, and the detection network in the conventional loading recognition model usually only detects the minimum bounding box of the target, which includes too much background information and affects the determination of the veneer direction.
[0043] Therefore, in one embodiment, using the detection network yolov8 to identify the direction of the veneer to be loaded in the first image specifically includes: extracting feature maps of different sizes from the veneer to be loaded on the first image based on the detection network yolov8; using the long edge definition method to represent the rotation detection frame in the feature map; using binary coding labeling technology in the box regression task to convert the angle regression problem into an angle classification problem, and obtaining the direction of the veneer to be loaded.
[0044] The long side definition method refers to adding an angle parameter to the original target frame parameters to indicate the rotation of the frame. The angle range is -90° to 90°. Angle regression into angle classification means: defining the angle range, such as classifying one degree as one category; then using classification loss to measure the angle distance between the prediction result and the label; thus regressing the angle of the veneer, and then obtaining the direction of the veneer. This improves the accuracy of the direction recognition of the veneer to be loaded.
[0045] See attached Figure 4 As shown, the detection and grading steps include: S4. Acquire a second image of the veneer to be tested.
[0046] After the veneer is accurately and intelligently loaded, it is necessary to clearly image the surface features of the veneer. Clear imaging is the basis for ensuring high detection accuracy.
[0047] S5. Perform enhancement processing on the second image to obtain an enhanced image.
[0048] There are as many as 17 types of defects that need to be detected, including detached knots, cracked knots, edge knots, transverse knots, wormholes, cracks, bark insertion, dead knots, live knots, blue stains, stripe marks, color difference, penetration, mineral lines, white edges and color classification. It is difficult to clearly image all 17 defects by using only fixed parameter light sources and cameras. If defects such as detached knots and dead knots are clearly photographed, the white edges and colors cannot be well imaged, which is manifested as the light, medium and dark colors of the veneer cannot be distinguished; if the white edges and color differences are clearly photographed, the exposure time of the line scan camera needs to be increased, and the image will be slightly overexposed, resulting in the loss of defect information such as detached knots and dead knots. If a set of visual acquisition mechanisms is added and images under different parameters are used, the cost will be greatly increased. Therefore, in this embodiment, a second visual detection mechanism is used to capture the second image, but the defect features are enhanced by an image processing algorithm to form an enhanced image for easy defect detection.
[0049] Performing enhancement processing on the second image to obtain an enhanced image specifically includes: The second image is copied into three images. One of the second images is used to form the first enhanced image through image de-exposure and contrast enhancement algorithm. Image de-exposure technology is mainly used to reduce the exposure of the image. By identifying the brightness value of the image, the over-bright area is restored with a lower brightness value. Contrast enhancement technology is based on de-exposure to highlight the characteristics of defects and make the defective areas more obvious. The first enhancement is used to detect 15 types of defects in veneer (including detached knots, cracked knots, edge knots, transverse knots, insect eyes, cracks, bark insertion, dead knots, live knots, blue stains, strip marks, color difference, penetration, and mineral lines). A second image is formed into a second enhanced image through histogram equalization. The second enhanced image is used for the detection of white edge defects. The histogram equalization technology directly acts on the original image to highlight the difference between white edge and non-white edge areas. A third image is formed into a third enhanced image through Gamma correction. The third enhanced image is used for color detection. Gamma correction improves the distinction between light, medium and dark colors of veneer by performing nonlinear brightness transformation on the image. White edge and color are two color defects of veneer. For color defects, histogram equalization technology and gamma correction technology are used to adjust the overall brightness of the image, making the bright areas brighter and the dark areas darker, thereby improving the accuracy of white edge and color recognition.
[0050] In view of the situation where only one set of visual acquisition mechanisms is provided, in this embodiment, different enhancement processing is added to the second image to form different enhanced images to meet different defect detection requirements.
[0051] S6. Input the enhanced image into the deep learning model for defect recognition and output the defect recognition result.
[0052] Based on the definition of defects, the deep learning model is fully trained on the unique features of 17 defects, which enables the model to have strong defect recognition capabilities and a certain generalization ability on similar features. The defect recognition results include all defect types and defect sizes.
[0053] The deep learning model will integrate the defect recognition results. For example, if a picture identifies 3 dead knots and 2 live knots, the general deep learning algorithm outputs the result as [dead knot 1, dead knot 2, dead knot 3, live knot 1, live knot 2]. This output is not conducive to the subsequent defect classification (defect classification needs to be divided into different levels according to the number, size and other information of the defects). Therefore, in this embodiment, we integrate the defect recognition results of the deep learning model into [dead knots: size 1, size 2, size 3; live knots: size 1, size 2].
[0054] The deep learning model is used to identify the presence of white edges and calculate the width of the white edges. The white edge defect recognition result output is integrated into [white edge: width 1, width 2]; for color classification, the deep learning model is used to identify the light, medium, and dark colors of the veneer, and the color classification results are integrated into [color: light] or [color: medium] or [color: dark].
[0055] In this embodiment, the recognition results of white edges and colors will be integrated into the results of the defect category, such as the defect recognition result is [dead knot: size 1; live knot: size 1], the white edge recognition result is [white edge: width 1, width 2], and the color recognition result is [color: light]. The deep learning model is finally integrated to form the final defect recognition result of [dead knot: size 1; live knot: size 1; white edge: width 1, width 2; color: light]. The integrated defect recognition result includes detailed information of the defect, and this integrated defect information provides a strong basis for defect classification.
[0056] In one embodiment, in order not to lose the detection accuracy, the first enhanced image used for defect detection is divided into two images, and the image is divided into two images along the midline of the long side of the first enhanced image to form two images (each containing half of the veneer), and the defects on each image are identified respectively, and finally the defect recognition results of the two images are combined. Because the input of the deep learning model is a fixed-size image, the image is usually downsampled when it is calculated by the deep learning model (the image is encoded into an input size supported by the deep learning network). Since the larger the input image, the higher the downsampling ratio, and the downsampling process will cause serious defect loss, we crop the veneer image along the long side to make the downsampling ratio as close to 1 as possible, without losing defect information, and ensuring the accuracy of defect recognition. If the recognition result of image 1 is [dead knot: size 1; live knot: size 1], the recognition result of image 2 is [dead knot: size 1; live knot: size 1], the combined result is [dead knot: size 1, size 2; live knot: size 1, size 2].
[0057] The deep learning model uses the yolov8 detection framework, and the deep learning model uses uncertainty loss functions for constraints during training. We use the yolov8 detection framework to detect 15 types of defects. Due to the inherent uncertainty in the model, such as the imbalance of the amount of data in each class, the confidence in the data that the model has not seen will be very low. This phenomenon has a special term, called "epistemic uncertainty". In model training, the loss constraint of the yolov8 network uses a unified hyperparameter to weight the losses of multiple subtasks. The model weights obtained in this way usually perform well on classes with a large amount of data, but perform generally on classes with a small amount of data. Therefore, in order to solve this problem, we introduced uncertainty loss in the detection network, aiming to ensure that the optimization of certain tasks does not affect the optimization of other tasks.
[0058] Taking two tasks as an example to introduce uncertainty loss, the uncertainty loss function is as follows:
[0059] Assuming that the model output consists of two vectors y1 and y2 and obeys Gaussian distribution, the optimization goal of uncertainty loss is .in, represents the loss of the first output variable y1, Represents the loss of the second output variable y2, parameter , Equivalent to the adaptive weight of loss based on data, when When increasing (the noise of variable y1), As the weight decreases, the corresponding noise decreases, and the corresponding loss weight increases. It acts as a regulator of noise and suppresses excessive increase of noise. In this way, the loss items of different tasks are correctly weighted, which can overcome problems such as data imbalance in real application scenarios and improve the detection accuracy of multiple types of defects.
[0060] S7. Perform grade comparison according to the defect identification results to obtain the final grade of the tested veneer.
[0061] See attached Figure 5 , step S7 specifically includes: S701. Load defect standards.
[0062] Defect standards are defined by customers. These standards are external parameters and are variable for grade comparison, so they can be adaptively compatible with multiple customer standards.
[0063] For example, taking knots as an example, veneers with ≤2 knots and knot diameter ≤10mm are classified as Grade 1; veneers with ≤3 knots and a diameter between 10mm and 15mm are classified as Grade 2. Taking white edges as an example, veneers with a white edge width of <1cm are classified as Grade 1. Taking color as an example, light colors are classified as Grade 1, medium colors are classified as Grade 2, and dark colors are classified as Grade 3.
[0064] S702, summarizing defect detection results of a veneer to be tested, comparing the defect results with defect standards, and obtaining a defect grade of each defect.
[0065] The identified defect detection results are traversed in the defect standard to determine which level the current defect identification result corresponds to. Unidentified defects are not traversed, which saves running time.
[0066] For example, if the defect recognition result is [dead knot: size 1, size 2, size 3; live knot: size 1, size 2], the dead knot level standard and live knot level standard are traversed according to the defect recognition result. First, it is assumed that the total number of dead knots is 3 and it is determined to be level 2. Secondly, it is determined to be level 1 according to the size of the 3 dead knots. Then the final dead knot is determined to be level 2; it is assumed that the total number of live knots is 2 and it is determined to be level 1; it is assumed that the size of the 2 live knots is determined to be level 1, then the final live knot is determined to be level 1. Finally, the defect levels of dead knots and live knots are combined to obtain the level of each type of defect [dead knot: level 2; live knot: level 1]. It should be noted that each type of defect here corresponds to only one final level, and the lower level shall prevail.
[0067] S703, sum up the defect levels, and use the lowest defect level as the final level of the tested veneer.
[0068] The grading results of the 17 types of defects are summarized to obtain the final grade of the veneer. For example, if the grade results of each type of defect are [dead knot: grade 2; live knot: grade 1; cracked knot: grade 3; color difference: grade 4; white edge: grade 3; color: grade 2], adhering to the principle of grading by the lowest grade, the final grade of this wood product is 4.
[0069] In this embodiment, the position of the veneer to be loaded is identified through the loading step to ensure the accuracy of the veneer loading, so as to prepare for the subsequent detection and grading steps. The detection and grading step can detect 17 types of defects through a deep learning model, and can adaptively grade the veneer according to the defect standards, thereby achieving high-efficiency and high-precision veneer sorting.
[0070] Embodiment 2 The present invention also discloses a veneer intelligent sorting system, which adopts the veneer intelligent sorting method of embodiment 1, and Figure 6As shown, the veneer intelligent sorting system includes a feeding device and a detection device. The feeding device performs a feeding step, and the detection device performs a detection and grading step.
[0071] See attached Figure 7 As shown, the loading device includes a first visual inspection mechanism, a first controller and a conveying mechanism. The visual inspection mechanism is used to obtain a first image of a group of veneers to be loaded on the top layer. The first controller stores a loading recognition model, recognizes the direction, quantity and position of the veneers to be loaded according to the first image and outputs the veneer recognition result. The conveying mechanism places the qualified veneers to be loaded on the inspection device in a specified direction as the veneers to be tested according to the veneer recognition result.
[0072] See attached Figure 7 As shown, the feeding device also includes a rotating machine, and the stacked veneers are stored on the rotating machine. When it is identified that the veneers are in the wrong direction, the rotating machine drives the veneers to rotate.
[0073] See attached Figure 6 As shown, the detection device includes a detection line, a second visual detection mechanism and a second controller. The detection line is used to transmit the veneer to be tested. The second visual detection mechanism is used to obtain a second image of the veneer to be tested. The second controller includes a preprocessing module, a defect detection module and a grading module. The preprocessing module is used to enhance the second image to obtain an enhanced image. The defect detection module uses a built-in deep learning model to identify defects in the enhanced image and outputs a defect identification result. The grading module compares the grades according to the defect identification result to obtain the final grade of the veneer to be tested.
[0074] See attached Figure 8 As shown, the detection line is a transmission line, and the width of the detection line is related to the number of veneers that the transport mechanism can transport at one time. In this embodiment, the transport mechanism can load up to 6 veneers to be tested at one time, so the width of the detection line needs to be able to accommodate 6 veneers to be tested and transported simultaneously.
[0075] In this embodiment, in order to collect a second image with high precision, see the attached Figure 8 As shown, the second visual inspection mechanism for collecting the second image includes a long strip light source and a linear camera. The length of the long strip light source is consistent with the width of the detection line, and can illuminate 6 pieces of veneer to be tested at the same time. The line scan camera scans and shoots 6 pieces of veneer. The selected line scan camera fully considers the minimum accuracy of veneer defects, leaving a certain margin for the calculation of subsequent algorithms. The field of view of the line scan camera is adjusted to be consistent with the width of the detection belt, so that there will be no missed shots due to insufficient field of view during scanning and shooting. In addition, the line scan camera can set the corresponding acquisition frequency according to the rotation speed of the detection belt, and can clearly image the veneer at different speeds to adapt to actual application scenarios.
[0076] It should be understood that the disclosed system can be implemented in other ways. For example, the division of the modules described above is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The above modules may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the embodiment of the present invention.
[0077] Embodiment 3 The present invention discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the veneer intelligent sorting method in the first embodiment are implemented.
[0078] Based on such understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing related hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of each of the above-mentioned method embodiments when executed by a processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0079] The above implementation modes are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with this technology to understand the content of the present invention and implement it, and they cannot be used to limit the protection scope of the present invention. Any equivalent changes or modifications made according to the spirit of the present invention should be included in the protection scope of the present invention.
Claims
1. A veneer intelligent sorting method, characterized by: include: Acquire a first image of a group of veneers to be loaded on the uppermost layer; Inputting the first image into a preset loading recognition model to recognize the direction, quantity and position of the veneer to be loaded and outputting the veneer recognition result; According to the veneer identification result, the qualified veneer to be loaded is placed on the detection line in a specified direction as the veneer to be tested; Acquire a second image of the veneer to be tested; performing enhancement processing on the second image to obtain an enhanced image; Inputting the enhanced image into a deep learning model for defect recognition, and outputting a defect recognition result; A grade comparison is performed according to the defect identification result to obtain a final grade of the veneer to be tested.
2. The veneer intelligent sorting method according to claim 1, characterized in that: Inputting the first image into a preset loading recognition model to recognize the direction, quantity and position of the veneer to be loaded and outputting the veneer recognition result specifically includes: Using the detection network yolov8 to identify the direction of the veneer to be loaded in the first image; Determining whether the direction of the veneer to be loaded is a set direction; If yes, the first image is used as the image to be identified, and the image to be identified is used to identify the quantity and position of the veneer to be loaded through the detection network yolov8; Comparing the position of the veneer to be loaded with a set threshold value to determine whether the veneer to be loaded has serious displacement; If not, a first instruction is issued and the newly acquired first image is recognized; if so, a second instruction is issued and an alarm is given.
3. The veneer intelligent sorting method according to claim 2, characterized in that: When it is determined that the direction of the veneer to be loaded is not the set direction, the veneer to be loaded is rotated to the set direction, and a rotated image after rotation is obtained as the image to be recognized.
4. The veneer intelligent sorting method according to claim 2, characterized in that: Using the detection network yolov8 to identify the direction of the veneer to be loaded in the first image specifically includes: Based on the detection network yolov8, the veneer to be loaded on the first image is extracted to obtain feature maps of different sizes; Using the long edge definition method to represent the rotation detection box in the feature map; In the box regression task, binary coding labeling technology is used to transform the angle regression problem into an angle classification problem to obtain the direction of the veneer to be loaded.
5. The veneer intelligent sorting method according to claim 1, characterized in that: Performing enhancement processing on the second image to obtain an enhanced image specifically includes: The second image is copied into three images, and the three second images are respectively subjected to image deexposure and contrast enhancement algorithm, histogram equalization, and gamma correction to form three enhanced images.
6. The veneer intelligent sorting method according to claim 5, characterized in that: The defect identification result includes the categories and corresponding sizes of all defects, and the categories of the defects include: Defect class, the defect recognition of the defect class adopts an enhanced image processed by image de-exposure and contrast enhancement algorithm, and the enhanced image is segmented to ensure that the downsampling ratio is close to 1 before being input into the deep learning model; Color class: defect recognition of the color class uses the two enhanced images processed by histogram equalization and gamma correction.
7. The veneer intelligent sorting method according to claim 1, characterized in that: The deep learning model adopts the yolov8 detection framework, and the deep learning model adopts an uncertainty loss function for constraint during training.
8. The veneer intelligent sorting method according to any one of claims 1 to 7, characterized in that: Performing a grade comparison based on the defect identification result to obtain the final grade of the tested veneer specifically includes: Load defect criteria; Summarizing the defect detection results of a veneer to be tested, comparing the defect results with the defect standard, and obtaining a defect grade of each defect; The defect levels are summed up, and the lowest defect level is taken as the final level of the tested veneer.
9. An intelligent veneer sorting system, characterized by: The veneer intelligent sorting method according to any one of claims 1 to 8 is adopted, and the veneer intelligent sorting system comprises a feeding device and a detection device: The loading device comprises a first visual inspection mechanism, a first controller and a transport mechanism, wherein the visual inspection mechanism is used to obtain a first image of a group of veneers to be loaded at the top layer, the first controller identifies the direction, quantity and position of the veneers to be loaded according to the first image and outputs a veneer identification result, and the transport mechanism places the veneers to be loaded that have been identified as qualified according to the veneer identification result onto the inspection device in a specified direction as veneers to be tested; The detection device includes a detection line, a second visual detection mechanism and a second controller. The detection line is used to transmit the veneer to be tested. The second visual detection mechanism is used to obtain a second image of the veneer to be tested. The second controller includes a preprocessing module, a defect detection module and a grading module. The preprocessing module is used to enhance the second image to obtain an enhanced image. The defect detection module performs defect recognition on the enhanced image through a built-in deep learning model and outputs a defect recognition result. The grading module performs grade comparison according to the defect recognition result to obtain a final grade of the veneer to be tested.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the veneer intelligent sorting method according to any one of claims 1 to 8 are implemented.