[go: up one dir, main page]

CN118154664B - Method, system and readable storage medium for measuring width of wood board glue - Google Patents

Method, system and readable storage medium for measuring width of wood board glue Download PDF

Info

Publication number
CN118154664B
CN118154664B CN202410584819.0A CN202410584819A CN118154664B CN 118154664 B CN118154664 B CN 118154664B CN 202410584819 A CN202410584819 A CN 202410584819A CN 118154664 B CN118154664 B CN 118154664B
Authority
CN
China
Prior art keywords
curve
target
edge
projection
points
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
CN202410584819.0A
Other languages
Chinese (zh)
Other versions
CN118154664A (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.)
Hangzhou Huicui Intelligent Technology Co ltd
Original Assignee
Hangzhou Huicui Intelligent Technology Co ltd
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 Hangzhou Huicui Intelligent Technology Co ltd filed Critical Hangzhou Huicui Intelligent Technology Co ltd
Priority to CN202410584819.0A priority Critical patent/CN118154664B/en
Publication of CN118154664A publication Critical patent/CN118154664A/en
Application granted granted Critical
Publication of CN118154664B publication Critical patent/CN118154664B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30161Wood; Lumber
    • 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)
  • Geometry (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The invention discloses a method, a system and a readable storage medium for measuring the width of wood board glue, wherein the method comprises the following steps: acquiring image data of a wood board; carrying out segmented projection based on the image data to obtain projection curves of all segments; extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve; and screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance. According to the invention, by accurately controlling the measurement parameters, the influence of external interference on the measurement result is effectively reduced, and the reliability of the measurement data is ensured. Meanwhile, the high robustness of the method enables the method to adapt to the change of the glue width of the wood board in different environments, so that the production efficiency and the product quality are improved.

Description

Method, system and readable storage medium for measuring width of wood board glue
Technical Field
The invention relates to the technical field of measurement, in particular to a method and a system for measuring the glue width of a wood board and a readable storage medium.
Background
The existing wood board glue width measuring method has some remarkable defects, and the defects limit the high efficiency and the accuracy of the method in practical application.
First, conventional measurement methods generally rely on manual measurements, which are susceptible to the skill level of the operator and subjective factors, resulting in measurement results that are not highly stable and reliable. Manual measurement also requires a lot of human resources and time costs, which is inefficient.
Secondly, some of the prior art uses equipment with lower precision, and it is difficult to meet the requirement of high-precision measurement. These devices may be affected by environmental factors, wear or calibration inaccuracies, etc., resulting in large deviations in the measurement results.
In addition, certain existing methods require high requirements on the surface conditions of the wood board, such as surface flatness and cleanliness, which limit the applicability of the method in a realistic production environment. In particular, in industrial production sites such as wood processing factories, various defects and pollution may exist on the surface of the wood board, and the accuracy and stability of measurement are affected.
Disclosure of Invention
The invention aims to provide a method, a system and a readable storage medium for measuring the glue width of a wood board, which improve the measurement accuracy and stability, are simple and convenient to operate and easy to implement, and save a great amount of manpower and material resource cost for enterprises.
The invention provides a method for measuring the glue width of a wood board, which comprises the following steps:
acquiring image data of a wood board;
Carrying out segmented projection based on the image data to obtain projection curves of all segments;
extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
and screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance.
In this scheme, the section projection is performed based on the image data to obtain a projection curve of each section, which specifically includes:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
And connecting according to the segment sequence based on the horizontal projection corresponding to each target segment to obtain the projection curve.
In this scheme, carry out differential processing to the pixel sequence and obtain horizontal projection, specifically include:
and filtering the pixel sequence by using a preset kernel, wherein the form of the preset kernel comprises:
k is the preset kernel, n is the number of projection curve peak points, and n is more than or equal to 2.
In this scheme, the extracting the edge point set of each segment of edge based on the projection curve to obtain the target curve specifically includes:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
And obtaining the target curve based on the upper curve and the lower curve, wherein noise points are removed from the target curve.
In this solution, the screening based on the target curve to obtain a target edge point, and calculating the target distance based on the target edge point specifically includes:
Performing non-maximum value fitting processing based on the target curve to obtain a peak point set;
after the peak point set in the edge point set is removed, performing straight line fitting on the rest edge points, and calculating the distance between a fitting curve and each point in the edge point set so as to remove the noise points;
obtaining the target edge point based on the peak point set and the gray level transition direction of the target curve;
Calculating a maximum distance, a minimum distance and an average distance based on the target edge points to obtain the target distance.
In this solution, the non-maximum value fitting processing based on the target curve to obtain a peak point set specifically includes:
the edge point set is put into a preset first set;
Removing points smaller than a specified threshold in a first set, and acquiring maximum points from the first set, wherein all points in a specified range corresponding to the maximum points in the first set are removed;
and taking out the maximum point and putting the maximum point into a preset second set until the first set is an empty set, and obtaining the peak point set based on the points in the second set.
The second aspect of the present invention also provides a system for measuring a width of a glue of a board, comprising a memory and a processor, wherein the memory includes a method program for measuring the width of the glue of the board, and the method program for measuring the width of the glue of the board, when executed by the processor, implements the following steps:
acquiring image data of a wood board;
Carrying out segmented projection based on the image data to obtain projection curves of all segments;
extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
and screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance.
In this scheme, the section projection is performed based on the image data to obtain a projection curve of each section, which specifically includes:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
And connecting according to the segment sequence based on the horizontal projection corresponding to each target segment to obtain the projection curve.
In this scheme, carry out differential processing to the pixel sequence and obtain horizontal projection, specifically include:
and filtering the pixel sequence by using a preset kernel, wherein the form of the preset kernel comprises:
k is the preset kernel, n is the number of projection curve peak points, and n is more than or equal to 2.
In this scheme, the extracting the edge point set of each segment of edge based on the projection curve to obtain the target curve specifically includes:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
And obtaining the target curve based on the upper curve and the lower curve, wherein noise points are removed from the target curve.
In this solution, the screening based on the target curve to obtain a target edge point, and calculating the target distance based on the target edge point specifically includes:
Performing non-maximum value fitting processing based on the target curve to obtain a peak point set;
after the peak point set in the edge point set is removed, performing straight line fitting on the rest edge points, and calculating the distance between a fitting curve and each point in the edge point set so as to remove the noise points;
obtaining the target edge point based on the peak point set and the gray level transition direction of the target curve;
Calculating a maximum distance, a minimum distance and an average distance based on the target edge points to obtain the target distance.
In this solution, the non-maximum value fitting processing based on the target curve to obtain a peak point set specifically includes:
the edge point set is put into a preset first set;
Removing points smaller than a specified threshold in a first set, and acquiring maximum points from the first set, wherein all points in a specified range corresponding to the maximum points in the first set are removed;
and taking out the maximum point and putting the maximum point into a preset second set until the first set is an empty set, and obtaining the peak point set based on the points in the second set.
A third aspect of the present invention provides a computer-readable storage medium containing therein a method program for measuring a glue width of a board of a machine, which when executed by a processor, implements the steps of a method for measuring a glue width of a board as described in any one of the above.
According to the method, the system and the readable storage medium for measuring the width of the wood board glue, disclosed by the invention, the influence of external interference on a measurement result is effectively reduced by accurately controlling the measurement parameters, and the reliability of measurement data is ensured. Meanwhile, the high robustness of the method enables the method to adapt to the change of the glue width of the wood board in different environments, so that the production efficiency and the product quality are improved.
In addition, the method is simple and convenient to operate and easy to implement, and saves a great amount of manpower and material resource cost for enterprises. In conclusion, the high-robustness wood board glue width measuring method has remarkable beneficial effects and has important significance in improving accuracy and efficiency of wood board glue width measurement.
Drawings
FIG. 1A is a schematic diagram showing the measurement of the glue width of a wood board with poor glue line;
FIG. 1B is a schematic diagram showing the measurement of the glue width of a wood board with uneven edges;
FIG. 2 shows a flow chart of a method of measuring glue width of a wood board according to the invention;
FIG. 3 is a schematic view showing a sectional projection of a method for measuring glue width of a wood board according to the present invention;
FIG. 4 is a schematic diagram showing the correspondence between the curve peak and the edge of a method for measuring the glue width of a wood board according to the present invention;
FIG. 5 is a schematic view of a segmented image of a double edge of a method for measuring glue width of a wood board according to the present invention;
FIG. 6A is a schematic diagram showing a graph of the invention before a suppression algorithm for a method for measuring the glue width of a wood board;
FIG. 6B is a schematic diagram showing a graph of the method for measuring the width of a wood board according to the present invention after an algorithm for suppressing the width of the wood board;
Fig. 7 shows a block diagram of a wood board glue width measuring system according to the invention.
Detailed Description
In order that the above-recited objects, features and advantages of the present application will be more clearly understood, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description. It should be noted that, without conflict, the embodiments of the present application and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention, but the present invention may be practiced in other ways than those described herein, and therefore the scope of the present invention is not limited to the specific embodiments disclosed below.
In the wood board industry, gluing and edge sealing operations are required during wood board production, and poor quality of finished wood boards (such as wood veneers) is caused by poor gluing and edge sealing operations, so that adverse effects are brought to later-stage customer construction. Therefore, the quality of the wood board finished product needs to be detected in the wood board production process, and the glue width measurement is an important item.
The adhesive width measurement can be used for detecting the problems of poor adhesive joints, uneven edge sealing and the like. Because the wood board is of various material types and complex in production environment, edges with various shapes can be displayed when the glue line is bad and the edge sealing is uneven, and the edge detection of the glue can be seriously influenced to influence the measurement of the glue width, wherein the situation of bad glue line is shown in fig. 1A, and the situation of uneven edge sealing is shown in fig. 1B. Through the pictures of the wood board glue width to be measured under the two listed conditions, the double horizontal lines in the illustration represent the edges to be detected, the double arrow vertical lines represent the maximum width, and the glue side edges to be detected under different conditions can be seen to be different.
Aiming at the disclosed prior art, the existing wood board glue width measuring method has the defects of unstable manual measurement, low equipment precision, high requirement on the wood board surface condition and the like. Therefore, a measurement method with high robustness is urgently needed to overcome the problems and improve the accuracy and efficiency of measuring the width of the wood board glue.
In this regard, the application provides a method for measuring the glue width of a wood board, wherein fig. 2 shows a flow chart of the method for measuring the glue width of the wood board.
Specifically, as shown in fig. 2, the application discloses a method for measuring the glue width of a wood board, which comprises the following steps:
S202, acquiring image data of a wood board;
s204, carrying out segmented projection based on the image data to obtain projection curves of all segments;
S206, extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
S208, screening to obtain target edge points based on the target curve, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance.
It should be noted that in this embodiment, firstly, image data corresponding to a glued board is obtained, then, preprocessing, for example, gaussian filtering is performed on a graph to remove noise, a projection curve at each section is obtained by performing a sectional horizontal projection operation on the image, and an edge point set of each section edge is extracted according to the projection curve to perform straight line fitting to obtain the target curve, where the target curve includes an upper curve and a lower curve, then, noise edge points are removed, a target edge point is screened out based on the target curve, specifically, the target curve can be obtained by performing non-maximum value fitting processing on the target curve, and finally, a maximum distance, a minimum distance and an average distance are calculated based on the target edge point to obtain the target distance, where the target edge point corresponds to an edge point in the upper curve and the lower curve.
According to an embodiment of the present invention, the performing segmented projection based on the image data to obtain a projection curve of each segment specifically includes:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
And connecting according to the segment sequence based on the horizontal projection corresponding to each target segment to obtain the projection curve.
It should be noted that, in this embodiment, as shown in fig. 3, a segmentation projection schematic diagram is shown, specifically, a segmentation method is adopted, a complex edge cannot be extracted, according to the horizontal characteristic of a gum road edge, edge extraction can be performed by adopting a horizontal projection method, and considering that the edge is not completely horizontal, a full-image horizontal projection effect is not good, and therefore a segmentation projection method is adopted, wherein a segmentation size and a step size can be designated when segmentation is performed, so that segmentation parameters designated by a user side are acquired, wherein the segmentation parameters include a segment parameter and a step size, the smaller the segment size, the finer the acquired edge points are, but the influence of noise is easy; conversely, the larger the segment size, the more noise-resistant, the extracted edges are coarse edges; the step action is similar, so that the noise immunity can be realized, and meanwhile, when the step is increased, the speed of extracting the edge can be improved.
Further, the extraction of the edge points in one segment requires first projecting an extraction curve, the horizontal projection method comprises traversing according to the line from top to bottom, obtaining the average value of each line of pixels, performing differential processing based on the pixel sequence corresponding to each line of pixels to obtain horizontal projections corresponding to each target segment, displaying as a schematic diagram corresponding to the curve peak and the edge of the horizontal projection of the segment, and then connecting according to the segment sequence based on the horizontal projections corresponding to each target segment to obtain the projection curve.
According to an embodiment of the present invention, performing differential processing on a pixel sequence to obtain the horizontal projection specifically includes:
and filtering the pixel sequence by using a preset kernel, wherein the form of the preset kernel comprises:
k is the preset kernel, and n is the number of peak points of the projection curve.
It should be noted that, in this embodiment, the curve obtained by using the difference is easier to determine where the edge is by the peak point, and when the difference is performed, the curve is first smoothed to avoid noise influence, specifically, the kernel [ -1, -,2, -3,3,2,1] is used to perform the filtering processing on the point set, and when the kernel is larger, the noise immunity is better. The core form is as follows: wherein K is the preset kernel, n is the number of projection curve peak points, and n is more than or equal to 2.
According to an embodiment of the present invention, the extracting an edge point set of each segment edge based on the projection curve to obtain a target curve specifically includes:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
And obtaining the target curve based on the upper curve and the lower curve, wherein noise points are removed from the target curve.
It should be noted that, in this embodiment, the edges of the image may have a sudden change of gray scale, and may be classified into bright-dark and dark-bright, so that the gray scale change direction may be determined based on the sudden change of gray scale of the edge of the image, so that the curve edge may be determined based on the gray scale change direction, where the point value on the upper curve is smaller than "0" when bright-dark, and the point value on the dark-to-bright curve is larger than "0", so that the gray scale change direction may be defined when detecting the edge, so that some double edges may be eliminated, and as shown in fig. 5, a segmented image displayed as a double edge may be specifically determined according to the gray scale change direction, where the upper curve is obtained based on the first change direction of gray scale, the lower curve grass is obtained based on the second change direction of gray scale, so that the target curve is obtained based on the upper curve and the lower curve, and the noise point may be removed from the target curve.
According to an embodiment of the present invention, the filtering based on the target curve to obtain a target edge point, and calculating a target distance based on the target edge point specifically includes:
Performing non-maximum value fitting processing based on the target curve to obtain a peak point set;
after the peak point set in the edge point set is removed, performing straight line fitting on the rest edge points, and calculating the distance between a fitting curve and each point in the edge point set so as to remove the noise points;
obtaining the target edge point based on the peak point set and the gray level transition direction of the target curve;
Calculating a maximum distance, a minimum distance and an average distance based on the target edge points to obtain the target distance.
In the present embodiment, it is known that a plurality of peak points exist on the curve from the projection curve shown in fig. 4, and the two points with the largest peak values are assumed as edge points according to a normal rule. But there may be multiple larger peaks near the peak edges due to noise, which should belong to the same edge on the image. Therefore, it is necessary to perform non-maximum fitting processing on the projection curve while excluding noise points whose threshold value is smaller than a certain value.
Further, the projection curve shown in fig. 4 after the non-maximum value suppression processing has only "3" peak points, and it can be known from the gray scale change direction that the upper edge is dark to bright and the lower edge is light to dark, so that two points of the edge are obtained. The edge point set is obtained by a segmented horizontal projection mode, and noise edge points possibly are extracted due to noise influence, so that elimination is needed. And performing straight line fitting on the edge points, traversing the distance from each edge point to the straight line, removing noise when the distance is larger than a certain value, finally removing the obtained edge points to obtain a final peak point set, obtaining the target edge points based on the peak point set and the gray level transition direction of the target curve, and calculating the maximum distance, the minimum distance and the average distance based on the target edge points to obtain the target distance.
According to an embodiment of the present invention, the non-maximum fitting processing is performed based on the target curve to obtain a peak point set, and the method specifically includes:
the edge point set is put into a preset first set;
Removing points smaller than a specified threshold in a first set, and acquiring maximum points from the first set, wherein all points in a specified range corresponding to the maximum points in the first set are removed;
and taking out the maximum point and putting the maximum point into a preset second set until the first set is an empty set, and obtaining the peak point set based on the points in the second set.
In this embodiment, as shown in fig. 6A-6B, a projection curve non-maximum suppression contrast graph is shown, wherein fig. 6A shows a graph before the suppression algorithm, and fig. 6B shows a graph after the suppression algorithm, and the specific steps are as follows: (1) placing the set of edge points into set a; (2) The points in the set A, the value of which is smaller than the specified threshold value, are eliminated (noise points), wherein the specified threshold value corresponds to the eliminating threshold value of the noise points, and the eliminating threshold value is specifically the conventional technical means of denoising, and the details are not repeated here; (3) Obtaining a maximum point p from the set A, popping up the maximum point p to be put into the set B, wherein the set A excludes all points in the p-point designated field range; (4) And (3) if the set A is not empty, performing operations (2) - (3), otherwise, taking the points in the set B as the peak point set.
Fig. 7 shows a block diagram of a wood board glue width measuring system according to the invention.
As shown in fig. 7, the invention discloses a system for measuring the width of a wood board glue, which comprises a memory and a processor, wherein the memory comprises a method program for measuring the width of the wood board glue, and the method program for measuring the width of the wood board glue realizes the following steps when being executed by the processor:
acquiring image data of a wood board;
Carrying out segmented projection based on the image data to obtain projection curves of all segments;
extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
and screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance.
It should be noted that in this embodiment, firstly, image data corresponding to a glued board is obtained, then, preprocessing, for example, gaussian filtering is performed on a graph to remove noise, a projection curve at each section is obtained by performing a sectional horizontal projection operation on the image, and an edge point set of each section edge is extracted according to the projection curve to perform straight line fitting to obtain the target curve, where the target curve includes an upper curve and a lower curve, then, noise edge points are removed, a target edge point is screened out based on the target curve, specifically, the target curve can be obtained by performing non-maximum value fitting processing on the target curve, and finally, a maximum distance, a minimum distance and an average distance are calculated based on the target edge point to obtain the target distance, where the target edge point corresponds to an edge point in the upper curve and the lower curve.
According to an embodiment of the present invention, the performing segmented projection based on the image data to obtain a projection curve of each segment specifically includes:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
And connecting according to the segment sequence based on the horizontal projection corresponding to each target segment to obtain the projection curve.
It should be noted that, in this embodiment, as shown in fig. 3, a segmentation projection schematic diagram is shown, specifically, a segmentation method is adopted, a complex edge cannot be extracted, according to the horizontal characteristic of a gum road edge, edge extraction can be performed by adopting a horizontal projection method, and considering that the edge is not completely horizontal, a full-image horizontal projection effect is not good, and therefore a segmentation projection method is adopted, wherein a segmentation size and a step size can be designated when segmentation is performed, so that segmentation parameters designated by a user side are acquired, wherein the segmentation parameters include a segment parameter and a step size, the smaller the segment size, the finer the acquired edge points are, but the influence of noise is easy; conversely, the larger the segment size, the more noise-resistant, the extracted edges are coarse edges; the step action is similar, so that the noise immunity can be realized, and meanwhile, when the step is increased, the speed of extracting the edge can be improved.
Further, the extraction of the edge points in one segment requires first projecting an extraction curve, the horizontal projection method comprises traversing according to the line from top to bottom, obtaining the average value of each line of pixels, performing differential processing based on the pixel sequence corresponding to each line of pixels to obtain horizontal projections corresponding to each target segment, displaying as a schematic diagram corresponding to the curve peak and the edge of the horizontal projection of the segment, and then connecting according to the segment sequence based on the horizontal projections corresponding to each target segment to obtain the projection curve.
According to an embodiment of the present invention, performing differential processing on a pixel sequence to obtain the horizontal projection specifically includes:
and filtering the pixel sequence by using a preset kernel, wherein the form of the preset kernel comprises:
k is the preset kernel, and n is the number of peak points of the projection curve.
It should be noted that, in this embodiment, the curve obtained by using the difference is easier to determine where the edge is by the peak point, and when the difference is performed, the curve is first smoothed to avoid noise influence, specifically, the kernel [ -1, -,2, -3,3,2,1] is used to perform the filtering processing on the point set, and when the kernel is larger, the noise immunity is better. The core form is as follows: wherein K is the preset kernel, n is the number of projection curve peak points, and n is more than or equal to 2.
According to an embodiment of the present invention, the extracting an edge point set of each segment edge based on the projection curve to obtain a target curve specifically includes:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
And obtaining the target curve based on the upper curve and the lower curve, wherein noise points are removed from the target curve.
It should be noted that, in this embodiment, the edges of the image may have a sudden change of gray scale, and may be classified into bright-dark and dark-bright, so that the gray scale change direction may be determined based on the sudden change of gray scale of the edge of the image, so that the curve edge may be determined based on the gray scale change direction, where the point value on the upper curve is smaller than "0" when bright-dark, and the point value on the dark-to-bright curve is larger than "0", so that the gray scale change direction may be defined when detecting the edge, so that some double edges may be eliminated, and as shown in fig. 5, a segmented image displayed as a double edge may be specifically determined according to the gray scale change direction, where the upper curve is obtained based on the first change direction of gray scale, the lower curve grass is obtained based on the second change direction of gray scale, so that the target curve is obtained based on the upper curve and the lower curve, and the noise point may be removed from the target curve.
According to an embodiment of the present invention, the filtering based on the target curve to obtain a target edge point, and calculating a target distance based on the target edge point specifically includes:
Performing non-maximum value fitting processing based on the target curve to obtain a peak point set;
after the peak point set in the edge point set is removed, performing straight line fitting on the rest edge points, and calculating the distance between a fitting curve and each point in the edge point set so as to remove the noise points;
obtaining the target edge point based on the peak point set and the gray level transition direction of the target curve;
Calculating a maximum distance, a minimum distance and an average distance based on the target edge points to obtain the target distance.
In the present embodiment, it is known that a plurality of peak points exist on the curve from the projection curve shown in fig. 4, and the two points with the largest peak values are assumed as edge points according to a normal rule. But there may be multiple larger peaks near the peak edges due to noise, which should belong to the same edge on the image. Therefore, it is necessary to perform non-maximum fitting processing on the projection curve while excluding noise points whose threshold value is smaller than a certain value.
Further, the projection curve shown in fig. 4 after the non-maximum value suppression processing has only "3" peak points, and it can be known from the gray scale change direction that the upper edge is dark to bright and the lower edge is light to dark, so that two points of the edge are obtained. The edge point set is obtained by a segmented horizontal projection mode, and noise edge points possibly are extracted due to noise influence, so that elimination is needed. And performing straight line fitting on the edge points, traversing the distance from each edge point to the straight line, removing noise when the distance is larger than a certain value, finally removing the obtained edge points to obtain a final peak point set, obtaining the target edge points based on the peak point set and the gray level transition direction of the target curve, and calculating the maximum distance, the minimum distance and the average distance based on the target edge points to obtain the target distance.
According to an embodiment of the present invention, the non-maximum fitting processing is performed based on the target curve to obtain a peak point set, and the method specifically includes:
the edge point set is put into a preset first set;
Removing points smaller than a specified threshold in a first set, and acquiring maximum points from the first set, wherein all points in a specified range corresponding to the maximum points in the first set are removed;
and taking out the maximum point and putting the maximum point into a preset second set until the first set is an empty set, and obtaining the peak point set based on the points in the second set.
In this embodiment, as shown in fig. 6A-6B, a projection curve non-maximum suppression contrast graph is shown, wherein fig. 6A shows a graph before the suppression algorithm, and fig. 6B shows a graph after the suppression algorithm, and the specific steps are as follows: (1) placing the set of edge points into set a; (2) The points in the set A, the value of which is smaller than the specified threshold value, are eliminated (noise points), wherein the specified threshold value corresponds to the eliminating threshold value of the noise points, and the eliminating threshold value is specifically the conventional technical means of denoising, and the details are not repeated here; (3) Obtaining a maximum point p from the set A, popping up the maximum point p to be put into the set B, wherein the set A excludes all points in the p-point designated field range; (4) And (3) if the set A is not empty, performing operations (2) - (3), otherwise, taking the points in the set B as the peak point set.
A third aspect of the present invention provides a computer-readable storage medium, in which a method program for measuring a glue width of a board is included, which when executed by a processor, implements the steps of a method for measuring a glue width of a board as described in any one of the above.
According to the method, the system and the readable storage medium for measuring the width of the wood board glue, disclosed by the invention, the influence of external interference on a measurement result is effectively reduced by accurately controlling the measurement parameters, and the reliability of measurement data is ensured. Meanwhile, the high robustness of the method enables the method to adapt to the change of the glue width of the wood board in different environments, so that the production efficiency and the product quality are improved.
In addition, the method is simple and convenient to operate and easy to implement, and saves a great amount of manpower and material resource cost for enterprises. In conclusion, the high-robustness wood board glue width measuring method has remarkable beneficial effects and has important significance in improving accuracy and efficiency of wood board glue width measurement.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above described device embodiments are only illustrative, e.g. the division of the units is only one logical function division, and there may be other divisions in practice, such as: multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed. In addition, the various components shown or discussed may be coupled or directly coupled or communicatively coupled to each other via some interface, whether indirectly coupled or communicatively coupled to devices or units, whether electrically, mechanically, or otherwise.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units; can be located in one place or distributed to a plurality of network units; some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present invention may be integrated in one processing unit, or each unit may be separately used as one unit, or two or more units may be integrated in one unit; the integrated units may be implemented in hardware or in hardware plus software functional units.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: a mobile storage device, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk or optical disk, or the like, which can store program codes.
Or the above-described integrated units of the invention may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present invention may be embodied in essence or a part contributing to the prior art in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of the present invention. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.

Claims (6)

1. The method for measuring the glue width of the wood board is characterized by comprising the following steps of:
acquiring image data of a wood board;
Carrying out segmented projection based on the image data to obtain projection curves of all segments;
extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
Screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance;
the step of carrying out segmented projection based on the image data to obtain projection curves of all segments specifically comprises the following steps:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
Connecting according to a segmentation sequence based on horizontal projections corresponding to each target segment to obtain a projection curve;
the extracting the edge point set of each section of edge based on the projection curve to obtain a target curve specifically comprises the following steps:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
And obtaining the target curve based on the upper curve and the lower curve, wherein noise points are removed from the target curve.
2. The method for measuring the glue width of a wood board according to claim 1, wherein the difference processing is performed on the pixel sequence to obtain the horizontal projection, specifically comprising:
and filtering the pixel sequence by using a preset kernel, wherein the form of the preset kernel comprises:
k is the preset kernel, n is the number of projection curve peak points, and n is more than or equal to 2.
3. The method for measuring the width of a wood board according to claim 1, wherein the screening based on the target curve obtains a target edge point, and the calculating of the target distance based on the target edge point specifically comprises:
Performing non-maximum value fitting processing based on the target curve to obtain a peak point set;
after the peak point set in the edge point set is removed, performing straight line fitting on the rest edge points, and calculating the distance between a fitting curve and each point in the edge point set so as to remove the noise points;
obtaining the target edge point based on the peak point set and the gray level transition direction of the target curve;
Calculating a maximum distance, a minimum distance and an average distance based on the target edge points to obtain the target distance.
4. A method for measuring a width of a wood board glue according to claim 3, wherein the non-maximum fitting process is performed based on the target curve to obtain a peak point set, and the method specifically comprises:
the edge point set is put into a preset first set;
Removing points smaller than a specified threshold in a first set, and acquiring maximum points from the first set, wherein all points in a specified range corresponding to the maximum points in the first set are removed;
and taking out the maximum point and putting the maximum point into a preset second set until the first set is an empty set, and obtaining the peak point set based on the points in the second set.
5. The system for measuring the width of the wood board glue is characterized by comprising a memory and a processor, wherein the memory comprises a wood board glue width measuring method program, and the wood board glue width measuring method program is executed by the processor and comprises the following steps:
acquiring image data of a wood board;
Carrying out segmented projection based on the image data to obtain projection curves of all segments;
extracting an edge point set of each section of edge based on the projection curve to obtain a target curve, wherein the target curve comprises an upper curve and a lower curve;
Screening the target curve to obtain target edge points, and calculating target distances based on the target edge points, wherein the target distances comprise a maximum distance, a minimum distance and an average distance;
the step of carrying out segmented projection based on the image data to obtain projection curves of all segments specifically comprises the following steps:
Acquiring segmentation parameters appointed by a user side, wherein the segmentation parameters comprise segment parameters and step sizes;
segmenting the image data based on the segmentation parameters to obtain a plurality of target segments;
traversing the target segments according to rows to obtain an average value of pixels in each row, and carrying out differential processing on the basis of pixel sequences corresponding to the pixels in each row to obtain horizontal projections corresponding to each target segment;
Connecting according to a segmentation sequence based on horizontal projections corresponding to each target segment to obtain a projection curve;
the extracting the edge point set of each section of edge based on the projection curve to obtain a target curve specifically comprises the following steps:
determining a gray scale change direction based on the gray scale abrupt change of the image edge;
determining a curve edge based on the gray scale variation direction, wherein,
Obtaining the upper curve based on the first gray scale change direction and obtaining the lower curve based on the second gray scale change direction;
the target curve is obtained based on the upper curve and the lower curve.
6. A computer-readable storage medium, characterized in that the computer-readable storage medium contains a wood board glue width measuring method program, which, when executed by a processor, implements the steps of a wood board glue width measuring method according to any one of claims 1 to 4.
CN202410584819.0A 2024-05-13 2024-05-13 Method, system and readable storage medium for measuring width of wood board glue Active CN118154664B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410584819.0A CN118154664B (en) 2024-05-13 2024-05-13 Method, system and readable storage medium for measuring width of wood board glue

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410584819.0A CN118154664B (en) 2024-05-13 2024-05-13 Method, system and readable storage medium for measuring width of wood board glue

Publications (2)

Publication Number Publication Date
CN118154664A CN118154664A (en) 2024-06-07
CN118154664B true CN118154664B (en) 2024-09-20

Family

ID=91297364

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410584819.0A Active CN118154664B (en) 2024-05-13 2024-05-13 Method, system and readable storage medium for measuring width of wood board glue

Country Status (1)

Country Link
CN (1) CN118154664B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102679883A (en) * 2012-05-09 2012-09-19 中国科学院光电技术研究所 Tobacco shred width measuring method based on image processing
CN111563412A (en) * 2020-03-31 2020-08-21 武汉大学 A Fast Lane Line Detection Method Based on Parameter Space Voting and Bessel Fitting

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6873747B2 (en) * 2000-07-25 2005-03-29 Farid Askary Method for measurement of pitch in metrology and imaging systems
US7013047B2 (en) * 2001-06-28 2006-03-14 National Instruments Corporation System and method for performing edge detection in an image
US9030559B2 (en) * 2012-08-28 2015-05-12 Palo Alto Research Center Incorporated Constrained parametric curve detection using clustering on Hough curves over a sequence of images
CN111986139B (en) * 2019-05-23 2024-07-05 深圳市理邦精密仪器股份有限公司 Method, device and storage medium for measuring carotid intima-media thickness
CN113077467B (en) * 2021-06-08 2021-08-31 深圳市华汉伟业科技有限公司 Edge defect detection method and device for target object and storage medium
CN114199148A (en) * 2021-10-13 2022-03-18 杭州涿溪脑与智能研究所 Heat exchanger fin pitch measurement method and device based on machine vision and medium
CN115457063A (en) * 2022-08-23 2022-12-09 武汉海微科技有限公司 Method, device and equipment for extracting edge of circular hole of PCB (printed Circuit Board) and storage medium
CN117173202A (en) * 2023-08-10 2023-12-05 深圳辰视智能科技有限公司 Gray gradient-based colloid edge detection method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102679883A (en) * 2012-05-09 2012-09-19 中国科学院光电技术研究所 Tobacco shred width measuring method based on image processing
CN111563412A (en) * 2020-03-31 2020-08-21 武汉大学 A Fast Lane Line Detection Method Based on Parameter Space Voting and Bessel Fitting

Also Published As

Publication number Publication date
CN118154664A (en) 2024-06-07

Similar Documents

Publication Publication Date Title
CN113781402B (en) Method and device for detecting scratch defects on chip surface and computer equipment
CN113688807B (en) Self-adaptive defect detection method, device, recognition system and storage medium
KR101895873B1 (en) Method and apparatus for fabric inspection
CN102496161B (en) Method for extracting contour of image of printed circuit board (PCB)
CN111046862B (en) Character segmentation method, device and computer readable storage medium
CN110070523B (en) A kind of foreign matter detection method for bottle bottom
CN111027546A (en) Character segmentation method and device and computer readable storage medium
CN115330784A (en) A kind of cloth surface defect detection method
CN113628161B (en) Defect detection method, device and computer readable storage medium
CN111598801B (en) Identification method for weak Mura defect
CN113947598A (en) Plastic lunch box defect detection method, device and system based on image processing
CN113298769B (en) FPC flexible flat cable appearance defect detection method, system and medium
CN112669295A (en) Lithium battery pole piece defect detection method based on secondary threshold segmentation theory
CN117611540A (en) A lithium battery pole piece coating defect detection method and related equipment
CN112802022B (en) Method for intelligently detecting defective glass image, electronic device and storage medium
CN109102507A (en) Screw thread detection method and device
CN116934746A (en) Scratch defect detection method, system, equipment and medium thereof
CN107862689A (en) Leather surface substantially damaged automatic identifying method and computer-readable recording medium
CN103245667A (en) Method and system for automatically detecting mechanical scratches
KR20160054150A (en) System and Method for Automatically Detecting a Mura Defect using Morphological Image Processing and Labeling
CN118154664B (en) Method, system and readable storage medium for measuring width of wood board glue
KR101966075B1 (en) Apparatus and Method for Detection MURA in Display Device
CN115482239A (en) Image positioning method, system, device and medium
CN115456909A (en) Depth image processing method and device, electronic equipment and storage medium
CN119228864A (en) A method, system and medium for detecting the length of wooden board edge banding based on vision

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