CN110782423B - Automatic splicing and matting method for solid wood sawn timber line scan camera images - Google Patents

Automatic splicing and matting method for solid wood sawn timber line scan camera images Download PDF

Info

Publication number
CN110782423B
CN110782423B CN201911037171.0A CN201911037171A CN110782423B CN 110782423 B CN110782423 B CN 110782423B CN 201911037171 A CN201911037171 A CN 201911037171A CN 110782423 B CN110782423 B CN 110782423B
Authority
CN
China
Prior art keywords
image
sawn timber
frame
wood
splicing
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
CN201911037171.0A
Other languages
Chinese (zh)
Other versions
CN110782423A (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.)
Xiamen Sunnypet Products Co Ltd
Huaqiao University
Original Assignee
Xiamen Sunnypet Products Co Ltd
Huaqiao University
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 Xiamen Sunnypet Products Co Ltd, Huaqiao University filed Critical Xiamen Sunnypet Products Co Ltd
Priority to CN201911037171.0A priority Critical patent/CN110782423B/en
Publication of CN110782423A publication Critical patent/CN110782423A/en
Application granted granted Critical
Publication of CN110782423B publication Critical patent/CN110782423B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20104Interactive definition of region of interest [ROI]
    • 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
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to a method for automatically splicing and matting images of a line scanning camera of a solid wood sawn timber, wherein the line scanning camera is selected as image acquisition equipment of the solid wood sawn timber, line scanning image data are automatically and completely spliced by a specially designed frame buffer and frame splicing method, and a plurality of image processing technologies are integrated according to the shape and texture characteristics of the line scanning solid wood sawn timber to realize stable matting of the sawn timber images. The method can be used in the fields of large-breadth view field, high-speed and high-resolution automated production and detection of forest enterprises, such as measurement and detection of solid wood sawn timber, furniture manufacturing and the like.

Description

Automatic splicing and matting method for solid wood sawn timber line scanning camera images
Technical Field
The invention relates to the field of automatic production and detection in the forest industry, in particular to a method for automatically scratching and splicing images of a line-scan camera for solid wood sawn timber.
Background
The solid wood sawn timber becomes a 'scarce resource' in the forest furniture industry due to the factors of long growth period, limited raw material supply and the like, so that the improvement of the wood inspection level is an important way for the limited wood resources to exert the maximum economic benefit.
At present, the quality of sawn timber is mainly detected manually in China, the detection method is high in workload, and the detection method is easily influenced by subjective factors of detection personnel and cannot ensure the detection efficiency and precision. Particularly, with the continuous improvement of automation requirements of large-scale production processes, the application requirements of the current industrial field cannot be met more and more by adopting a manual detection method. In order to overcome the disadvantages of manual inspection, techniques such as machine vision, ultrasonic, microwave, nuclear magnetic resonance, X-ray density imaging, etc. have been successively tried to be used for automatic inspection of sawn timber.
Among the detection methods, the machine vision technology becomes the preferred scheme for the automatic detection of the wood at present due to the characteristics of large information acquisition amount, simple method and strong intuition, and particularly, the wood material is not damaged. However, due to the factors such as the material structure and texture of the sawn solid wood, the machine vision technology is not easy to apply to the processing of the sawn solid wood. Firstly, due to the limitation of solid wood raw materials, the sizes of the solid wood are different, the short wood is dozens of centimeters, the long wood is probably four or five meters, a machine vision system needs to adapt to sawn timber with different specifications, and higher requirements are put forward for software and hardware of the system. Generally, for sawn timber with the size exceeding one meter, the traditional area-array scanning camera cannot be applied due to the limitation of the visual field, and an industrial line-scan camera must be selected to carry out detection. However, industrial line scan cameras and lenses are very expensive, market popularity is not high, and related technologies are not perfect. Secondly, although the long sawn timber can be collected by using the line scan camera, the collected images are very huge due to the overlong size of the sawn timber. In addition, the solid wood sawn timber not only has abundant wood grain textures, but also has various defects such as dead knots, loose knots, corrosion, mildew and rot, and the textures and the defects can influence the image extraction of the sawn timber.
Therefore, on the premise of selecting the linear scanning camera to scan the sawn timber, how to select an image acquisition, splicing and processing scheme to effectively adapt to the automatic online detection of the sawn timber becomes a key problem to be solved urgently in the detection of the solid wood sawn timber, particularly the detection of large-size sawn timber.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, provides an automatic splicing and matting method for solid wood sawn timber line scanning camera images, and realizes automatic detection of sawn timber quality.
In order to realize the purpose, the technical scheme of the invention is as follows:
a solid wood sawn timber line scan camera image automatic splicing and matting method comprises the following steps:
acquiring images, namely acquiring images of the solid wood sawn timber on the conveyor belt by using an industrial line scanning camera to obtain line scanning image data;
splicing sawn timber images, namely sequentially performing frame buffer processing, effective candidate frame determination and frame splicing processing on line scanning image data to finish the automatic splicing integrity of the solid wood sawn timber images;
and (3) sawing material image digging, wherein the automatically spliced images are stably scratched by integrating a plurality of image processing technologies according to the shape and texture characteristics of the line-scanning solid wood sawing material.
Preferably, the industrial line scan camera is capable of adjusting the set scan frequency and the sampling ROI; the conveying belt is made of black matte materials, the speed is constant, and the scanning frequency of the industrial line scanning camera is set to be consistent with the conveying frequency of the conveying belt.
Preferably, the frame buffering process specifically includes:
forming a small image by 500 lines of pixels of each line scan as a candidate splicing frame; and allocating a buffer for each candidate frame in the memory, wherein the 8-15 buffers can meet the conveying speed of the sawn timber of 30m/min according to the sequence marks and the difference of the sawn timber length.
Preferably, the determining of the valid candidate frame specifically includes:
processing the candidate frames by using image binarization, and scanning pixels in a width range equal to that of a conveyor belt; the number of white pixels on the image is read, and as long as any one line has more than 1/3 of the white pixels, the wood is identified, and the frame is a valid frame.
Preferably, the frame splicing process specifically includes:
determining the type of an image frame according to the position of the wood appearing in the effective frame, if the first half part of a certain frame of image has no wood and the second half part has wood, judging the frame as a starting frame, indicating that the line scanning camera has found the wood, and a subsequent series of image frames are the wood being detected; when the first half part of a certain frame is found to have wood, and the second half part of the certain frame without wood is the end frame; adding a frame before the head frame and after the tail frame respectively, and splicing the frames into images in sequence from head to tail; and after splicing is finished, clearing the buffer area in the memory.
Preferably, the sawn timber image is scratched, specifically includes:
performing graying processing on the spliced image, taking pixels with the histogram statistical range of 7-120 as the basis of wood matting, performing edge detection on the binary image by utilizing the basis of binaryzation processing on the image, calculating a contour circumscribed rectangle for the extracted edge by using a bounding function, and taking the side length of the obtained rectangle as the primary length and width of the wood.
Preferably, the sawn timber image is scratched, still includes: making a shaking optimization strategy of the profile of the sawn timber in the width direction; the method comprises the following specific steps:
and uniformly taking 20 rows from top to bottom from the scratched binary image, reading the number of white dots on the width of each row, namely the width of the image, sequencing the number of the white dots obtained by each row, finally taking a median value according to a sequencing result, and taking the median value as the corrected sawn timber width.
Preferably, the sawn timber image is scratched, still includes: making a dip angle correction strategy in the length direction of the profile of the sawn timber; the method comprises the following specific steps:
setting the upper left corner of the wood as an origin, the x direction to the right, the y direction to the downward, from left to right, the coordinates of two endpoints in a row at the topmost end of the upper part are P1 (x 1, y 1), P2 (x 2, y 2), and the coordinates of two endpoints at the bottommost end are P3 (x 3, y 3) and P4 (x 4, y 4); the following method is adopted to calculate the inclination angle:
let d = (| x3-x1| + | x4-x2 |)/2, when d is greater than the set threshold, calculate h = (| y3-y1| + | y4-y2 |)/2, theta =actan (d/y); d represents an x-direction tilt threshold, h represents a y-direction tilt threshold; the actual sawn timber length is L = h/cos (theta).
Preferably, the sampling interval of each line scan image is set to 2 seconds or more, and the sampling interval is used for image stitching and processing.
After the scheme is adopted, the invention has the beneficial effects that:
a solid wood sawn timber line scanning camera image automatic splicing and matting method comprises the steps of firstly utilizing frame buffering to synthesize line scanning image data into candidate frames, determining the types of the candidate frames according to positions of timber appearing in images, and avoiding incomplete image interception by adding redundant frames; secondly, aiming at the problems of repeated splicing, disordered frame sequence and the like which possibly occur in the splicing process, a practical and feasible splicing scheme is provided; finally, according to the shape and texture characteristics of the line-scanning solid wood sawn timber, a solid wood sawn timber line-scanning image matting algorithm based on image processing is designed, and the matting outline is optimized in the length and width directions.
The present invention is further described in detail with reference to the drawings and embodiments, but the method for automatically stitching and matting the image of the solid wood sawn timber line scan camera is not limited to the embodiments.
Drawings
FIG. 1 is a flow chart of a method for automatic splicing and matting of images of a solid wood sawn timber line scan camera according to the invention;
FIG. 2 is a schematic diagram of an effective candidate splicing frame according to the present invention; wherein, diagram (a) represents the start frame, diagram (b) represents the intermediate frame, and diagram (c) represents the end frame;
FIG. 3 is a schematic view of a defective sawn solid wood;
FIG. 4 is a schematic diagram of the width direction of the sawn timber.
Detailed Description
The technical solutions in the embodiments of the present invention will be described and discussed in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, the invention discloses a method for automatically splicing and matting images of a solid wood sawn timber line scan camera, which comprises the following steps:
s101, image acquisition, namely acquiring images of solid wood sawn timber on a conveyor belt through an industrial line scanning camera to obtain line scanning image data;
s102, splicing sawn timber images, namely sequentially performing frame buffer processing, effective candidate frame determination and frame splicing processing on line scanning image data to finish automatic splicing integrity of the solid wood sawn timber images;
s103, sawing images are scratched, and the automatically spliced images are scratched stably according to the shape and texture characteristics of the solid wood sawn materials by means of a plurality of image processing technologies.
The specific implementation steps of the invention are as follows:
1. hardware required conditions:
the hardware equipment required by the invention comprises the following parts: industrial line scan cameras, which require the ability to set the scan frequency and sample the ROI, and lenses. Conveying mechanisms for conveying solid wood sawn timber, such as conveyor belts or pushers, require a constant speed of the transmission equipment and set the scanning frequency of the camera to be consistent with the conveying frequency of the conveyor belts.
2. Candidate frame selection and frame buffering processing method
(2.1) candidate frame selection: according to the principle of line scanning imaging, the line scanning camera can only collect one line of images at a time, and in order to complete the image collection of the wood, a reasonable method needs to be designed to combine the data frames scanned by the line scanning camera into small images so as to complete the splicing of the wood. In the embodiment of the invention, 500 lines of pixels in each line scan form a small image to be used as candidate splicing frames, and in order to ensure that the splicing frames are not interfered with each other, a cache storage image is distributed for each frame in a memory.
(2.2) buffer allocation: taking 5 buffer areas as an example, after the camera acquires the first candidate frame image, the first candidate frame image is stored in buffer No. 1, and then the camera acquires the first candidate frame image, the buffer No. 2 is placed, and the same situation is also true for buffer No. 3, at this time, buffer No. 4 is about to receive the fourth image, but if the first three frame images are known to be spliced into a complete wood image, the first three frame images should be spliced into an image after the third frame image is read and stored.
And (2.3) after splicing is finished, emptying the cache to continuously provide a free buffer area for subsequent shooting work. The size and the number of the buffer areas are increased, the working efficiency of the system can be improved, but the resource waste is also caused by the overlarge number of the buffer areas, and by taking the small image formed by 500 rows of pixels in the embodiment of the invention as an example, each image occupies 4M of the size of the buffer area under the linear scanning precision of 8000 pixels in each row. Under the condition of 16G memory and Intel i7 8700 system configuration, the conveying speed of the sawn timber can be satisfied by 8-15 buffers according to the different lengths of the sawn timber.
3. Candidate frame splicing algorithm
After the number and the size of the candidate frames are determined, how to select the candidate frames to splice into a complete image is a key for ensuring accurate extraction of sawn timber images, if more candidate frames are selected, images behind a conveyor belt are spliced, the size of the spliced image exceeds the actual size, if less candidate frames are selected, the images are incomplete, and the size of the spliced image is smaller than the actual size.
In order to select a proper candidate frame, the method adopted by the embodiment of the invention is that the head frame and the tail frame of the wood are determined by using an image processing method, and then two redundant frames are added after the head frame and the tail frame, so that incomplete image interception is avoided. The redundant parts which are added can be intercepted by using a subsequent matting algorithm, and a final image is obtained.
(3.1) effective candidate frame determination method
In the splicing algorithm, only the candidate frame with wood is used for splicing, and the conveyor belt has no wood for a long time, so that the premise of correct image splicing is to find a valid candidate frame, namely the candidate frame with wood.
The effective candidate frame is selected based on the fact that the difference between the solid wood sawn timber and the black conveyor belt is obvious in the gray scale space, and therefore the sawn timber and the conveyor belt can be distinguished by an image binarization method. After the binary processing, the number of white pixels on the image is read, and if the number exceeds a set threshold value, the frame is a valid frame. The statistical pixel number is to overcome the influence caused by flying dust or dirt on a conveyor belt in a work site, and the noises are generally randomly distributed in a small area, and only the white pixels with large area are determined as effective candidate frames.
(3.2) determination of head, end and intermediate frames
Referring to fig. 2, after the valid candidate frame is determined, the type of the image frame is determined according to the position of the wood appearing in the image, if the first half of the image of a certain frame has no wood and the second half has wood, the image is determined as a starting frame, which indicates that the line scan camera has found wood, and the subsequent series of image frames are the wood being detected, and when the first half of the image of a certain frame has wood and the second half has no wood, the image frame is determined as an ending frame.
(3.3) image frame splicing algorithm for adding redundant frames
Once the head, end and intermediate frames are determined, the frames can be spliced together in order. However, since the line scan camera scans the workpiece at a high speed, there may be a case that the scan processing speed is too fast and the vision system does not push the scanned image into the buffer in time due to the unreasonable settings of the camera configuration parameters or the wood segmentation threshold parameters. In order to ensure the integrity of the image, the last frame of the head frame and the next frame of the tail frame are added during the splicing of each image, and because two more frames are added, the spliced image is slightly larger than the actual image, but the addition of redundant frames ensures that effective sawn timber information cannot be omitted from the spliced image, and the redundant parts which are added can be intercepted by a subsequent image matting algorithm.
(3.4) a splicing error processing algorithm:
in the actual sawn timber splicing process, three problems of disordered frame sequences, repeated frame selection and incomplete solid sawn timber can occur, and the embodiment of the invention adopts the following three methods to overcome the problems.
(3.4.1) buffer numbering in order to avoid frame order confusion
In order to avoid extracting repeated image frame splicing, each buffer area set in the memory must be marked and selected according to the sequence (can not be selected randomly), otherwise, if the buffer is read incorrectly, the image splicing error is caused.
(3.4.2) software and hardware coordination to avoid duplicate frame extraction
The repeated frame extraction is mainly caused by inconsistent coordination of software and hardware of the system, so that the interval between two acquired images is set to be more than 2 seconds, enough time is reserved for splicing and processing, and the problem that the buffer reading is not timely due to system blockage is avoided.
(3.4.3) influence of misjudgment of defects of wood itself
The solid wood sawn timber has the defects of oil sacs, scabs and the like, the defects are generally darker in brightness, and the method for distinguishing the effective frames in the embodiment of the invention judges whether wood exists according to the brightness of the image, so that if the effective frames are directly judged according to the binarization processing result, the defects are judged as backgrounds, and misjudgment of splicing is possibly caused.
Aiming at the influence of sawn timber defects, the embodiment of the invention adopts the following strategies to solve the problems:
(1) The color of a green conveyor belt commonly used in the field of current industrial automation is changed, because the brightness of green and wood grain defects is close after binarization processing, the defects and the background are difficult to distinguish, therefore, a black matt surface material is selected by the conveyor belt, black is convenient for segmentation of the image foreground and the background, and the matt surface is large specular reflection when light source irradiation is avoided.
(2) Referring to fig. 3, although dark defects in wood may affect the segmentation of the foreground and background, the brightness of the selected dark background is still significantly higher than that of the background. For this reason, the rule for discriminating wood is further refined as: scanning and conveying belt and other pixels in the same width range, and if only one line is 1/3 brighter, the line is considered to be wood, and no segmentation treatment is carried out.
4. Sawn timber cutout and size correction algorithm
Although the solid wood sawn timber features are different in size, the solid wood sawn timber features are mainly in the shape of a long strip rectangle, more colors are in the shape of wood grains, the whole gray level interval and the colors are uniformly distributed, and the matting algorithm mainly aims at the shape and the color features of the solid wood sawn timber and combines various technologies such as gray level processing, histogram and shape fitting in image processing.
(4.1) segmentation of Wood regions Using color histograms
First, a wood region is divided using a color histogram. According to experimental tests, the statistical pixel value range of the solid wood sawn timber is found to be 7-120, and the statistical range is used as the color histogram characteristic of the timber image. The reason for adopting the color histogram to distinguish the wood from the background is that the characteristic represents the global statistical characteristic of the whole picture, is not influenced by factors such as rotation and inversion, is easy to process and has small calculation burden.
(4.2) obtaining the outline of the Wood by the image processing method
And carrying out graying processing on the spliced image to obtain a gray histogram. Performing image binarization processing according to a set histogram threshold range to obtain a binarized image; and (3) detecting binary image edges, calculating a contour circumscribed rectangle of the extracted edges by using a bounding function (a function in an OpenCV computer vision library), and taking the side length of the rectangle as the primary length and width of the wood.
(4.3) optimization of sawn timber Profile
Theoretically, the sawn timber image can be extracted from the stitched image according to the method described above. However, since the stitched image itself is related to the transmission mechanism, the deducted image is affected by the stability of the transmission mechanism, which is mainly reflected in the following two aspects:
in the width direction, there may be a slight shaking of the workpiece during conveyance due to belt looseness, instability of the mechanism, and the like. The length of the sawn workpiece is generally much greater than the width, and these vibrations have little effect on the length, but the width of the sawn workpiece is limited, and these effects cannot be ignored, and must be limited, as shown in fig. 4.
In the length direction, although the shaking of the conveying belt has little influence on the length, the main error of the shaking is from the inclination angle error caused by improper placement of the sawn timber, and a mechanism for correcting the placement angle is generally arranged on an automatic production line, so the inclination angle error is generally very small, but the shaking does not have correction, and the shaking has influence on the dimension measurement and the like of the sawn timber.
(4.3.1) jitter optimization in the width direction.
Firstly, uniformly taking 20 lines from top to bottom of the extracted binary image, reading the number of white dots on the width of each line, namely the width of the image, then sequencing the number of the white dots obtained in each line, and finally, taking a median value according to a sequencing result, wherein the median value can be used as the corrected sawn timber width.
(4.3.2) correction of inclination in longitudinal direction
And calculating the inclination rate of the wood for correction, wherein the upper left corner of the wood is taken as an origin, the x direction is rightward, the y direction is downward, the left is to the right, the coordinates of two end points in the top row at the top are P1 (x 1, y 1), P2 (x 2, y 2), the coordinates of two end points at the bottom are P3 (x 3, y 3) and P4 (x 4, y 4). The tilt angle theta is calculated as follows:
let d = (| x3-x1| + | x4-x2 |)/2, when d is greater than the set threshold, calculate h = (| y3-y1| + | y4-y2 |)/2, theta =actan (d/y); d represents an x-direction tilt threshold, h represents a y-direction tilt threshold;
the actual sawn timber length is L = h/cos (theta).
The above is only one preferred embodiment of the present invention. However, the present invention is not limited to the above embodiments, and any equivalent changes and modifications made according to the present invention, which do not bring out the functional effects beyond the scope of the present invention, belong to the protection scope of the present invention.

Claims (6)

1. An automatic splicing and matting method for images of a solid wood sawn timber line scan camera is characterized by comprising the following steps:
acquiring images, namely acquiring images of the solid wood sawn timber on the conveyor belt by using an industrial line scanning camera to obtain line scanning image data;
splicing sawn timber images, namely sequentially performing frame buffer processing, effective candidate frame determination and frame splicing processing on line scanning image data to finish automatic splicing integrity of the solid wood sawn timber images;
sawing material image digging, wherein the automatic spliced image is stably scratched by integrating a plurality of image processing technologies according to the shape and texture characteristics of the line-scanning solid wood sawing material;
to the image after automatic concatenation, according to the shape and the texture characteristics of line scan wood sawn timber, synthesize multinomial image processing technique, realize the stable of sawn timber image and scratch, specifically include:
performing graying processing on the spliced image, taking pixels with the histogram statistical range of 7-120 as the basis of sawing material image cutting, performing edge detection on the binary image by utilizing the basis of binaryzation processing on the image, calculating a contour circumscribed rectangle for the extracted edge by using a bounding function, and taking the side length of the obtained rectangle as the initial length and width of the sawing material;
making a shaking optimization strategy of the profile of the sawn timber in the width direction;
making a dip angle correction strategy in the length direction of the profile of the sawn timber;
making a shaking optimization strategy of the profile of the sawn timber in the width direction, which comprises the following specific steps:
uniformly taking 20 rows from top to bottom from the extracted binary image, reading the number of white dots on the width of each row, namely the width of the image, then sequencing the number of the white dots obtained by each row, finally taking a median value according to a sequencing result, and taking the median value as the corrected sawn timber width;
and (3) formulating a dip angle correction strategy in the length direction of the profile of the sawn timber, which comprises the following specific steps:
setting the upper left corner of the wood as an origin, the x direction is rightward, the y direction is downward, from left to right, the coordinates of two endpoints in a row at the topmost end of the upper part are P1 (x 1, y 1), P2 (x 2, y 2), and the coordinates of two endpoints at the bottommost end are P3 (x 3, y 3) and P4 (x 4, y 4); the tilt angle theta is calculated by the following method:
let d = (| x3-x1| + | x4-x2 |)/2, when d is greater than the set threshold, calculate h = (| y3-y1| + | y4-y2 |)/2, theta =actan (d/y); d represents an x-direction tilt threshold, h represents a y-direction tilt threshold;
the actual sawn timber length is L = h/cos (theta).
2. The automatic splicing and matting method for images of a solid wood sawn timber line-scan camera according to claim 1, wherein the industrial line-scan camera can adjust the set scanning frequency and the sampling ROI; the conveying belt is made of black matte materials, the speed is constant, and the scanning frequency of the industrial line scanning camera is set to be consistent with the conveying frequency of the conveying belt.
3. The automatic splicing and matting method for images of a solid wood sawn timber line-scan camera according to claim 1, wherein the frame buffer processing specifically comprises:
forming a small image by 500 lines of pixels of each line scan as a candidate splicing frame; and allocating a buffer for each candidate frame in the memory, wherein the 8-15 buffers can meet the conveying speed of the sawn timber of 30m/min according to the sequence marks and the difference of the sawn timber length.
4. The method for automatically splicing and matting images by using a solid wood sawn timber line-scan camera according to claim 1, wherein the effective candidate frame is determined, and the method specifically comprises the following steps:
processing the candidate frames by using image binarization, and scanning pixels in a width range equal to that of a conveyor belt; the number of white pixels on the image is read, and as long as any one line has more than 1/3 of the white pixels, the wood is considered as the wood, and the candidate frame is the valid frame.
5. The automatic splicing and matting method for images of a solid wood sawn timber line scan camera according to claim 1, wherein the frame splicing process specifically comprises:
determining the type of an image frame according to the position of the wood appearing in the effective frame, if the first half part of a certain frame of image has no wood and the second half part has wood, judging the frame as a starting frame, indicating that the line scanning camera has found the wood, and a subsequent series of image frames are the wood being detected; when the first half part of a certain frame is found to have wood, and the second half part of the certain frame without wood is the end frame; adding a frame before the head frame and after the tail frame respectively, and splicing the frames into images in sequence from head to tail; and after splicing is finished, clearing the buffer area in the memory.
6. The automatic splicing and matting method for images of a solid wood sawn timber line scan camera according to claim 1, characterized in that the sampling interval of each line scan image is set to 2 seconds or more, and the sampling interval is used for image splicing and processing.
CN201911037171.0A 2019-10-29 2019-10-29 Automatic splicing and matting method for solid wood sawn timber line scan camera images Active CN110782423B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911037171.0A CN110782423B (en) 2019-10-29 2019-10-29 Automatic splicing and matting method for solid wood sawn timber line scan camera images

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911037171.0A CN110782423B (en) 2019-10-29 2019-10-29 Automatic splicing and matting method for solid wood sawn timber line scan camera images

Publications (2)

Publication Number Publication Date
CN110782423A CN110782423A (en) 2020-02-11
CN110782423B true CN110782423B (en) 2023-03-24

Family

ID=69387310

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911037171.0A Active CN110782423B (en) 2019-10-29 2019-10-29 Automatic splicing and matting method for solid wood sawn timber line scan camera images

Country Status (1)

Country Link
CN (1) CN110782423B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5257101A (en) * 1992-06-01 1993-10-26 Board Of Regents Of The University Of Ok Apparatus and method for selecting a log orientation and pattern for sawing
CN107967475A (en) * 2017-11-16 2018-04-27 广州探迹科技有限公司 A kind of method for recognizing verification code based on window sliding and convolutional neural networks
CN109544514A (en) * 2018-11-05 2019-03-29 华侨大学 A kind of sawn timber identity identification method, device and equipment merging performance characteristic

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5257101A (en) * 1992-06-01 1993-10-26 Board Of Regents Of The University Of Ok Apparatus and method for selecting a log orientation and pattern for sawing
CN107967475A (en) * 2017-11-16 2018-04-27 广州探迹科技有限公司 A kind of method for recognizing verification code based on window sliding and convolutional neural networks
CN109544514A (en) * 2018-11-05 2019-03-29 华侨大学 A kind of sawn timber identity identification method, device and equipment merging performance characteristic

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于数字图像处理的樟子松锯材分级研究;王巍等;《林产工业》;20190406(第04期);全文 *

Also Published As

Publication number Publication date
CN110782423A (en) 2020-02-11

Similar Documents

Publication Publication Date Title
CN110286126B (en) Wafer surface defect regional detection method based on visual image
JP4704804B2 (en) Wood section exploration method, apparatus and program
CN101093547B (en) Method for recognizing article by cooperating bar code based on height parameter with digit
CN115375686B (en) Glass edge flaw detection method based on image processing
CN109767445B (en) High-precision PCB defect intelligent detection method
CN114219794B (en) Method and system for evaluating surface quality of shaving board based on machine vision
CN110793587A (en) Efficient and safe operation monitoring method for coal mine working surface belt conveyor
CN113298769B (en) FPC flexible flat cable appearance defect detection method, system and medium
US20150051860A1 (en) Automatic optical appearance inspection by line scan apparatus
CN114612471B (en) Method for detecting surface defects of complex-texture ceramic tiles
CN107220946B (en) Real-time removing method for bad block degree images on rock conveyer belt
CN115535525A (en) Conveyor belt longitudinal tearing detection system and method based on image matching
CN110782423B (en) Automatic splicing and matting method for solid wood sawn timber line scan camera images
CN113947598A (en) Plastic lunch box defect detection method, device and system based on image processing
CN108416790A (en) A kind of detection method for workpiece breakage rate
CN113192061B (en) Extraction method and device of LED package appearance detection image, electronic equipment and storage medium
CN109934817A (en) The external contouring deformity detection method of one seed pod
CN114529536A (en) Solid wood quality detection method
KR20230139164A (en) Defect detecting method of log and wood product surface
CN114187269A (en) Method for rapidly detecting surface defect edge of small-sized device
CN114485399A (en) Size detection system and method
CN114563416A (en) Method for detecting board surface quality of artificial board
CN114494142A (en) Mobile terminal middle frame defect detection method and device based on deep learning
CN112837285A (en) Edge detection method and device for panel image
KR20090121612A (en) Method and apparatus for automatic detecting quality defects for corrugated board

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