CN117635619B - Log volume detection method and system based on machine vision - Google Patents

Log volume detection method and system based on machine vision Download PDF

Info

Publication number
CN117635619B
CN117635619B CN202410109852.8A CN202410109852A CN117635619B CN 117635619 B CN117635619 B CN 117635619B CN 202410109852 A CN202410109852 A CN 202410109852A CN 117635619 B CN117635619 B CN 117635619B
Authority
CN
China
Prior art keywords
log
image
detected
layer
detection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202410109852.8A
Other languages
Chinese (zh)
Other versions
CN117635619A (en
Inventor
张彰
吴璟
封亚辉
严文勋
蒋一昕
朱海欧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Customs Industrial Product Testing Center
Original Assignee
Nanjing Customs Industrial Product Testing Center
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing Customs Industrial Product Testing Center filed Critical Nanjing Customs Industrial Product Testing Center
Priority to CN202410109852.8A priority Critical patent/CN117635619B/en
Publication of CN117635619A publication Critical patent/CN117635619A/en
Application granted granted Critical
Publication of CN117635619B publication Critical patent/CN117635619B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image processing, in particular to a log volume detection method and system based on machine vision; when the log volume is detected by adopting the machine vision model, the log image to be detected is firstly judged, the end face part deficiency caused by cutting and the end face image part deficiency caused by shadow are distinguished, and further, the subsequent machine vision model detection is carried out by adopting different detection models, so that the accuracy of log volume detection is improved; meanwhile, as the distinguishing is carried out, the distinguishing and the detection of the images are not needed by a complex model, so that the detection steps are simplified to a certain extent, and the log volume detection efficiency is improved.

Description

Log volume detection method and system based on machine vision
Technical Field
The invention relates to the technical field of image processing, in particular to a log volume detection method and system based on machine vision.
Background
The log inspection is to perform the works of size inspection, quality assessment, grade judgment, tree species identification, wood marking and the like on logs, and log volumes are measured by a detection ruler in domestic and foreign trade, so that the result of the wood detection ruler is not only the main basis for national import and export management departments to supervise imported woods and settle trade results by domestic and foreign wood merchants, but also the key of customs inspection quarantine personnel to implement import wood inspection supervision.
The machine vision is also called computer vision, and aims to realize visual perception, identification and interpretation of a three-dimensional scene or a three-dimensional object of an objective world by using a computer, and comprises the contents of acquisition, processing, pattern identification and the like of a digital image. Machine vision has become an independent branch of artificial intelligence. While machine vision is currently not as flexible as the human eye in observing things, nor is it comparable to humans in terms of processing speed and capacity, it has the advantage of being efficient in dimensional measurements, particularly log volume measurements.
In the prior art, a technical scheme for detecting the log volume through machine vision exists, for example, chinese patent application (CN 111899296A) discloses a log volume detection method and device based on computer vision, an image processing technology and a computer vision technology are utilized to realize the function of photographing and identifying the log volume of a log stack, the log volume detection method is divided into three modules, namely, image processing, circle detection and log volume calculation, the image processing module can highlight log parts in an original picture, noise is removed, the circle detection module can extract log edges, and the log volume calculation module can be matched with the positive and negative ends of logs;
however, when the above scheme detects the log volume through machine vision, the situation that the log end face is incomplete due to log cutting and the log image contour is incomplete due to log placement inaccuracy is not considered, so that the error of the detection result is large, meanwhile, in the prior art, a complex and improved deep learning model (for example, an improved SSD model, an improved YOLO model and the like) is adopted to identify the log image with shadows, however, the complex model is extremely complex in operation, long in detection time, and whether the end face image part caused by shadows is missing or not can not be distinguished, or the end face part caused by cutting inaccuracy is missing, so that the log volume detection result is greatly deviated.
Therefore, a technical solution for improving the accuracy and efficiency of log volume detection is urgently needed in the prior art.
Disclosure of Invention
In view of this, the invention provides a log volume detection method and system based on machine vision, which effectively improves log volume detection accuracy and detection efficiency.
In order to achieve the above object, there is provided a log volume detection method based on machine vision, the method including the steps of:
s1: acquiring a log image to be detected;
s2: preprocessing the log image to be detected;
s3: judging whether shadows exist in the preprocessed log image to be detected, if not, entering S4, and if so, entering S5;
s4: detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
the deep learning model is a convolutional neural network model, and the convolutional neural network model is used for identifying a log image which only contains complete end face contours and has incomplete end face contours due to non-shadow reasons;
in the step S4, the detection of the log image to be detected by using a deep learning model specifically includes:
s4.1: establishing a sample set trained by the deep learning model;
when a sample set is selected, the selected log image does not contain shadows affecting the integrity of log contour information, and a plurality of images with partial missing log end faces are selected as the sample set;
s4.2: training the deep learning model by adopting the sample set;
s4.3: inputting a log image to be detected into the deep learning model to obtain the contour information of the log in the log image;
s5: detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
the shadow log detection model is used for identifying log images which contain defects caused by shadow reasons in the log images, and comprises the following components: a deep learning model and an incomplete end face complement model;
s6: and calculating the log volume according to the contour information obtained in the step S4 or the step S5.
Preferably, the log image is acquired by a log image acquisition system comprising: the camera is used for shooting log volume images, the tripod is used for fixing the camera, and the mobile power supply is used for supplying power for the camera; the camera is a Stereolabs binocular camera;
preferably, in S2, the preprocessing includes: image filtering processing and image graying; and filtering the log image to be detected by adopting self-adaptive filtering, and graying the log image to be detected by adopting an average value method.
Preferably, the average method is to average the red Huang Lansan component brightness value of each pixel in the log image to be detected to obtain a gray value; the specific formula is as follows:
in the method, in the process of the invention,the gray value of the pixel of the ith row, the jth column,said->For the ith row before gradation conversion, the red component luminance value of the pixel of the jth column, is>For the ith row before gradation conversion, the yellow component luminance value of the pixel of the jth column, is->The blue component luminance value of the pixel of the j-th column is the i-th row before gradation conversion.
Preferably, in S3, it is determined whether the log image to be detected has shadows by means of manual determination.
Preferably, the convolutional neural network model comprises a convolutional layer, a pooling layer, a full connection layer and an output layer; the convolution layer is used for carrying out convolution operation on the log image to be detected to obtain a characteristic image of the log image to be detected, and meanwhile, the convolution layer updates parameters of the convolution neural network model in the forward propagation and backward propagation processes;
wherein, during forward propagation, the calculation formula of each node in the convolution layer is:
wherein X is j l For figure j Zhang Tezheng, X in layer l of the convolutional layer i l-1 I Zhang Tezheng of layer 1, M, the convolution layer j A set of input feature maps, k, for participation in the operation of the layer j Zhang Tezheng map ij l B is the convolution kernel between the ith feature map of the layer 1 and the jth feature map of the layer 1 j l The bias item added in the j-th feature diagram of the first layer is provided, and f is an activation function;
the calculation formula of the back propagation is as follows:
in which W is l For the connection coefficient of layer 1 to layer 1, x l-1 Is the output characteristic diagram of the first layer-1,is the sensitivity map of the first layer relative to error, η is the learning rate.
The pooling layer is used for downsampling and reducing the size of the input feature map; the full connection layer is used for converting the feature map into a one-dimensional vector, and the output layer is used for outputting results;
preferably, in S4.1, a plurality of log images are acquired by using an industrial camera, and the log end surface contours in the log images are labeled one by using a Labelme image labeling tool, so as to form a log image sample set.
Preferably, the deep learning model of S4 is adopted to identify log contour information in the log image to be detected, then incomplete log contour information in the log contour information is screened out, and the incomplete log contour information is complemented, so that the detection of the log image with shadows is completed.
Preferably, the fitting method is adopted to complement the incomplete log contour information.
According to another aspect of the present invention, there is provided a machine vision-based raw wood volume detection system, wherein the detection system adopts the machine vision-based raw wood volume detection method described above, and the detection system includes:
the acquisition module is used for acquiring log images to be detected;
the image preprocessing module is connected with the acquisition module and is used for preprocessing the log image to be detected;
the image judging module is connected with the preprocessing module and is used for judging the log image to be detected after preprocessing and judging whether shadows exist, if not, the log image judging module enters the shadow-free log contour detecting module, and if so, the log image judging module enters the shadow log contour detecting module;
the shadow-free log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
the shadow log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
and the timber volume calculation module is connected with the shadowless log contour detection module and the shadowy log contour detection module and is used for calculating the log timber volume according to the contour information obtained by the shadowless log contour detection module or the shadowy log contour detection module.
The invention has the advantages and beneficial effects that:
when the log volume is detected by adopting the machine vision model, the log image to be detected is firstly judged, the end face part deficiency caused by cutting and the end face image part deficiency caused by shadow are distinguished, and further, the subsequent machine vision model detection is carried out by adopting different detection models, so that the accuracy of log volume detection is improved; meanwhile, as the distinguishing is carried out, the distinguishing and the detection of the images are not needed by a complex model, so that the detection steps are simplified to a certain extent, and the log detection efficiency is improved.
The method is used for identifying the log image without shadows, when a sample set is selected, the log image is selected to contain no shadows affecting the integrity of log contour information, and meanwhile, when the sample set is selected, a plurality of images with missing log end face parts are selected as the sample set; thus, the trained deep learning model has higher recognition accuracy on log images with complete contour information and log images with incomplete contour information.
Drawings
In order to more clearly illustrate the invention or the technical solutions of the prior art, the drawings used in the description of the invention or the prior art will be briefly described, it being obvious that the drawings in the description below are some embodiments of the invention, and that other drawings can be obtained from these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a log volume detection method based on machine vision according to an embodiment of the present invention.
Fig. 2 is an effect diagram of graying a log image to be detected by an average method according to an embodiment of the present invention.
Figure 3a is a schematic diagram of original image with complete profile information for each log according to an embodiment of the present invention.
Fig. 3b and 3c are schematic diagrams of log images with incomplete log profile information due to shadows according to embodiments of the present invention.
Fig. 4 is a flowchart of detecting the log image to be detected by using a deep learning model according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
An embodiment, as shown in fig. 1, provides a log volume detection method based on machine vision, the method includes the following steps:
s1: acquiring a log image to be detected;
specifically, a log image is acquired by a log image acquisition system including: the camera is used for shooting log volume images, the tripod is used for fixing the camera, and the mobile power supply is used for supplying power for the camera;
further, the camera is a stereilabs binocular camera;
when logs are customed and transported, bundles of logs with equal lengths are often piled together, and when the piled log volume is calculated, the length is known, so that the log volume can be obtained by calculating the area of the log end face; in the embodiment, the log image to be detected is obtained as a log end face image.
S2: preprocessing the log image to be detected;
the log image preprocessing is an important link in the log detection process, various noises exist in the collected log image to be detected due to different image acquisition environments, such as illumination brightness degree, performance of camera equipment and the like, and in order to ensure the consistency of log size, position and log image quality in the log image to be detected, the log image to be detected must be preprocessed so as to eliminate the noises in the log image to be detected, enhance useful information in the log image to be detected and further improve the accuracy of log volume detection.
In this embodiment, the preprocessing includes: image filtering processing and image graying;
when the log image to be detected is acquired by the binocular camera, noise is inevitably introduced, and filtering processing is required to be carried out on the log image to be detected; in this embodiment, adaptive filtering is used to filter the log image to be detected.
The log image to be detected acquired by the binocular camera is a color image, which needs to be converted into a gray image before the volume detection. That is, converting the red Huang Lansan component luminance value of each pixel of the image to a range of 0-255;
in this embodiment, the effect of graying the log image to be detected is shown in fig. 2 by using an average method, where the average method averages the red Huang Lansan component brightness values of each pixel in the log image to be detected to obtain a gray value; the specific formula is as follows:
in the method, in the process of the invention,for the gray value of the pixel of the ith row, jth column after gray conversion, said +.>For the ith row before gradation conversion, the red component luminance value of the pixel of the jth column, is>For the ith row before gradation conversion, the yellow component luminance value of the pixel of the jth column, is->The blue component luminance value of the pixel of the j-th column is the i-th row before gradation conversion.
S3: judging the log image to be detected, judging whether shadows exist or not, if not, entering S4, and if so, entering S5;
in fact, when the volume detection is performed on the piled logs, some piled logs are piled up neatly, so that shadows are not caused by protruding of part of the logs, the contour of each log has clear representation in the log image to be detected (see fig. 3 a), while some piled logs are piled up neatly, so that the plane formed by protruding of part of the whole log end face is caused, when the image of the piled logs is collected, shadow parts are inevitably generated, such as the shadow is circled in a black frame in fig. 3b and 3c, the end face of the log is displayed incompletely, at the moment, the log image is identified by adopting a machine vision identification model, so that larger errors are often caused, in the prior art, a complex improved deep learning model (such as an improved SSD model, an improved YOLO model and the like) is often adopted to identify the shadow image, however, the complex model is extremely complex in operation, the detection time is long, whether the shadow end face is lost or not is caused by the log, and the end face part is lost due to cutting errors, so that larger deviation is caused by the detection result;
therefore, compared with the prior art, when the log volume is detected by using the machine vision model, the method of the embodiment firstly judges the log image to be detected, and respectively detects the end face part deficiency caused by cutting and the end face part deficiency caused by shadow, so as to perform subsequent machine vision model detection, thereby improving the accuracy of log volume detection;
specifically, whether the log image to be detected has shadows or not is judged in a manual judgment mode; the manual judgment not only can improve the accuracy of shadow judgment, but also can avoid the situation that the end face part is missing due to log cutting errors, which is considered to be shadow; it is emphasized that the case of the log contour image having both shadows and defects in the log image is not discussed in the present embodiment.
S4: detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
in the aspect of image processing, deep learning is widely studied in the fields of image classification, target detection, image segmentation and the like, and simultaneously, great achievements are obtained, and unlike the traditional image processing method, the image feature learning through a deep learning model can be suitable for image application under a complex background.
Specifically, the deep learning model is a convolutional neural network model, and the convolutional neural network model is used for identifying a log image which only contains a complete end face contour and is incomplete due to non-shadow reasons, and the model is commonly used in the field of image detection and has better performance in the field of image detection.
Further, the convolutional neural network model consists of a convolutional layer, a pooling layer, a full-connection layer and an output layer; the convolution layer is used for carrying out convolution operation on the log image to be detected to obtain a characteristic image of the log image to be detected, and meanwhile, the convolution layer updates parameters of the convolution neural network model in the forward propagation and backward propagation processes;
wherein, during forward propagation, the calculation formula of each node in the convolution layer is:
wherein X is j l For figure j Zhang Tezheng, X in layer l of the convolutional layer i l-1 I Zhang Tezheng of layer 1, M, the convolution layer j A set of input feature maps, k, for participation in the operation of the layer j Zhang Tezheng map ij l B is the convolution kernel between the ith feature map of the layer 1 and the jth feature map of the layer 1 j l The bias item added in the j-th feature diagram of the first layer is provided, and f is an activation function;
the calculation formula of the back propagation is as follows:
in which W is l For the connection coefficient of layer 1 to layer 1, x l-1 Is the output characteristic diagram of the first layer-1,is the sensitivity map of the first layer relative to error, η is the learning rate.
The pooling layer is used for downsampling and reducing the size of the input feature map; the full connection layer is used for converting the feature map into a one-dimensional vector, and the output layer is used for outputting results;
as shown in fig. 4, in the step S4, the detection of the log image to be detected by using a deep learning model specifically includes:
s4.1: establishing a sample set trained by the deep learning model;
in the embodiment, an industrial camera is adopted to acquire a plurality of log images, and a Labelme image labeling tool is used for labeling the log end surface contours in the log images one by one to form a log image sample set, so that abundant sample characteristics are provided for the learning and training of the deep learning model;
it should be noted that, compared with the current situation that the prior art has no purpose when the training set is selected, the log image without shadows is identified in the embodiment, when the sample set is selected, the shadow affecting the integrity of the log contour information should not be included in the log image, and meanwhile, the embodiment also detects the log image with the missing end face part by adopting a deep learning model, so that when the sample set is selected, a plurality of log images with the missing end face part of the log are selected as the sample set; thus, the trained deep learning model has better recognition accuracy for log images without shadows.
S4.2: training the deep learning model by adopting the sample set;
in this step, the deep learning model learns a certain number of times or the training error of the deep learning model converges, and training is stopped.
S4.3: and inputting the log image to be detected into the deep learning model to obtain the contour information of the log in the log image.
By the above-described operation, not only is excellent in detection accuracy in the log having a complete contour, but also in the log detection in which the end face portion is missing due to the log cutting error, and therefore, with the above-described scheme, an excellent inspection accuracy is provided for a log image in which no shadow is present in the image, and the error rate is only 1.8% by comparing the result of the above-described operation with the manual marking result for 10 log images to be detected.
S5: detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
wherein the shadow log detection model is used for identifying log images containing defects caused by shadow reasons in the log images, and comprises: a deep learning model and an incomplete end face complement model;
and identifying log contour information in the log image to be detected by adopting the deep learning model of S4, screening incomplete log contour information in the log contour information, and supplementing the incomplete log contour information to further finish the detection of the log image with shadows.
The incomplete log contour information is complemented by adopting a fitting method; the specific fitting method is prior art and will not be discussed in detail here.
By adopting the scheme of S5, the log image with shadows in the image has excellent inspection precision, the result of the operation of 10 log images to be detected is compared with the manual marking result, and the error rate is only 2.4%.
In fact, in S3, compared with the prior art, the log image of the log with the defect is distinguished from the log image defect caused by the shadow, so in S5, the distinguishing and detecting of the image are not needed by the complex model, thereby simplifying the detecting steps to a certain extent and improving the log detecting efficiency.
S6: and calculating the log volume according to the contour information obtained in the step S4 or the step S5.
And obtaining the log volume through a volume calculation formula according to the contour information and the length of the log.
An embodiment two, the present embodiment provides a log volume detection system based on machine vision, where the detection system adopts the log volume detection method based on machine vision of the embodiment one, and the detection system includes:
the acquisition module is used for acquiring log images to be detected;
the image preprocessing module is connected with the acquisition module and is used for preprocessing the log image to be detected;
the image judging module is connected with the preprocessing module and is used for judging the log image to be detected after preprocessing and judging whether shadows exist, if not, the log image judging module enters the shadow-free log contour detecting module, and if so, the log image judging module enters the shadow log contour detecting module;
the shadow-free log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
the shadow log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
and the timber volume calculation module is connected with the shadowless log contour detection module and the shadowy log contour detection module and is used for calculating the log timber volume according to the contour information obtained by the shadowless log contour detection module or the shadowy log contour detection module.
In a third embodiment, the present embodiment further provides a computer device. The computer device is in the form of a general purpose computing device. Components of a computer device may include, but are not limited to: one or more processors or processing units, system memory, and buses connecting the different system components.
Computer devices typically include a variety of computer system readable media. Such media can be any available media that can be accessed by the computer device and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory may include a computer system readable medium in the form of volatile memory and the memory may include at least one program product having a set (e.g., at least one) of program modules configured to carry out the functions of the embodiments of the invention.
The processing unit executes various functional applications and data processing by running programs stored in the system memory, such as the methods provided by other embodiments of the present invention.
The present invention also provides a storage medium containing computer-executable instructions, on which a computer program is stored which, when executed by a processor, implements methods provided by other embodiments of the present invention.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (10)

1. A method for detecting log volume based on machine vision, the method comprising the steps of:
s1: acquiring a log image to be detected;
s2: preprocessing the log image to be detected;
s3: judging whether shadows exist in the preprocessed log image to be detected, if not, entering S4, and if so, entering S5;
s4: detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
the deep learning model is a convolutional neural network model which is used for identifying the log image which only contains complete end surface outline and incomplete end surface outline caused by non-shadow reasons,
in the step S4, the detection of the log image to be detected by using a deep learning model specifically includes:
s4.1: establishing a sample set trained by the deep learning model;
when a sample set is selected, the selected log image does not contain shadows affecting the integrity of log contour information, and a plurality of images with partial missing log end faces are selected as the sample set;
s4.2: training the deep learning model by adopting the sample set;
s4.3: inputting a log image to be detected into the deep learning model to obtain the contour information of the log in the log image;
s5: detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
the shadow log detection model is used for identifying log images which contain defects caused by shadow reasons in the log images, and comprises the following components: a deep learning model and an incomplete end face complement model;
s6: and calculating the log volume according to the contour information obtained in the step S4 or the step S5.
2. The machine vision-based raw wood volume detection method according to claim 1, wherein in S1, raw wood images are acquired by a raw wood image acquisition system, the raw wood image acquisition system comprising: the camera is used for shooting log volume images, the tripod is used for fixing the camera, and the mobile power supply is used for supplying power for the camera; the camera is a Stereolabs binocular camera.
3. The machine vision-based raw wood volume detection method according to claim 1, wherein in S2, the preprocessing includes: image filtering processing and image graying; and filtering the log image to be detected by adopting self-adaptive filtering, and graying the log image to be detected by adopting an average value method.
4. A method for detecting log volume based on machine vision according to claim 3, wherein the average method is to average the red Huang Lansan component brightness value of each pixel in the log image to be detected to obtain a gray value; the specific formula is as follows:
in the method, in the process of the invention,for the gray value of the pixel of the ith row, jth column after gray conversion, said +.>For the ith row before gradation conversion, the red component luminance value of the pixel of the jth column, is>For the ith row before gradation conversion, the yellow component luminance value of the pixel of the jth column, is->The blue component luminance value of the pixel of the j-th column is the i-th row before gradation conversion.
5. The machine vision-based raw wood volume detection method according to claim 1, wherein in S3, whether the raw wood image to be detected is shadowed or not is judged by means of manual judgment.
6. The machine vision-based raw wood volume detection method of claim 1, wherein in S4, the convolutional neural network model comprises a convolutional layer, a pooling layer, a full-connection layer, and an output layer; the convolution layer is used for carrying out convolution operation on the log image to be detected to obtain a characteristic image of the log image to be detected, and meanwhile, the convolution layer updates parameters of the convolution neural network model in the forward propagation and backward propagation processes;
wherein, during forward propagation, the calculation formula of each node in the convolution layer is:
wherein X is j l For figure j Zhang Tezheng, X in layer l of the convolutional layer i l-1 I Zhang Tezheng of layer 1, M, the convolution layer j A set of input feature maps, k, for participation in the operation of the layer j Zhang Tezheng map ij l B is the convolution kernel between the ith feature map of the layer 1 and the jth feature map of the layer 1 j l The bias item added in the j-th feature diagram of the first layer is provided, and f is an activation function;
the calculation formula of the back propagation is as follows:
in which W is l For the connection coefficient of layer 1 to layer 1, x l-1 Is the output characteristic diagram of the first layer-1,a sensitivity graph of the first layer relative to errors is obtained, wherein eta is the learning rate;
the pooling layer is used for downsampling and reducing the size of the input feature map; the full connection layer is used for converting the feature map into a one-dimensional vector, and the output layer is used for outputting results.
7. The machine vision-based raw wood volume detection method according to claim 1, wherein in S4.1, a plurality of raw wood images are acquired by using an industrial camera, and raw wood end surface contours in the raw wood images are labeled one by one using a Labelme image labeling tool to form a raw wood image sample set.
8. The machine vision-based raw wood volume detection method according to claim 1, wherein S5 is specifically: and identifying log contour information in the log image to be detected by adopting the deep learning model of S4, screening incomplete log contour information in the log contour information, and supplementing the incomplete log contour information to further finish the detection of the log image with shadows.
9. The machine vision based raw wood volume detection method of claim 8, wherein the complementing operation is performed on the incomplete raw wood contour information by a fitting method.
10. A machine vision based log volume detection system employing the machine vision based log volume detection method of any one of claims 1-9, the detection system comprising:
the acquisition module is used for acquiring log images to be detected;
the image preprocessing module is connected with the acquisition module and is used for preprocessing the log image to be detected;
the image judging module is connected with the preprocessing module and is used for judging the log image to be detected after preprocessing and judging whether shadows exist, if not, the log image judging module enters the shadow-free log contour detecting module, and if so, the log image judging module enters the shadow log contour detecting module;
the shadow-free log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a deep learning model to obtain the contour information of the log in the log image to be detected;
the deep learning model is a convolutional neural network model which is used for identifying the log image which only contains complete end surface outline and incomplete end surface outline caused by non-shadow reasons,
the detection of the log image to be detected by adopting the deep learning model is specifically as follows:
s4.1: establishing a sample set trained by the deep learning model;
when a sample set is selected, the selected log image does not contain shadows affecting the integrity of log contour information, and a plurality of images with partial missing log end faces are selected as the sample set;
s4.2: training the deep learning model by adopting the sample set;
s4.3: inputting a log image to be detected into the deep learning model to obtain the contour information of the log in the log image;
the shadow log contour detection module is connected with the image judgment module and is used for detecting the log image to be detected by adopting a shadow log detection model to obtain the log contour information in the log image to be detected;
the shadow log detection model is used for identifying log images which contain defects caused by shadow reasons in the log images, and comprises the following components: a deep learning model and an incomplete end face complement model;
and the timber volume calculation module is connected with the shadowless log contour detection module and the shadowy log contour detection module and is used for calculating the log timber volume according to the contour information obtained by the shadowless log contour detection module or the shadowy log contour detection module.
CN202410109852.8A 2024-01-26 2024-01-26 Log volume detection method and system based on machine vision Active CN117635619B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410109852.8A CN117635619B (en) 2024-01-26 2024-01-26 Log volume detection method and system based on machine vision

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410109852.8A CN117635619B (en) 2024-01-26 2024-01-26 Log volume detection method and system based on machine vision

Publications (2)

Publication Number Publication Date
CN117635619A CN117635619A (en) 2024-03-01
CN117635619B true CN117635619B (en) 2024-04-05

Family

ID=90016741

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410109852.8A Active CN117635619B (en) 2024-01-26 2024-01-26 Log volume detection method and system based on machine vision

Country Status (1)

Country Link
CN (1) CN117635619B (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392896A (en) * 2017-07-14 2017-11-24 佛山市南海区广工大数控装备协同创新研究院 A kind of Wood Defects Testing method and system based on deep learning
CN111899296A (en) * 2020-06-24 2020-11-06 广西大学 Method and device for detecting log volume based on computer vision
CN115496763A (en) * 2022-11-21 2022-12-20 湖南视比特机器人有限公司 Workpiece wrong and neglected loading detection system and method based on multi-view vision
CN116416443A (en) * 2023-03-15 2023-07-11 南阳理工学院 Stolen tree matching method and system based on perspective transformation and deep learning
CN116481429A (en) * 2023-04-25 2023-07-25 广西大学 Log volume detection method based on target detection
CN116524002A (en) * 2023-05-06 2023-08-01 广西慧云信息技术有限公司 Log diameter measurement method based on deep learning and binocular camera
CN116612097A (en) * 2023-05-29 2023-08-18 江苏东晟辉科技开发有限公司 Method and system for predicting internal section morphology of wood based on surface defect image
CN116862871A (en) * 2023-07-07 2023-10-10 中林信达(北京)科技信息有限责任公司 Wood counting method based on mixed characteristics
CN117372663A (en) * 2023-09-07 2024-01-09 北京智大弘创科技有限公司 Method, device, equipment and storage medium for supplementing log end face shielding
CN117372499A (en) * 2023-09-07 2024-01-09 北京智大弘创科技有限公司 Log length and diameter determining method, device, equipment and storage medium
CN117419641A (en) * 2023-10-25 2024-01-19 青岛高重信息科技有限公司 Log ruler detection method based on acoustic camera and depth camera and related equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9588098B2 (en) * 2015-03-18 2017-03-07 Centre De Recherche Industrielle Du Quebec Optical method and apparatus for identifying wood species of a raw wooden log
US20190205608A1 (en) * 2017-12-29 2019-07-04 Deep Innovations Ltd Method and apparatus for safety monitoring of a body of water
US11189022B2 (en) * 2019-04-12 2021-11-30 Fordaq SA Automatic detection, counting, and measurement of logs using a handheld device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107392896A (en) * 2017-07-14 2017-11-24 佛山市南海区广工大数控装备协同创新研究院 A kind of Wood Defects Testing method and system based on deep learning
CN111899296A (en) * 2020-06-24 2020-11-06 广西大学 Method and device for detecting log volume based on computer vision
CN115496763A (en) * 2022-11-21 2022-12-20 湖南视比特机器人有限公司 Workpiece wrong and neglected loading detection system and method based on multi-view vision
CN116416443A (en) * 2023-03-15 2023-07-11 南阳理工学院 Stolen tree matching method and system based on perspective transformation and deep learning
CN116481429A (en) * 2023-04-25 2023-07-25 广西大学 Log volume detection method based on target detection
CN116524002A (en) * 2023-05-06 2023-08-01 广西慧云信息技术有限公司 Log diameter measurement method based on deep learning and binocular camera
CN116612097A (en) * 2023-05-29 2023-08-18 江苏东晟辉科技开发有限公司 Method and system for predicting internal section morphology of wood based on surface defect image
CN116862871A (en) * 2023-07-07 2023-10-10 中林信达(北京)科技信息有限责任公司 Wood counting method based on mixed characteristics
CN117372663A (en) * 2023-09-07 2024-01-09 北京智大弘创科技有限公司 Method, device, equipment and storage medium for supplementing log end face shielding
CN117372499A (en) * 2023-09-07 2024-01-09 北京智大弘创科技有限公司 Log length and diameter determining method, device, equipment and storage medium
CN117419641A (en) * 2023-10-25 2024-01-19 青岛高重信息科技有限公司 Log ruler detection method based on acoustic camera and depth camera and related equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Object Detection in Digital Images under Non-Standardized Conditions Using Illumination and Shadow Filtering;Waqqas-ur-Rehman Butt等;《International Journal of Computer and Information Engineering》;20170731;第11卷(第12期);第1285-1293页 *
基于YOLO-RW模型的机器视觉原木端面识别定位;曾小山等;《森林工程》;20230930;第39卷(第5期);第144-153页 *
基于实例分割模型的原木检尺径方法;李佳雨等;《北京林业大学学报》;20230331;第45卷(第3期);第153-159页 *
基于深度学习的木材材积自动测量关键技术研究;杨攀;《中国优秀硕士学位论文全文数据库 工程科技Ⅰ辑》;20230215(第2期);第B024-2777页 *

Also Published As

Publication number Publication date
CN117635619A (en) 2024-03-01

Similar Documents

Publication Publication Date Title
CN108549873B (en) Three-dimensional face recognition method and three-dimensional face recognition system
CN110314854B (en) Workpiece detecting and sorting device and method based on visual robot
CN109829914B (en) Method and device for detecting product defects
CN110245678B (en) Image matching method based on heterogeneous twin region selection network
CN111179251A (en) Defect detection system and method based on twin neural network and by utilizing template comparison
CN113012157B (en) Visual detection method and system for equipment defects
CN110517265A (en) A kind of detection method of surface defects of products, device and storage medium
CN110473184A (en) A kind of pcb board defect inspection method
CN111415339B (en) Image defect detection method for complex texture industrial product
CN109816634B (en) Detection method, model training method, device and equipment
CN111126393A (en) Vehicle appearance refitting judgment method and device, computer equipment and storage medium
CN113657423A (en) Target detection method suitable for small-volume parts and stacked parts and application thereof
CN112200163A (en) Underwater benthos detection method and system
CN117576079A (en) Industrial product surface abnormality detection method, device and system
CN105893941A (en) Facial expression identifying method based on regional images
CN111178405A (en) Similar object identification method fusing multiple neural networks
CN113628170A (en) Laser line extraction method and system based on deep learning
CN116993733B (en) Earphone sleeve appearance quality detection method and system
CN117910073A (en) Artwork package design optimization system and method based on 3D printing technology
CN117636045A (en) Wood defect detection system based on image processing
CN117351078A (en) Target size and 6D gesture estimation method based on shape priori
CN117635619B (en) Log volume detection method and system based on machine vision
CN111539931A (en) Appearance abnormity detection method based on convolutional neural network and boundary limit optimization
CN110930393A (en) Chip material pipe counting method, device and system based on machine vision
CN110186929A (en) A kind of real-time product defect localization method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant