CN117372663A - Method, device, equipment and storage medium for supplementing log end face shielding - Google Patents

Method, device, equipment and storage medium for supplementing log end face shielding Download PDF

Info

Publication number
CN117372663A
CN117372663A CN202311155391.XA CN202311155391A CN117372663A CN 117372663 A CN117372663 A CN 117372663A CN 202311155391 A CN202311155391 A CN 202311155391A CN 117372663 A CN117372663 A CN 117372663A
Authority
CN
China
Prior art keywords
contour
face
convex hull
points
determining
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.)
Pending
Application number
CN202311155391.XA
Other languages
Chinese (zh)
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.)
Beijing Zhida Hongchuang Technology Co ltd
Original Assignee
Beijing Zhida Hongchuang 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 Beijing Zhida Hongchuang Technology Co ltd filed Critical Beijing Zhida Hongchuang Technology Co ltd
Priority to CN202311155391.XA priority Critical patent/CN117372663A/en
Publication of CN117372663A publication Critical patent/CN117372663A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts

Landscapes

  • Engineering & Computer Science (AREA)
  • Architecture (AREA)
  • Computer Graphics (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)

Abstract

A method, a device, equipment and a storage medium for supplementing the shielding of a log end face, wherein the method comprises the following steps: acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack; judging the end faces where intersection is possible; screening out contour points with the end face distance within a preset range on the end faces possibly having intersection, forming corresponding contour segments, removing contour segments which do not meet shielding conditions from the contour segments, and forming corresponding target contour segments by the remaining segments; determining an occluded end face based on depth information of the target profile segment; determining a convex hull formed by the contour segments corresponding to the blocked end surfaces, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting an optimal circle to be complemented based on the three-dimensional coordinate points in the point set and the convex hull points in the convex hull, and finally taking the fitted circle to be complemented as the complemented contour of the blocked end surfaces. The technical scheme provided by the embodiment of the invention can obtain accurate complement contour, can reduce measurement error and can improve processing efficiency.

Description

Method, device, equipment and storage medium for supplementing log end face shielding
Technical Field
The embodiment of the invention relates to the technical field of log measurement, in particular to a method, a device, equipment and a storage medium for supplementing log end face shielding.
Background
Measurement of the information of a log stack is an important element of the work of the forestry unit, e.g. measurement of the volume, radial direction, length etc. of the logs in the log stack. The traditional mode is through the manual work, and in recent years, can replace manual measurement through automatic gauge system of log, improved measurement efficiency greatly.
In the practical application process, the automatic log scale system uses a binocular camera to photograph the log end faces in the log stack and identifies and three-dimensionally models the contours, but because the log stack is large in size, the log is placed randomly and the size of each log is different, the phenomenon that the photographing angle is not very sufficient exists, the contours of the log end faces which are partially photographed are difficult to avoid being blocked by other contours, the contours of the log end faces are not complete, and thus inaccurate measurement is caused.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a storage medium for supplementing the shielding of a log end surface, which can obtain an accurate supplementing profile, reduce measurement errors and improve processing efficiency.
In a first aspect, an embodiment of the present invention provides a method for complementing a log end face shielding, including:
acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack;
judging the end faces with possible intersections based on the pixel coordinates of the contour points of all the end faces;
screening out contour points with the end face distance within a preset range on the end faces possibly having intersection, forming corresponding contour segments, removing contour segments which do not meet shielding conditions from the contour segments, and forming corresponding target contour segments by the residual contour segments;
determining depth information of the target contour segment, and determining an occluded end face based on the depth information;
determining a convex hull formed by the outline section corresponding to the blocked end face, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting an optimal circle to be complemented based on convex hull points in the convex hull and the three-dimensional coordinate points in the point set, and taking the circle to be complemented as the complemented outline of the blocked end face.
In a second aspect, an embodiment of the present invention provides a complement device for shielding an end surface of a log, including:
the acquisition module is used for acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack;
the judging module is used for judging the end faces possibly having intersection based on the pixel coordinates of the contour points of all the end faces;
the selecting and eliminating module is used for selecting contour points with the end face distance within a preset range on the end face with the possible intersection to form corresponding contour segments, eliminating contour segments which do not meet shielding conditions in the contour segments, and forming target contour segments according to the residual contour segments;
the first determining module is used for determining depth information of the target contour segment and determining an occluded end face based on the depth information;
the second determining module is used for determining a convex hull formed by the outline section corresponding to the blocked end face, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting the optimal circle to be complemented based on convex hull points in the convex hull and the three-dimensional coordinate points in the point set, and taking the circle to be complemented as the complemented outline of the blocked end face.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the methods provided by the embodiments of the present invention.
In a fourth aspect, embodiments of the present invention provide a computer readable storage medium storing computer instructions for causing a processor to execute a method provided by embodiments of the present invention.
According to the technical scheme provided by the embodiment of the invention, the pixel coordinates of the contour points of each log end surface in the log stack and the corresponding three-dimensional coordinates are obtained, the end surface possibly with intersection is judged based on the pixel coordinates of the contour points of all the end surfaces, the contour points with the end surface distances within the preset range are selected on the end surface possibly with intersection to form the corresponding contour segments, the contour segments which do not meet the shielding conditions are removed from the contour segments, the residual contour segments form the corresponding target contour segments, and a small amount of data can be processed, so that the efficiency is improved; the method comprises the steps of determining depth information of a target contour segment, determining an occluded end face based on the depth information, determining a convex hull formed by a contour segment corresponding to the occluded end face, determining a point set corresponding to the convex hull in three-dimensional coordinates, fitting an optimal circle to be complemented based on three-dimensional coordinate points in the point set and convex hull points in the convex hull, and taking the circle to be complemented as a complemented contour of the occluded end face.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Figure 1a is a flow chart of a method for supplementing the end face shielding of a log according to an embodiment of the present invention;
FIG. 1b is a schematic illustration of the effect of a contour segment formed by selected contour points;
FIG. 1c is a schematic view of the effect of the remaining contour segments after the contour segments that do not meet the occlusion condition are removed;
fig. 2 is a flowchart of a method for supplementing the end face shielding of a log according to an embodiment of the present invention;
figure 3 is a flow chart of a method for supplementing the end face shielding of a log provided by an embodiment of the invention;
FIG. 4 is a schematic diagram of a complement profile effect;
FIG. 5 is a schematic illustration of the effect before the outline is not completed;
fig. 6 is a schematic structural view of a device for shielding an end face of a log according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present invention and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Fig. 1a is a flowchart of a method for supplementing the log end face shielding, which is provided by the embodiment of the invention, the method can be implemented by a log end face shielding supplementing device, the device can be implemented by software and/or hardware, the device can be configured in electronic equipment such as log inspection equipment, a computer and the like, and the method can be applied to a scene of measuring log stacks.
As shown in fig. 1a, the technical solution provided by the embodiment of the present invention includes:
s110: and acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack.
In the embodiment of the invention, a binocular camera can be used for shooting the log stack to obtain a log stack image, and the contour of the log end face can be extracted from the log stack image through a trained neural network model, so that the pixel coordinates of the contour point of each log end face in the log stack are obtained.
In the embodiment of the invention, corresponding log stacking images can be obtained by shooting through a binocular camera, the three-dimensional coordinates of the contour points of each log end face can be calculated through the parallax of the log stacking images, and the calculation can be particularly performed through a deep learning model method.
In the embodiment of the invention, after the pixel coordinates and the corresponding three-dimensional coordinates of the contour points of each log end face are obtained through the log stack image, the pixel coordinates and the corresponding three-dimensional coordinates of the contour points of the log end faces in the two side faces or each side face of the log stack can be input into the electronic equipment provided by the embodiment of the invention, and in the calculation process, contour completion is carried out on the blocked end face in each side face, and finally, the contour completion of the blocked end faces in the two side faces of the log stack is completed.
S120: the end faces where intersection is possible are judged based on the pixel coordinates of the contour points of all the end faces.
In one implementation manner of the embodiment of the present invention, optionally, the determining that there may be an intersected end face based on the pixel point coordinates of the contour points of all end faces includes: and constructing an external rectangle of the corresponding end face based on pixel coordinates of contour points of each end face of the log, and judging the end face possibly having intersection based on the external rectangle. Specifically, in a coordinate system corresponding to the pixel coordinates, the contour of each end face can be obtained for the pixel coordinates of the contour point of each end face, an external rectangle of each contour is constructed, and the end face with the intersection possibly exists is judged based on the external rectangle.
In a specific embodiment, optionally, the determining that there may be an intersecting end face based on the circumscribed rectangle includes: if the intersection exists in the circumscribed rectangle, judging that the intersection exists in the end face corresponding to the circumscribed rectangle. Specifically, whether the intersection exists on the end face corresponding to the circumscribed rectangle is judged through whether the intersection exists on the circumscribed rectangle or not. If the two circumscribed rectangles have intersection, the fact that the log end faces corresponding to the two circumscribed rectangles respectively possibly have intersection is judged. If the two circumscribed rectangles do not have the intersection, judging that the log end faces corresponding to the two circumscribed rectangles respectively do not have the intersection. The log end surface corresponding to the circumscribed rectangle is understood to be the log end surface in the circumscribed rectangle, and the log end surface is formed by the corresponding contour points.
Therefore, the external rectangle is constructed through the pixel coordinates of each end face, the end face with the intersection possibly is judged through the external rectangle, and the end face with the intersection can be more comprehensively and accurately determined, so that a basis is better provided for subsequent shielding judgment.
S130: and screening out contour points with the end face distance within a preset range on the end faces possibly having intersection points to form corresponding contour segments, removing contour segments which do not meet shielding conditions from the contour segments, and forming target contour segments according to the remaining contour segments.
In the embodiment of the present invention, the contour point with the end face distance within the preset range may be understood as a contour point with a distance between a point on one end face and a point on the other end face included within the preset range, where the preset range may be set according to requirements, for example, in taking a picture with a suitable pixel length and width between 1000 pixels and 4000 pixels, the preset range may be a 20-pixel manhattan distance. And selecting out contour points with the end face distance within a preset range, and forming corresponding contour sections on the two corresponding end faces. For example, as shown in fig. 1b, by determining that there may be an end face of an intersection, the contour segment indicated in fig. 1b is a corresponding contour segment (shown by a black bold line in the drawing) formed by selecting a contour point having an end face distance within a predetermined range. It should be noted that, for the end surfaces where there may be an intersection, two contour segments should be marked, and the two contour segments are relatively similar and have a slight difference, and for convenience of illustration, in fig. 1b of this embodiment, one contour segment is used for marking the end surfaces where there may be an intersection.
In one implementation manner of the embodiment of the present invention, optionally, the removing, from the contour segments, a contour segment that does not meet the shielding condition includes: and removing the contour segments with the length value smaller than a preset length threshold and the radian value smaller than a preset radian threshold from the contour segments. Specifically, for the two end faces where intersection is possible, by selecting the contour points with the end face distance within the preset range, corresponding contour segments, namely two contour segments, are formed on the respective end faces, if the length value of each contour segment is smaller than the preset length threshold value and the radian value is smaller than the preset radian threshold value, it can be indicated that the end face where intersection exists is not seriously blocked, or no blocking exists, and the contour segments can be ignored, so that the corresponding contour segments need to be removed, and the part with serious blocking is processed, so that the processing efficiency is improved (mainly because if the slight blocking is complemented, larger errors are brought, and the problem basically does not occur when the contour segments are ignored, because the contour segments can be basically ignored). Wherein, optionally, the preset length threshold may be a length value including at least two contour points, and the preset radian threshold may be 2pi/9 mm. Wherein, after the unsatisfactory contour segment is removed, the remaining target contour segment is shown as a black bold line in fig. 1 c. It should be noted that, for the end surfaces where there may be an intersection, the number of the target contour segments to be marked should be two, and the two target contour segments are relatively similar and have a slight difference, and for convenience of illustration, in fig. 1c of this embodiment, one contour segment is used for marking the end surfaces where there may be an intersection.
Therefore, contour points with the end face distance within a preset range are screened out on the end faces with the possible intersection to form corresponding contour segments, and in the contour segments, contour segments which do not meet the shielding conditions are removed, namely the end faces with the possible intersection are processed, so that the processing of the end faces without the intersection can be omitted, the processing efficiency is improved, the contour points which do not meet the shielding conditions are removed, the target contour segments are formed, the data processing range is further reduced, and the processing efficiency is improved.
S140: and determining depth information of the target contour segment, and determining the blocked end face based on the depth information.
In the embodiment of the invention, in the formed profile sections, after the profile sections which do not meet the shielding condition are removed, the remaining profile sections can be target profile sections.
In one implementation of the embodiment of the present invention, optionally, the determining depth information of the target contour segment includes: determining the depth coordinates of each contour point based on the three-dimensional coordinates of each contour point in the target contour segment; and determining an average value of the depth coordinates of the target contour segment based on the depth coordinates of each contour point, and taking the average value as the depth value of the target contour segment.
The three-dimensional coordinates in the contour points can be expressed by adopting (x, y, z), wherein the z value can be the depth coordinates of the contour points, and the average value of the depth coordinates of the contour points is determined by the depth coordinates of all the contour points on the target contour section and is taken as the depth value of the target contour section. For two end surfaces with intersection, two target contour sections exist, namely each end surface corresponds to one target contour section, and the shielding relation (the shielded end surface and the shielded end surface) of the two end surfaces can be judged through the depth values of the respective target contour sections on the two end surfaces, wherein the depth values of the target contour sections on the shielded end surfaces are larger than the depth values of the target contour sections on the shielded end surfaces.
S150: determining a convex hull formed by the outline section corresponding to the blocked end face, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting an optimal circle to be complemented based on convex hull points in the convex hull and three-dimensional coordinate points in the point set, and taking the circle to be complemented as the complemented outline of the blocked end face.
In one implementation manner of the embodiment of the present invention, optionally, determining a convex hull formed by a contour segment corresponding to the blocked end surface includes: and determining the blocked profile section corresponding to the blocked end face in the target profile section, determining the non-blocked profile section corresponding to the blocked end face, and determining the convex hull formed by the profile section corresponding to the blocked end face based on the convex hull of the blocked profile section and the convex hull of the non-blocked profile section.
Wherein a convex hull is a smallest convex polygon or convex hull that contains all the points in a given set. It is defined by a set of points in the set whose convex hulls are defined to contain all of their smallest convex polygons. Thus, a convex hull can be considered as one convex shape that is as small as possible, surrounding all given points, and no smaller convex shape is present that can surround all given points.
The target profile section comprises an occlusion profile section on an occlusion end face and an occluded profile section on an occluded end face, and the occluded profile section can be determined through depth information of the target profile section. For the occlusion profile section on the occlusion end face and the occluded profile section on the occluded end face, the occluded profile section with larger depth value can be determined, and the occluded profile section is removed from the corresponding occluded end face, namely the non-occluded profile section corresponding to the occluded end face is determined.
The convex hull of the blocked contour section is calculated by the contour points of the blocked contour section, and similarly, the convex hull of the non-blocked contour section is calculated by the contour points of the non-blocked contour section. The convex hull calculation method can use technical schemes such as Graham algorithm or Andrew algorithm, wherein the Graham algorithm is clear and definite, and the calculation efficiency is high.
In the embodiment of the invention, the coordinates in the convex hull are two-dimensional pixel coordinates, the two-dimensional pixel coordinates correspond to one three-dimensional coordinate, so that a point set corresponding to the convex hull can be found in the three-dimensional coordinates, a circle to be complemented is fitted based on convex hull points in the convex hull and three-dimensional coordinate points in the point set to serve as a complemented contour of the blocked end face, and the contour complement of the blocked end face in the log stack is completed. Optionally, the fitting of the optimal circle to be complemented based on the convex hull points in the convex hull and the three-dimensional coordinate points in the point set includes: in the convex hulls formed by the contour sections corresponding to the blocked end surfaces, key convex hull points are selected from the convex hull points corresponding to the non-blocked contour sections based on the boundaries of the blocked contour sections; selecting three-dimensional coordinate points corresponding to key convex hull points in the point set to determine a contour segment to be complemented; selecting a target convex hull point from convex hull points corresponding to the non-occluded contour segment, and selecting a three-dimensional coordinate point corresponding to the target convex hull point from the point set; and determining the complement contour of the blocked end surface based on the three-dimensional coordinate point corresponding to the target convex hull point and the contour segment to be complemented.
Specifically, in the convex hull formed by the contour segments corresponding to the blocked end surfaces, first key convex hull points closest to two end points in the blocked contour segments are found and are respectively used as search origins, convex hull points larger than a set distance are searched for each search origin, three-dimensional coordinate points corresponding to the searched convex hull points are found in a point set, wherein the set distance can be that the number of the end surface points is 2% of the number of all the end surface points corresponding to the log end surfaces (the blocked end surfaces can be referred to herein).
And selecting a second key convex hull point in the convex hulls, finding left and right convex hull points closest to the second key convex hull point, taking the convex hull point closest to the end point of the blocked contour section as a first point to be selected, taking the midpoint between the other convex hull point and the searching origin as a second point to be selected, finding three-dimensional coordinate points corresponding to the first point to be selected and the second point to be selected in the point set, determining the circle center of the contour section to be complemented based on the three-dimensional coordinate points of the four found points to be selected (the two first points to be selected and the two second points to be selected), and determining the contour section to be complemented based on the three-dimensional coordinate points and the circle center, wherein the second key convex hull point is the convex hull point with the minimum distance from the searching origin among the convex hull points with the distance from the searching origin larger than the set distance. Selecting a target convex hull point from convex hull points corresponding to the non-blocked contour segments, selecting a three-dimensional coordinate point corresponding to the target convex hull point from the point set, and determining the full contour of the blocked end face based on the three-dimensional coordinate point corresponding to the target convex hull point and the contour segments to be full. The target convex hull points refer to a first point to be selected and a second point to be selected.
According to the technical scheme provided by the embodiment of the invention, the pixel coordinates of the contour points of each log end surface in the log stack and the corresponding three-dimensional coordinates are obtained, the end surface possibly with intersection is judged based on the pixel coordinates of the contour points of all the end surfaces, the contour points with the end surface distances within the preset range are selected on the end surface possibly with intersection to form the corresponding contour segments, the contour segments which do not meet the shielding conditions are removed from the contour segments, the residual contour segments form the corresponding target contour segments, and a small amount of data can be processed, so that the efficiency is improved; the method comprises the steps of determining depth information of a target contour segment, determining an occluded end face based on the depth information, determining a convex hull formed by a contour segment corresponding to the occluded end face, determining a point set corresponding to the convex hull in three-dimensional coordinates, fitting an optimal circle to be complemented based on three-dimensional coordinate points in the point set and convex hull points in the convex hull, and taking the circle to be complemented as a complemented contour of the occluded end face.
Fig. 2 is a flowchart of a method for supplementing the end face shielding of a log according to an embodiment of the present invention, in this embodiment, optionally, the determining, based on pixel coordinates of contour points of all end faces, an end face where an intersection may exist includes:
and constructing an external rectangle of the corresponding end face based on pixel coordinates of contour points of each end face of the log, and judging the end face possibly having intersection based on the external rectangle.
Optionally, the removing, in the profile segments, the profile segments that do not meet the shielding condition includes:
and removing the contour segments with the length smaller than a preset length threshold and the radian smaller than a preset radian threshold from the contour segments.
As shown in fig. 2, the technical solution provided by the embodiment of the present invention includes:
s210: and acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack.
S220: and constructing an external rectangle of the corresponding end face based on pixel coordinates of contour points of each end face of the log, and judging the end face possibly having intersection based on the external rectangle.
S230: and carrying out outward expansion on the circumscribed rectangle on the end surface with the intersection possibly to obtain an outward expansion rectangle of the circumscribed rectangle, determining contour points with the shielding relation possibly based on the outward expansion rectangle, and selecting the contour points with the end surface distance within a preset range to form a corresponding contour segment.
In this embodiment, optionally, the circumscribed rectangles corresponding to the end faces where the intersection may exist are subjected to outward expansion, for example, the length and width of each circumscribed rectangle may be respectively subjected to outward expansion by 10 pixels, so as to obtain the corresponding outward expansion rectangle. Optionally, determining contour points where occlusion relationships may exist based on the expansion rectangle may include: and determining the contour point of one end surface as the contour point possibly having a shielding relation if the contour point of the other end surface is in the expansion rectangle corresponding to the other end surface aiming at the end surfaces possibly having the intersection. By the method, contour points possibly with shielding relation are obtained, and then selected, and corresponding contour segments are formed.
Therefore, the outline points possibly having the shielding relation are determined through the external rectangle by external expansion, and then the outline points are selected to obtain the corresponding outline sections, so that the calculation of the outline points on the end face can be reduced, and the processing speed can be improved. S240: and removing the contour segments with the length smaller than a preset length threshold and the radian smaller than a preset radian threshold from the contour segments, and forming corresponding target contour segments by the residual contour segments.
S250: and determining depth information of the target contour segment, and determining the blocked end face based on the depth information.
S260: determining a convex hull formed by the outline section corresponding to the blocked end face, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting an optimal circle to be complemented based on convex hull points in the convex hull and the three-dimensional coordinate points in the point set, and taking the circle to be complemented as the complemented outline of the blocked end face.
Other descriptions of S210-S260 may refer to the above embodiments.
Therefore, the method can obtain the complement contour of the blocked end face, and can be used for conveniently calculating the radial information of the log end face corresponding to the complement contour, so that the volume information of the log stack is obtained, the workload of original manual measurement can be reduced, and the measurement error can be reduced.
The input of the volume calculation formula is the diameter grade and length of the raw wood, and different calculation formulas are provided according to different raw wood varieties, diameter grade ranges and lengths. For example, the radiation flux of the length more than 10 meters and the diameter more than 14cm is calculated as the volume V:
wherein L is the diameter grade and D is the length.
In order to more clearly describe the technical solution provided by the embodiment of the present invention, as shown in fig. 3, the method provided by the embodiment of the present invention includes the following steps:
and inputting pixel coordinates and three-dimensional coordinates of the log end surface contours at two sides of the log stack. The pixel coordinates are those of contour points in an RGB image (raw wood stacking image). The pixel coordinates of the two-dimensional contour points are used for visual occlusion detection, and the three-dimensional coordinates of the space are used for actual space contour completion.
And (3) shielding detection: and constructing external rectangles of all the end faces by using pixel coordinates of two-dimensional contour points of all the end faces in the log stacking image, searching and judging two end faces possibly with position intersections according to the external rectangles expanded, further obtaining contour sections with adjacent space distances, and then removing the contour sections with adjacent distances but not obvious mutual shielding by using radian, length and other information.
And (3) shielding judgment: and calculating depth information of the blocked end face and the blocked end face through the profile section obtained in the last step, and taking the depth information as a judgment index of the blocked end face and the blocked end face, thereby eliminating the condition of lower blocking degree.
Convex hull calculation: and calculating the convex hull of the blocked contour segment corresponding to the blocked end face of the contour segment obtained in the last step, and determining the convex hull formed by the contour segment corresponding to the blocked end face according to the convex hull.
And (3) shielding completion: and finding out point sets corresponding to the convex hulls in the three-dimensional contour information, fitting out an optimal circle to be complemented according to a plurality of points in the convex hulls, and taking the points on the circle to be complemented as the complement contour of the blocked end face. The effect of the profile complement may refer to fig. 4, and the measurement error may be reduced after the profile is complemented, compared to the profile before the profile is not complemented (shown in fig. 5).
Fig. 6 is a schematic structural diagram of a device for supplementing the end face shielding of log according to an embodiment of the present invention. As shown in fig. 6, the apparatus includes: the system comprises an acquisition module 610, a judgment module 620, a selection and rejection module 630, a first determination module 640 and a second determination module 650.
An obtaining module 610, configured to obtain pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end surface in the log stack;
a judging module 620, configured to judge the end faces where the intersection may exist based on the pixel coordinates of the contour points of all the end faces;
a selecting and eliminating module 630, configured to select, on an end surface where an intersection may exist, contour points with an end surface distance within a preset range, to form a corresponding contour segment, eliminate contour segments that do not meet a shielding condition from the contour segments, and form a target contour segment according to the remaining contour segments;
a first determining module 640, configured to determine depth information of the target contour segment, and determine an occluded end surface based on the depth information;
a second determining module 650, configured to determine a convex hull formed by the contour segments corresponding to the blocked end surface, determine a point set corresponding to the convex hull in the three-dimensional coordinates, fit an optimal circle to be complemented based on the convex hull points in the convex hull and the three-dimensional coordinate points in the point set, and take the circle to be complemented as a complemented contour of the blocked end surface.
Optionally, the determining the end face where the intersection may exist based on the pixel coordinates of the contour points of all the end faces includes:
and constructing an external rectangle of the corresponding end face based on pixel coordinates of contour points of each end face of the log, and judging the end face possibly having intersection based on the external rectangle.
Optionally, the determining, based on the circumscribed rectangle, that there may be an end face of an intersection includes:
and if the intersection exists in the circumscribed rectangle, judging that the intersection exists in the end face corresponding to the circumscribed rectangle.
Optionally, the removing, in the profile segments, the profile segments that do not meet the shielding condition includes:
and removing the contour segments with the length smaller than a preset length threshold and the radian smaller than a preset radian threshold from the contour segments.
Optionally, determining a convex hull formed by the contour segment corresponding to the blocked end surface includes:
and determining an occluded profile segment corresponding to the occluded end face in the target profile segment, determining a non-occluded profile segment corresponding to the occluded end face, and determining a convex hull formed by the profile segment corresponding to the occluded end face based on the convex hull of the occluded profile segment and the convex hull of the non-occluded profile segment.
Optionally, the determining the depth information of the target contour segment includes:
determining the depth coordinates of each contour point based on the three-dimensional coordinates of each contour point in the target contour segment;
and determining an average value of the depth coordinates of the target contour segment based on the depth coordinates of each contour point, and taking the average value as the depth value of the target contour segment.
Optionally, the device further comprises an outward expansion module, which is used for outward expanding the external rectangle before screening out the contour points with the end face distance within a preset range to obtain an outward expanded rectangle of the external rectangle;
and determining contour points possibly with occlusion relation based on the expansion rectangle.
Optionally, the fitting of the optimal circle to be complemented based on the convex hull points in the convex hull and the three-dimensional coordinate points in the point set includes:
selecting key convex hull points from convex hull points corresponding to non-shielded contour segments based on the shielded contour segments in the convex hulls formed by the contour segments corresponding to the shielded end surfaces;
selecting three-dimensional coordinate points corresponding to key convex hull points in the point set to determine a contour segment to be complemented;
selecting a target convex hull point from convex hull points corresponding to the non-occluded contour segment, and selecting a three-dimensional coordinate point corresponding to the target convex hull point from the point set;
and determining the complement contour of the blocked end surface based on the three-dimensional coordinate point corresponding to the target convex hull point and the contour segment to be complemented.
The device provided by the embodiment of the invention can execute the method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the method.
Fig. 7 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 7, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the respective methods and processes described above, such as the complement method of log end face shielding.
In some embodiments, the method of complement of log end face shielding may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the above-described method of complementing the end face shading of raw wood may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the complement method of log end face shielding in any other suitable way (e.g. by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for supplementing a log end face shadow, comprising:
acquiring pixel coordinates and corresponding three-dimensional coordinates of contour points of each log end face in the log stack;
judging the end faces with possible intersections based on the pixel coordinates of the contour points of all the end faces;
screening out contour points with the end face distance within a preset range on the end faces possibly having intersection, forming corresponding contour segments, removing contour segments which do not meet shielding conditions from the contour segments, and forming corresponding target contour segments according to the remaining contour segments;
determining depth information of the target contour segment, and determining an occluded end face based on the depth information;
determining a convex hull formed by the outline section corresponding to the blocked end face, determining a point set corresponding to the convex hull in the three-dimensional coordinates, fitting an optimal circle to be complemented based on convex hull points in the convex hull and the three-dimensional coordinate points in the point set, and taking the circle to be complemented as the complemented outline of the blocked end face.
2. The method according to claim 1, wherein the determining the end face where there is a possibility of intersection based on the pixel coordinates of the contour points of all the end faces includes:
and constructing an external rectangle of the corresponding end face based on pixel coordinates of contour points of each end face of the log, and judging the end face possibly having intersection based on the external rectangle.
3. The method according to claim 2, wherein the determining that there is a likely intersection of end faces based on the circumscribed rectangle includes:
if the intersection exists in the circumscribed rectangle, judging that the intersection exists in the end face corresponding to the circumscribed rectangle.
4. The method according to claim 1, wherein the removing, from the contour segments, the contour segments that do not meet the occlusion condition includes:
and removing the contour segments with the length value smaller than a preset length threshold and the radian value smaller than a preset radian threshold from the contour segments.
5. The method of claim 1, wherein determining the convex hull formed by the contour segments corresponding to the blocked end surfaces comprises:
and determining an occluded profile segment corresponding to the occluded end face in the target profile segment, determining a non-occluded profile segment corresponding to the occluded end face, and determining a convex hull formed by the profile segment corresponding to the occluded end face based on the convex hull of the occluded profile segment and the convex hull of the non-occluded profile segment.
6. The method of claim 1, wherein said determining depth information for the target contour segment comprises:
determining the depth coordinates of each contour point based on the three-dimensional coordinates of each contour point in the target contour segment;
and determining an average value of the depth coordinates of the target contour segment based on the depth coordinates of each contour point, and taking the average value as the depth value of the target contour segment.
7. A method according to claim 2 or 3, further comprising, before screening out contour points having an end face distance within a predetermined range:
performing outward expansion on the external rectangle to obtain an outward expansion rectangle of the external rectangle;
and determining contour points possibly with occlusion relation based on the expansion rectangle.
8. The method of claim 1, wherein the fitting the optimal circle to be filled based on the convex hull points in the convex hull and the three-dimensional coordinate points in the point set comprises:
in the convex hulls formed by the contour sections corresponding to the blocked end surfaces, key convex hull points are selected from the convex hull points corresponding to the non-blocked contour sections based on the boundaries of the blocked contour sections;
selecting three-dimensional coordinate points corresponding to key convex hull points in the point set to determine a contour segment to be complemented;
selecting a target convex hull point from convex hull points corresponding to the non-occluded contour segment, and selecting a three-dimensional coordinate point corresponding to the target convex hull point from the point set;
and determining the complement contour of the blocked end surface based on the three-dimensional coordinate point corresponding to the target convex hull point and the contour segment to be complemented.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to perform the method of any one of claims 1-7.
CN202311155391.XA 2023-09-07 2023-09-07 Method, device, equipment and storage medium for supplementing log end face shielding Pending CN117372663A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311155391.XA CN117372663A (en) 2023-09-07 2023-09-07 Method, device, equipment and storage medium for supplementing log end face shielding

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311155391.XA CN117372663A (en) 2023-09-07 2023-09-07 Method, device, equipment and storage medium for supplementing log end face shielding

Publications (1)

Publication Number Publication Date
CN117372663A true CN117372663A (en) 2024-01-09

Family

ID=89395288

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311155391.XA Pending CN117372663A (en) 2023-09-07 2023-09-07 Method, device, equipment and storage medium for supplementing log end face shielding

Country Status (1)

Country Link
CN (1) CN117372663A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117635619A (en) * 2024-01-26 2024-03-01 南京海关工业产品检测中心 Log volume detection method and system based on machine vision

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117635619A (en) * 2024-01-26 2024-03-01 南京海关工业产品检测中心 Log volume detection method and system based on machine vision
CN117635619B (en) * 2024-01-26 2024-04-05 南京海关工业产品检测中心 Log volume detection method and system based on machine vision

Similar Documents

Publication Publication Date Title
CN117372663A (en) Method, device, equipment and storage medium for supplementing log end face shielding
CN111768450A (en) Automatic detection method and device for line deviation of structured light camera based on speckle pattern
CN112258474A (en) Wall surface anomaly detection method and device
CN117372499A (en) Log length and diameter determining method, device, equipment and storage medium
CN115311624B (en) Slope displacement monitoring method and device, electronic equipment and storage medium
CN116385415A (en) Edge defect detection method, device, equipment and storage medium
CN116596750A (en) Point cloud processing method and device, electronic equipment and storage medium
CN116188917A (en) Defect data generation model training method, defect data generation method and device
CN116258714B (en) Defect identification method and device, electronic equipment and storage medium
CN117173156B (en) Pole piece burr detection method, device, equipment and medium based on machine vision
CN116883488B (en) Method, device, equipment and medium for determining center position of circular pipe
CN118014971A (en) Surface defect detection method, device and equipment for photovoltaic module and storage medium
CN117409221A (en) End face matching method, device, equipment and storage medium
CN116819229A (en) Distance measurement method, device, equipment and storage medium for power transmission line
CN117350995A (en) Product defect detection method, device, equipment and storage medium
CN117274361A (en) Material surface area measurement method and device, electronic equipment and medium
CN117808775A (en) Defect level determining method and device, electronic equipment and storage medium
CN117783132A (en) Automatic workpiece detection method and device, electronic equipment and storage medium
CN118135110A (en) Model training method, point cloud completion method, device, equipment and storage medium
CN116977930A (en) Image-based oil trace detection method and device
CN117689538A (en) Splicing method, device, equipment and medium for fault point cloud
CN117148837A (en) Dynamic obstacle determination method, device, equipment and medium
CN117351303A (en) Training method of target detection model, target detection method, device and equipment
CN117058250A (en) 3D target detection method, device, equipment and medium based on camera
CN117635554A (en) Line defect detection method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication