CN115511807A - Method and device for determining position and depth of groove - Google Patents

Method and device for determining position and depth of groove Download PDF

Info

Publication number
CN115511807A
CN115511807A CN202211127607.7A CN202211127607A CN115511807A CN 115511807 A CN115511807 A CN 115511807A CN 202211127607 A CN202211127607 A CN 202211127607A CN 115511807 A CN115511807 A CN 115511807A
Authority
CN
China
Prior art keywords
point
groove
target
vertex
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.)
Granted
Application number
CN202211127607.7A
Other languages
Chinese (zh)
Other versions
CN115511807B (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.)
Beijing Yuanshan Intelligent Technology Co Ltd
Original Assignee
Beijing Yuanshan 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 Beijing Yuanshan Intelligent Technology Co Ltd filed Critical Beijing Yuanshan Intelligent Technology Co Ltd
Priority to CN202211127607.7A priority Critical patent/CN115511807B/en
Publication of CN115511807A publication Critical patent/CN115511807A/en
Application granted granted Critical
Publication of CN115511807B publication Critical patent/CN115511807B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

The application provides a method and a device for determining the position and the depth of a groove, wherein the method comprises the following steps: filtering points in the point cloud data corresponding to the board, wherein the height value of the points is smaller than a preset height, and obtaining target point cloud data; acquiring a target two-dimensional image corresponding to target point cloud data; determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate; matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point. The position of the groove is identified from the wood board, and then the position of the groove is corresponded to the point cloud data corresponding to the wood board, so that the depth of the groove is determined, the technical problem that the groove and an optical sensor need to be manually aligned to measure the depth of the groove is solved, and the technical effect of improving the measuring efficiency is achieved.

Description

Method and device for determining position and depth of groove
Technical Field
The present application relates to the field of image recognition technologies, and in particular, to a method and an apparatus for determining a groove position and a depth.
Background
In the process of making cabinets or wooden furniture, it is often necessary to recess the target. The same piece of furniture generally needs a plurality of targets with the same specification, and if the positions and the depths of the grooves of the targets with the same specification are different, the assembly of the furniture is seriously influenced, so that the targets are wasted and lost.
In the prior art, the groove position is determined by identifying the position of a hole pattern or a rectangle on a target picture, the groove depth is detected by a mode of emitting light to the groove through an optical sensor, the target needs to be manually adjusted by using the optical sensor, accurate data can be measured by aligning the light emitting point of the optical sensor with the groove, and the measurement efficiency is low.
Disclosure of Invention
In view of this, an object of the present application is to provide at least a method and an apparatus for determining a groove position and a depth, where the groove position is identified from a point cloud data corresponding to a wood board, and then the groove position is mapped to the point cloud data corresponding to the wood board, so as to determine the depth of the groove, thereby solving the technical problem that the groove and an optical sensor need to be manually aligned to measure the groove depth, and achieving the technical effect of improving the measurement efficiency.
The application mainly comprises the following aspects:
in a first aspect, an embodiment of the present application provides a method for determining a groove position and a depth, where the method for determining a groove position and a depth includes: filtering points with the height value smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data; acquiring a target two-dimensional image corresponding to target point cloud data; determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate; matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point.
Optionally, the obtaining of the target two-dimensional image corresponding to the target point cloud data includes: projecting each point in the target point cloud data to a two-dimensional image to obtain a projection point positioned in the two-dimensional image; and setting the pixel value of the projection point as a first pixel value, and setting the pixel value of the part except the projection point in the two-dimensional image as a second pixel value to obtain the target two-dimensional image.
Optionally, after the pixel value of the projection point is set as the first pixel value, and the pixel values in the two-dimensional image except for the projection point are set as the second pixel value, the method further includes: decomposing the target two-dimensional image into a plurality of transverse point sets or a plurality of longitudinal point sets according to the transverse sequence or the longitudinal sequence respectively; respectively calculating a horizontal difference value or a vertical difference value of the pixel value of each point and the pixel value of the next point of the point aiming at each horizontal point set or each vertical point set; searching the boundary type corresponding to each point transverse difference value or longitudinal difference value from the boundary type corresponding table; and intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each transverse difference or longitudinal difference and the appearance sequence number of the boundary type of the point.
Optionally, the boundary type includes a first boundary type and a second boundary type; intercepting a two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each longitudinal difference value of each point and the appearance sequence number of the boundary type of the point, wherein the interception comprises the following steps: screening out a first target point with a junction type being a first junction type and the occurrence sequence number of the first junction type being the minimum number and a second target point with a junction type being a second junction type and the occurrence sequence number of the second junction type being the maximum number in each longitudinal point set; determining a first target point corresponding to each longitudinal point set as a first target point set, and determining a second target point corresponding to each longitudinal point set as a second target point set; in the first target point set, taking the point with the minimum abscissa as a first vertex and taking the point with the maximum abscissa as a second vertex; in the second target point set, taking the point with the minimum abscissa as a third vertex and taking the point with the maximum abscissa as a fourth vertex; and respectively connecting the first vertex with the second vertex and the third vertex, and respectively connecting the fourth vertex with the third vertex and the second vertex to construct a two-dimensional image of the wood board.
Optionally, the boundary type includes a first boundary type and a second boundary type; according to the boundary type corresponding to each point transverse difference value and the appearance sequence number of the boundary type of the point, intercepting a two-dimensional image of the wood board from the target two-dimensional image, wherein the method comprises the following steps: screening out a third target point and a fourth target point, wherein the junction type is a first junction type, the appearance sequence number of the first junction type is the minimum number, and the junction type is a second junction type, and the appearance sequence number of the second junction type is the maximum number, in each transverse point set; determining a third target point corresponding to each transverse point set as a third target point set, and determining a fourth target point corresponding to each transverse point set as a fourth target point set; in the third target point set, a point with the minimum value of the ordinate is taken as a fifth vertex, and a point with the maximum value of the ordinate is taken as a sixth vertex; in the fourth target point set, a point with the minimum ordinate is taken as a seventh vertex, and a point with the maximum ordinate is taken as an eighth vertex; and respectively connecting the fifth vertex with the sixth vertex and the seventh vertex, and respectively connecting the eighth vertex with the sixth vertex and the seventh vertex to construct a two-dimensional image of the wood board.
Optionally, determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove, and a minimum circumscribed rectangular coordinate includes: screening out a fifth target point with a junction type being a first junction type and the appearance sequence number of the first junction type being a first preset number and a sixth target point with a junction type being a second junction type and the appearance sequence number of the second junction type being a second preset number in each longitudinal point set; determining a fifth target point corresponding to each longitudinal point set as a fifth target point set, and determining a sixth target point corresponding to each longitudinal point set as a sixth target point set; in the fifth target point set, taking the point with the minimum abscissa as a first rectangular vertex, and taking the point with the maximum abscissa as a second rectangular vertex; in the sixth target point set, a point with the minimum abscissa is taken as a third rectangular vertex, and a point with the maximum abscissa is taken as a fourth rectangular vertex; respectively connecting the first rectangular vertex with the second rectangular vertex and the third rectangular vertex, respectively connecting the fourth rectangular vertex with the second rectangular vertex and the third rectangular vertex, and determining a rectangular groove in the two-dimensional image of the wood board; determining the coordinates of the first rectangle vertex and the fourth rectangle vertex, or the coordinates of the second rectangle vertex and the third rectangle vertex as the minimum circumscribed rectangle coordinate of the rectangle groove; and determining the intersection point of the connecting line of the first rectangular vertex and the fourth rectangular vertex and the connecting line of the second rectangular vertex and the third rectangular vertex as the center point of the rectangular groove.
Optionally, the method further comprises: determining the length value of each edge and the angle value of each angle of the two-dimensional image of the wood board; respectively judging whether the length value of each edge belongs to a preset length range corresponding to the edge; if the length value of each edge belongs to the preset length range corresponding to the edge, judging whether the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle; and if the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle, determining that the appearance of the wood board meets the requirement.
Optionally, the minimum circumscribed rectangle coordinates include an abscissa and an ordinate of the first diagonal point, and an abscissa and an ordinate of the second diagonal point; after determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove, and the minimum circumscribed rectangular coordinate, the method further comprises: determining the groove type of each groove; the groove type comprises a hole type groove; if the type of the groove is a hole-type groove, taking the absolute value of the difference value between the abscissa of the first diagonal point and the abscissa of the second diagonal point of the groove as a first absolute value; taking the absolute value of the difference value between the ordinate of the first diagonal point and the ordinate of the second diagonal point as a second absolute value; determining a half of the sum of the first absolute value and the second absolute value as the diameter of the groove; judging whether the diameter of the groove belongs to a preset diameter range or not; and if the diameter of the groove belongs to the preset diameter range, determining that the diameter of the groove meets the requirement.
Optionally, matching a center point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the center point of the groove, and determining a groove depth of the groove according to a height value of the target point, including: determining an abscissa and an ordinate of a center point of each of the at least one groove; screening out points with the horizontal coordinate and the vertical coordinate respectively identical to the horizontal coordinate and the vertical coordinate of the central point of the groove from all points in the target point cloud data, and determining the points as target points corresponding to the central point of the groove; and determining the difference value of the height value of any point on the surface of the wood board in the target point cloud data and the height value of the target point in the target point cloud data as the groove depth of the groove.
In a second aspect, an embodiment of the present application further provides a device for determining a position and a depth of a groove, where the device for determining a position and a depth of a groove includes: the filtering module is used for filtering points of which the height values are smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data; the acquisition module is used for acquiring a target two-dimensional image corresponding to the target point cloud data; the first determining module is used for determining at least one groove in the target two-dimensional image, the central point of each groove in the at least one groove and the minimum circumscribed rectangular coordinate; and the second determining module is used for matching the central point of each groove in the at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point.
In a third aspect, an embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, the memory storing machine-readable instructions executable by the processor, the processor and the memory communicating via the bus when the electronic device is operated, the machine-readable instructions being executed by the processor to perform the steps of the method for determining a groove position and a depth in the first aspect or any one of the possible embodiments of the first aspect.
In a fourth aspect, the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to perform the steps of the method for determining the position and depth of the groove in the first aspect or any one of the possible implementations of the first aspect.
The embodiment of the application provides a method and a device for determining the position and the depth of a groove, wherein the method comprises the following steps: filtering points with the height value smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data; acquiring a target two-dimensional image corresponding to target point cloud data; determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate; matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point. The position of the groove is identified from the wood board, and then the position of the groove is corresponded to the point cloud data corresponding to the wood board, so that the depth of the groove is determined, the technical problem that the groove and an optical sensor need to be manually aligned to measure the depth of the groove is solved, and the technical effect of improving the measuring efficiency is achieved.
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
To more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 shows a flowchart of a method for determining a groove position and a depth according to an embodiment of the present disclosure.
FIG. 2 is a schematic diagram illustrating point cloud data corresponding to a wood board provided in an embodiment of the present application.
Fig. 3 shows a schematic diagram of a two-dimensional image of a target provided by an embodiment of the present application.
Fig. 4 shows a schematic diagram of a set of longitudinal points provided by an embodiment of the present application.
Fig. 5 is a functional block diagram of a device for determining a groove position and a depth according to an embodiment of the present disclosure.
Fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Further, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart.
In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as presented in the figures, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be obtained by a person skilled in the art without making any inventive step based on the embodiments of the present application, fall within the scope of protection of the present application.
In the prior art, the positions of the grooves are determined by identifying the positions of the hole patterns or the rectangles on the wood boards, if the specifications of the wood boards change, the model needs to be retrained to determine the positions of the grooves, and the requirement on the robustness of the model is high; the grooves and the optical sensors need to be aligned manually, the groove depth is determined by utilizing the time difference between the laser emitted by the optical sensors and the laser received back, and the wood plates need to be aligned manually, so that the measurement efficiency is influenced.
Based on this, the embodiment of the application provides a method and a device for determining the position and the depth of a groove. The method comprises the following specific steps:
referring to fig. 1, fig. 1 is a flowchart illustrating a method for determining a position and a depth of a groove according to an embodiment of the present disclosure. As shown in fig. 1, a method for determining a groove position and a depth provided by an embodiment of the present application includes the following steps:
s101: and filtering the points with the height value smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data.
The point cloud data corresponding to the wood board refers to point cloud data obtained by placing the wood board on a platform and scanning the platform and the wood board on the platform by using a three-dimensional scanner (3D scanner). That is, the point cloud data corresponding to the board includes points scanned by the 3D camera on the surface of the platform on which the board is placed, and on the other surfaces of the board except for the surface of the platform in contact with the platform.
Each point in the point cloud data corresponding to a board contains an abscissa, an ordinate, and a height value. Referring to fig. 2, fig. 2 is a schematic diagram illustrating point cloud data corresponding to a wood board provided in an embodiment of the present application. As shown in fig. 2, a coordinate system of the point cloud data corresponding to the board may be a coordinate system constructed by constructing points on the platform as an XOY plane, in this embodiment, the direction of the X axis is set to be a direction in which the upper left corner of the platform points to the upper right corner of the platform, the direction of the Y axis is set to be a direction in which the upper left corner of the platform points to the lower left corner of the platform, and a direction pointing from the XOY plane to the upper surface of the board is set as a Z axis. The height value refers to a distance value from each point in the point cloud data corresponding to the board to the XOY plane. Points on the wood board, which are smaller than the preset height, are marked by shadows, namely, the shadow parts and points on the platform are filtered out, and target point cloud data are obtained.
Because the factory assembly line makes the plank, the outward appearance difference of every plank model is little, and then every plank model can use same preset height. The predetermined height is typically set to the standard plank thickness corresponding to the plank type of the plank minus 2. For example, if the standard board thickness corresponding to the board model of the board is 55mm, the preset height is 53mm, and then the target point cloud data of the board is obtained by only keeping points with a height value of 53mm to 55mm from the point cloud data corresponding to the board, and deleting all points with a height value smaller than 53 mm.
S102: and acquiring a target two-dimensional image corresponding to the target point cloud data.
The method for acquiring the target two-dimensional image corresponding to the target point cloud data comprises the following steps: projecting each point in the target point cloud data to a two-dimensional image to obtain a projection point positioned in the two-dimensional image; and setting the pixel value of the projection point as a first pixel value, and setting the pixel value of the part except the projection point in the two-dimensional image as a second pixel value to obtain the target two-dimensional image.
The size of the two-dimensional image is the size of the platform, and each point in the target point cloud data is projected into the two-dimensional image to obtain a projection point located in the two-dimensional image; and the coordinates of the projection point corresponding to each point in the target point cloud data are the abscissa value and the ordinate value of the point in the point cloud data corresponding to the wood board. Typically, the first pixel value is set to 0 (black) and the second pixel value is set to 255 (white). Referring to fig. 3, fig. 3 is a schematic diagram illustrating a two-dimensional image of a target according to an embodiment of the present disclosure. As shown in fig. 3, since only the points on the wood board are in the target point cloud data, the black part in the target two-dimensional image is the wood board, and the white part in the target two-dimensional image is the groove or the platform.
After the pixel value of the projection point is set as the first pixel value and the pixel values except the projection point in the two-dimensional image are set as the second pixel value, the target two-dimensional image is obtained, the method further comprises the following steps: decomposing the target two-dimensional image into a plurality of transverse point sets or a plurality of longitudinal point sets according to the transverse sequence or the longitudinal sequence respectively; respectively calculating a horizontal difference value or a vertical difference value of the pixel value of each point and the pixel value of the next point of the point aiming at each horizontal point set or each vertical point set; searching the boundary type corresponding to each point transverse difference value or longitudinal difference value from the boundary type corresponding table; and intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each transverse difference value or each longitudinal difference value and the appearance sequence number of the boundary type of the point.
Lateral order refers to left-to-right or right-to-left order; longitudinal order refers to the order from top to bottom or bottom to top. And a plurality of transverse point sets or a plurality of longitudinal point sets obtained by decomposing the target two-dimensional image are respectively determined according to the same transverse sequence or longitudinal sequence. The transverse point set refers to a set of points in the same row in the target two-dimensional image; the set of longitudinal points refers to a set of points of the same column in the target two-dimensional image. In the embodiment of the application, the transverse sequence from left to right and the longitudinal sequence from top to bottom are selected.
The last point of each set of lateral points or each set of longitudinal points has no point following the point, and the lateral difference or the longitudinal difference of the last point of each set of lateral points or each set of longitudinal points may be set to 0. That is, each point in the target two-dimensional image can calculate the horizontal difference or the vertical difference corresponding to the point.
Referring to table 1, table 1 shows a boundary type mapping table provided in the embodiment of the present application. The boundary type refers to a color difference corresponding to a lateral difference or a longitudinal difference of each point from a point subsequent to the point. The boundary types include a first boundary type (white-black boundary) and a second boundary type (black-white boundary).
Table 1:
transverse difference or longitudinal difference Type of junction
255 Black and white border (first border type)
-255 Black and white boundary (second boundary type)
As shown in table 1, for each point in the horizontal point set or the vertical point set, if the pixel value of the point is 255 and the pixel value of the next point of the point is 0, the horizontal difference value or the vertical difference value of the point is 255, and the boundary type of the point is considered to be a white-black boundary; if the pixel value of the point is 0 and the pixel value of the next point of the point is 255, the horizontal difference or the vertical difference of the point is-255, and the type of the boundary of the point is considered as a black-white boundary; if the transverse difference or the longitudinal difference of the point is 0, the point is considered to have no boundary type.
For example, if the pixel specification of the target two-dimensional image is W × H, W indicates the number of horizontal dots of the target two-dimensional image, and H indicates the number of vertical dots of the target two-dimensional image. Dividing a target two-dimensional image into H transverse point sets according to a transverse sequence, wherein each transverse point set comprises W pixel points; and calculating the difference value of the pixel value of each point in the transverse point set and the pixel value of the point which is next to the point aiming at each transverse point set, and taking the difference value as the transverse difference value of the point. Dividing a target two-dimensional image into W transverse point sets according to a longitudinal sequence, wherein each longitudinal point set comprises H pixel points; and calculating the difference value of the pixel value of each point in the longitudinal point set and the pixel value of the point which is next to the point aiming at each longitudinal point set, and taking the difference value as the longitudinal difference value of the point.
For each point in each lateral point set or each longitudinal point set, the appearance order number of the intersection type refers to the appearance order of the intersection type of the point in the lateral point set or the longitudinal point set in which the point is located. The boundary type includes a first boundary type and a second boundary type, and the appearance sequence number of the boundary type further includes an appearance sequence number of the first boundary type and an appearance sequence number of the second boundary type. And combining the points of which the boundary types in each transverse point set or each longitudinal point set are the first boundary type into a first boundary type set of the transverse point set or the longitudinal point set respectively, wherein the appearance sequence number of the first boundary type refers to the appearance sequence of the point which is the first boundary type in the transverse point set or the longitudinal point set and in the first boundary type set corresponding to the transverse point set or the longitudinal point set. And combining the points of which the boundary type in each transverse point set or each longitudinal point set is the second boundary type into a second boundary type set of the transverse point set or the longitudinal point set respectively, wherein the appearance sequence number of the second boundary type refers to the appearance sequence of the point which is the second boundary type in the transverse point set or the longitudinal point set and in the second boundary type set corresponding to the transverse point set or the longitudinal point set.
For example, referring to fig. 4, fig. 4 is a schematic diagram illustrating a vertical point set provided in an embodiment of the present application. In fig. 4, the left longitudinal point set a refers to a set of longitudinal points arbitrarily selected in the target two-dimensional image, and the left longitudinal point set a is enlarged to obtain the right longitudinal point set a for better clarity. As shown in fig. 4, the type of the boundary of the point a in the longitudinal point set a is a white-black boundary, and the appearance sequence of the white-black boundary of the point a in the longitudinal point set a is numbered 1, that is, the point a is a point of which the type of the first appearance boundary in the longitudinal point set a is a white-black boundary.
Intercepting a two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each longitudinal difference value of each point and the appearance sequence number of the boundary type of the point, wherein the interception comprises the following steps: screening out a first target point with a junction type being a first junction type and the appearance sequence number of the first junction type being the minimum number and a second target point with a junction type being a second junction type and the appearance sequence number of the second junction type being the maximum number from each longitudinal point set; determining a first target point corresponding to each longitudinal point set as a first target point set, and determining a second target point corresponding to each longitudinal point set as a second target point set; in the first target point set, taking the point with the minimum abscissa as a first vertex and taking the point with the maximum abscissa as a second vertex; in the second target point set, taking the point with the minimum abscissa as a third vertex and taking the point with the maximum abscissa as a fourth vertex; and respectively connecting the first vertex with the second vertex and the third vertex, and respectively connecting the fourth vertex with the third vertex and the second vertex to construct a two-dimensional image of the wood board.
That is, for each longitudinal point set, screening out points with a white-black boundary (a first boundary type) in all the points of the longitudinal point set; screening out a first target point with the appearance sequence number of 1 of the white-black boundary from the points with the types of the white-black boundaries at the boundaries; and screening out a second target point with the appearance sequence number of the white-black boundary being the maximum number from the points with the types of the white-black boundaries at the boundary. That is, each longitudinal point set has only one point whose boundary type is a white-black boundary and whose appearance sequence number is 1, and also has only one point whose boundary type is a white-black boundary and whose appearance sequence number is the maximum number. Exemplarily, as shown in fig. 4, a longitudinal point set a passes through one rectangular groove and one groove, a point a is a point on the platform, a subsequent point of the point a is located at an edge of the wood board, a longitudinal difference of the point a is 255, and an appearance sequence number of a white-black boundary of the point a is 1; the point b to the point c mean that a groove appears on the wood board, the point b means that the groove begins to appear in the longitudinal point set A, the point c means that the groove is finished, the longitudinal difference value of the point b is-255, the appearance sequence number of the black-white boundary of the point b is 1, the longitudinal difference value of the point c is 255, and the appearance sequence number of the white-black boundary of the point c is 2; points d to e mean that the groove appears again on the wood board, points d mean that the groove begins to appear in the longitudinal point set A, points e mean that the groove ends, the longitudinal difference value of the points d is-255, the appearance sequence number of the black-white boundary of the points d is 2, the longitudinal difference value of the points e is 255, and the appearance sequence number of the white-black boundary of the points e is 3; the point f is a point on the board, the next point of the point f is located on the platform, the longitudinal difference of the point f is-255, and the appearance sequence number of the black-white boundary of the point f is 3. That is, the first target point in the longitudinal point set a is the point a, and the second target point in the longitudinal point set a is the point f.
And combining the first target points of each longitudinal point set into a first target point set, namely, the first target point set comprises the upper edge of the junction of the wood board and the platform, the point with the minimum abscissa in the first target point set is a first vertex, the first vertex is the point at the upper left corner of the wood board in the target two-dimensional image, the point with the maximum abscissa in the first target point set is a second vertex, and the second vertex is the point at the upper right corner of the wood board in the target two-dimensional image. And combining the second target points of each longitudinal point set into a second target point set, wherein the point with the minimum abscissa in the second target point set is a third vertex, the third vertex is the point at the lower left corner of the wood board in the target two-dimensional image, the point with the maximum abscissa in the second target point set is a fourth vertex, and the fourth vertex is the point at the lower right corner of the wood board in the target two-dimensional image.
And respectively connecting the point at the upper left corner of the board in the target two-dimensional image with the point at the upper right corner and the point at the lower left corner, and respectively connecting the point at the lower right corner of the board in the target two-dimensional image with the point at the upper right corner and the point at the lower left corner to construct the board two-dimensional image. That is, the two-dimensional image of the plank is a rectangular area representing the plank with the portion of the target two-dimensional image representing the platform removed.
Or, according to the boundary type corresponding to each point transverse difference value and the appearance sequence number of the boundary type of the point, intercepting the two-dimensional image of the wood board from the target two-dimensional image, including: screening out a third target point and a fourth target point in each transverse point set, wherein the junction type is a first junction type, the appearance sequence number of the first junction type is the minimum number, and the junction type is a second junction type, and the appearance sequence number of the junction type is the maximum number; determining a third target point corresponding to each transverse point set as a third target point set, and determining a fourth target point corresponding to each transverse point set as a fourth target point set; in the third target point set, a point with the minimum value of the ordinate is taken as a fifth vertex, and a point with the maximum value of the ordinate is taken as a sixth vertex; in the fourth target point set, taking the point with the minimum ordinate as a seventh vertex and taking the point with the maximum ordinate as an eighth vertex; and respectively connecting the fifth vertex with the sixth vertex and the seventh vertex, and respectively connecting the eighth vertex with the sixth vertex and the seventh vertex to construct a two-dimensional image of the wood board.
That is, for each transverse point set, screening out points whose boundary type is a white-black boundary (first boundary type) from all points in the transverse point set; screening a third target point with the appearance sequence number of 1 of the white-black boundary from the points with the types of the white-black boundaries at the boundaries; and screening out a fourth target point with the appearance sequence number of the white-black boundary being the maximum number from the points with the types of the white-black boundaries at the boundary. And combining the third target points of each transverse point set into a third target point set, namely, the third target point set comprises the left side of the boundary of the wood board and the platform, the point with the minimum ordinate in the third target point set is a fifth vertex, the fifth vertex is the point at the lower left corner of the wood board in the target two-dimensional image, the point with the maximum ordinate in the third target point set is a sixth vertex, and the sixth vertex is the point at the upper left corner of the wood board in the target two-dimensional image. And combining the fourth target points of each transverse point set into a fourth target point set, wherein the point with the minimum value of the vertical coordinate in the fourth target point set is a seventh vertex, the seventh vertex is the point at the lower right corner of the wood board in the target two-dimensional image, the point with the maximum value of the vertical coordinate in the fourth target point set is an eighth vertex, and the eighth vertex is the point at the upper right corner of the wood board in the target two-dimensional image.
And respectively connecting the point at the lower left corner of the board in the target two-dimensional image with the point at the upper left corner and the point at the lower right corner, and respectively connecting the point at the upper right corner of the board in the target two-dimensional image with the point at the upper left corner and the point at the lower right corner to construct the board two-dimensional image.
The method further comprises the following steps: determining the length value of each edge and the angle value of each angle of the two-dimensional image of the wood board; respectively judging whether the length value of each side belongs to the preset length range corresponding to the side; if the length value of each edge belongs to the preset length range corresponding to the edge, judging whether the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle; and if the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle, determining that the appearance of the wood board meets the requirement.
That is, calculating the absolute value of the difference between the abscissa of the first vertex and the abscissa of the second vertex, and recording the absolute value as a first absolute value; calculating the absolute value of the difference value between the vertical coordinate of the second vertex and the vertical coordinate of the fourth vertex, and recording the absolute value as a second absolute value; calculating the difference value of the abscissa of the third vertex and the abscissa of the fourth vertex, and recording the difference value as a third absolute value; calculating a fourth absolute value of the difference between the ordinate of the first vertex and the ordinate of the third vertex; and taking the first absolute value, the second absolute value, the third absolute value and the fourth absolute value as the length values of all edges of the two-dimensional image of the wood board. Calculating a vector angle between a vector of the first vertex pointing to the second vertex and a vector of the first vertex pointing to the third vertex, and recording the vector angle as a first vector angle; calculating a vector angle between a vector of the second vertex pointing to the first vertex and a vector of the second vertex pointing to the fourth vertex, and recording the vector angle as a second vector angle; calculating a vector angle between a vector of the fourth vertex pointing to the second vertex and a vector of the fourth vertex pointing to the third vertex, and recording the vector angle as a third vector angle; calculating a vector angle between a vector of the third vertex pointing to the first vertex and a vector of the third vertex pointing to the fourth vertex, and recording as a fourth vector angle; and taking the first vector angle, the second vector angle, the third vector angle and the fourth vector angle as angle values of all angles of the two-dimensional image of the wood board.
S103: and determining at least one groove in the target two-dimensional image, the central point of each groove in the at least one groove and the minimum circumscribed rectangular coordinate.
Since the target two-dimensional image is a black and white picture, at this time, at least one groove in the target two-dimensional image can be identified by identifying the difference of pixel values of each point in the target two-dimensional image and surrounding points of the point through a closed region detection algorithm, and the central point and the minimum external rectangular coordinate of each groove in the at least one groove are obtained. Alternatively, at least one groove in the two-dimensional image of the plank, a center point of each groove in the at least one groove, and a minimum circumscribed rectangle coordinate may also be identified.
Or the side length of the long side of the rectangular groove is generally approximate to that of the side of the wood board parallel to the long side of the rectangular groove, so that the rectangular groove in the target two-dimensional image can be determined in a mode of constructing a two-dimensional image of the wood board.
Determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangle coordinate, comprising: screening out a fifth target point and a sixth target point in each longitudinal point set, wherein the junction type is a first junction type, the appearance sequence number of the first junction type is a first preset number, and the junction type is a second junction type, and the appearance sequence number of the second junction type is a second preset number; determining a fifth target point corresponding to each longitudinal point set as a fifth target point set, and determining a sixth target point corresponding to each longitudinal point set as a sixth target point set; in the fifth target point set, taking the point with the minimum abscissa as a first rectangular vertex, and taking the point with the maximum abscissa as a second rectangular vertex; in the sixth target point set, a point with the minimum abscissa is taken as a third rectangular vertex, and a point with the maximum abscissa is taken as a fourth rectangular vertex; respectively connecting the first rectangular vertex with the second rectangular vertex and the third rectangular vertex, respectively connecting the fourth rectangular vertex with the second rectangular vertex and the third rectangular vertex, and determining a rectangular groove in the two-dimensional image of the wood board; determining the coordinates of the first rectangle vertex and the fourth rectangle vertex, or the coordinates of the second rectangle vertex and the third rectangle vertex as the minimum circumscribed rectangle coordinate of the rectangle groove; and determining the intersection point of the connecting line of the first rectangle vertex and the fourth rectangle vertex and the connecting line of the second rectangle vertex and the third rectangle vertex as the central point of the rectangular groove.
The first preset number and the second preset number are manually set, and the area of the groove is white, so that the longitudinal difference of the starting point of the groove is-255, and the type of the junction is a second junction type; the longitudinal difference of the point where the groove ends is 255, and the type of the junction is a first junction type. The first preset number refers to the appearance sequence number of the type of the first junction of the points where the rectangular grooves end in the vast majority of longitudinal point sets in the target two-dimensional image. The second preset number refers to the appearance sequence number of the type of the second boundary of the points where the rectangular grooves start in the vast majority of longitudinal point sets in the target two-dimensional image.
As shown in fig. 4, the appearance sequence number of the second boundary type of the point where the rectangular groove starts is 1 in most of the sets of the longitudinal points, and the appearance sequence number of the first boundary type of the point where the rectangular groove ends is 2 in most of the sets of the longitudinal points. Further, the first preset number of the target two-dimensional image of fig. 4 is 2, and the second preset number is 1. Although the point of the second boundary type whose appearance order number is 1 in the longitudinal point set a in fig. 4 is point b, the point of the first boundary type whose appearance order number is 2 is point c, and points b to c mean that the hole-type groove is not a rectangular groove, the hole-type groove is smaller. Furthermore, the number of longitudinal point sets which pass through one hole-type groove and one rectangular groove with the longitudinal point set A is far smaller than the number of longitudinal point sets which pass through only one rectangular groove. Therefore, the first preset number and the second preset number only need to be set according to the position conditions of most matrix grooves in the longitudinal point set of the target two-dimensional image.
The first rectangle vertex is a point at the lower left corner of the rectangle groove, the second rectangle vertex is a point at the lower right corner of the rectangle groove, the third rectangle vertex is a point at the upper left corner of the rectangle groove, and the fourth rectangle vertex is a point at the upper right corner of the rectangle groove.
The length of each edge of the groove and the angle value of each angle can be calculated by referring to the mode of determining the length of each edge of the two-dimensional image of the wood board and the angle value of each angle, and the description is omitted here.
The minimum circumscribed rectangle coordinate comprises an abscissa and an ordinate of the first diagonal point and an abscissa and an ordinate of the second diagonal point; after determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove, and the minimum circumscribed rectangular coordinate, the method further comprises: determining the groove type of each groove; the groove type comprises a hole type groove; if the type of the groove is a hole-type groove, taking the absolute value of the difference value between the abscissa of the first diagonal point and the abscissa of the second diagonal point of the groove as a first absolute value; taking the absolute value of the difference value between the ordinate of the first diagonal point and the ordinate of the second diagonal point as a second absolute value; determining half of the sum of the first absolute value and the second absolute value as the diameter of the groove; judging whether the diameter of the groove belongs to a preset diameter range or not; and if the diameter of the groove belongs to the preset diameter range, determining that the diameter of the groove meets the requirement.
The first diagonal point and the second diagonal point are end points of one diagonal line of the minimum bounding rectangle. After the groove is determined through the closed region detection algorithm, whether the groove type of the groove is a hole-type groove or not can be determined through a training neural network model, the target two-dimensional image is used as sample data, and the groove type of each groove mark in the target two-dimensional image is manually used as a label to train the neural network model. The minimum circumscribed rectangle of the hole-type groove is a rectangle tangent to the hole-type groove, and then a first diagonal point of the hole-type groove is a point at the upper left corner of the minimum circumscribed rectangle of the hole-type groove, and a second diagonal point of the hole-type groove is a point at the lower right corner of the minimum circumscribed rectangle of the hole-type groove; or the first diagonal point of the hole-type groove is a point at the lower left corner of the minimum circumscribed rectangle of the hole-type groove, and the second diagonal point of the hole-type groove is a point at the upper right corner of the minimum circumscribed rectangle of the hole-type groove. Thus, the first absolute value and the second absolute value are the side lengths of the minimum bounding rectangle.
S104: matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point.
Matching the central point of each groove in at least one groove with each point in the target point cloud data, determining the target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point, wherein the method comprises the following steps: determining an abscissa and an ordinate of a center point of each of the at least one groove; screening out points with the horizontal coordinate and the vertical coordinate respectively identical to the horizontal coordinate and the vertical coordinate of the central point of the groove from all points in the target point cloud data, and determining the points as target points corresponding to the central point of the groove; and determining the difference value of the height value of any point on the surface of the wood board in the target point cloud data and the height value of the target point in the target point cloud data as the groove depth of the groove.
Any point on the surface of the board may be a point randomly selected by a human, and any point on the surface of the board refers to any point on the upper surface of the board except for a point on the groove in the target point cloud data. The height value of any point on the surface of the wood board in the target point cloud data should belong to the thickness +/-preset error of a standard wood board corresponding to the wood board specification of the wood board. The preset error is an allowable error of the thickness of the wood board due to industrial production.
Based on the same application concept, the embodiment of the present application further provides a device for determining the position and the depth of the groove corresponding to the method for determining the position and the depth of the groove provided by the above embodiment, and as the principle of solving the problem of the device in the embodiment of the present application is similar to the method for determining the position and the depth of the groove provided by the above embodiment of the present application, the implementation of the device may refer to the implementation of the method, and repeated details are not repeated.
Fig. 5 is a functional block diagram of a device for determining a groove position and a depth according to an embodiment of the present disclosure, as shown in fig. 5. The groove position and depth determining device comprises: a filtering module 101, an obtaining module 102, a first determining module 103 and a second determining module 104. The filtering module 101 is configured to filter points in the point cloud data corresponding to the board, where a height value is smaller than a preset height, to obtain target point cloud data; the acquisition module 102 is configured to acquire a target two-dimensional image corresponding to target point cloud data; the first determining module 103 is configured to determine at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove, and a minimum circumscribed rectangular coordinate; the second determining module 104 is configured to match a center point of each groove in the at least one groove with each point in the target point cloud data, determine a target point matched with the center point of the groove, and determine a groove depth of the groove according to a height value of the target point.
Based on the same application concept, referring to fig. 6, a schematic structural diagram of an electronic device provided in an embodiment of the present application is shown, where the electronic device 20 includes: a processor 201, a memory 202 and a bus 203, wherein the memory 202 stores machine-readable instructions executable by the processor 201, and when the electronic device 20 is operated, the processor 201 communicates with the memory 202 via the bus 203, and the machine-readable instructions are executed by the processor 201 to perform the steps of the method for determining the position and depth of the groove according to any one of the embodiments.
In particular, the machine readable instructions, when executed by the processor 201, may perform the following: filtering points with the height value smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data; acquiring a target two-dimensional image corresponding to target point cloud data; determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate; matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point.
Based on the same application concept, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for determining a groove position and a depth provided by the above embodiments are performed.
Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk and the like, when a computer program on the storage medium is run, the method for determining the groove position and the groove depth can be executed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, and for example, a division of a unit is only a logical division, and other divisions may be realized in practice, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed coupling or direct coupling or communication connection between each other may be through some communication interfaces, indirect coupling or communication connection between devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application may be essentially implemented or are part of the technical solutions or parts of the technical solutions contributing to the prior art, and the computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present application, and shall cover the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method of determining groove position and depth, comprising:
filtering points with the height value smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data;
acquiring a target two-dimensional image corresponding to the target point cloud data;
determining at least one groove in the target two-dimensional image, a central point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate;
matching the central point of each groove in at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the groove depth of the groove according to the height value of the target point.
2. The method for determining the groove position and depth according to claim 1, wherein the obtaining the target two-dimensional image corresponding to the target point cloud data comprises:
projecting each point in the target point cloud data to a two-dimensional image to obtain a projection point positioned in the two-dimensional image;
and setting the pixel value of the projection point as a first pixel value, and setting the pixel value of the part except the projection point in the two-dimensional image as a second pixel value to obtain a target two-dimensional image.
3. The method for determining the groove position and the depth according to claim 2, wherein after the pixel value of the projection point is set to a first pixel value and the pixel values of the two-dimensional image except the projection point are set to a second pixel value, the method further comprises:
decomposing the target two-dimensional image into a plurality of transverse point sets or a plurality of longitudinal point sets according to a transverse sequence or a longitudinal sequence respectively;
respectively calculating a horizontal difference value or a vertical difference value of the pixel value of each point and the pixel value of the next point of the point aiming at each horizontal point set or each vertical point set;
searching the boundary type corresponding to each point transverse difference value or longitudinal difference value from the boundary type corresponding table;
and intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each transverse difference value or each longitudinal difference value and the appearance sequence number of the boundary type of the point.
4. The method of claim 3, wherein the interface type includes a first interface type and a second interface type; the step of intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the boundary type corresponding to each longitudinal difference value of each point and the appearance sequence number of the boundary type of the point comprises the following steps:
screening out a first target point with a junction type being a first junction type and the appearance sequence number of the first junction type being the minimum number and a second target point with a junction type being a second junction type and the appearance sequence number of the second junction type being the maximum number from each longitudinal point set;
determining a first target point corresponding to each longitudinal point set as a first target point set, and determining a second target point corresponding to each longitudinal point set as a second target point set;
in the first target point set, taking the point with the minimum abscissa as a first vertex and taking the point with the maximum abscissa as a second vertex;
in the second target point set, taking the point with the minimum abscissa as a third vertex and taking the point with the maximum abscissa as a fourth vertex;
and respectively connecting the first vertex with the second vertex and the third vertex, and respectively connecting the fourth vertex with the third vertex and the second vertex to construct a two-dimensional image of the wood board.
5. The method of claim 3, wherein the interface type includes a first interface type and a second interface type; the interface types respectively corresponding to the transverse difference values of each point and the appearance sequence numbers of the interface types of the point comprise:
screening out a third target point and a fourth target point from each transverse point set, wherein the junction type is a first junction type, the appearance sequence number of the first junction type is the minimum number, and the junction type is a second junction type, and the appearance sequence number of the second junction type is the maximum number;
determining a third target point corresponding to each transverse point set as a third target point set, and determining a fourth target point corresponding to each transverse point set as a fourth target point set;
in the third target point set, taking the point with the minimum ordinate as a fifth vertex and taking the point with the maximum ordinate as a sixth vertex;
in the fourth target point set, a point with the minimum ordinate is taken as a seventh vertex, and a point with the maximum ordinate is taken as an eighth vertex;
and respectively connecting the fifth vertex with the sixth vertex and the seventh vertex, and respectively connecting the eighth vertex with the sixth vertex and the seventh vertex to construct a two-dimensional image of the wood board.
6. The method of claim 4, wherein determining at least one groove in the target two-dimensional image, a center point and a minimum circumscribed rectangle coordinate for each of the at least one groove comprises:
screening out a fifth target point with a junction type being a first junction type and the appearance sequence number of the first junction type being a first preset number and a sixth target point with a junction type being a second junction type and the appearance sequence number of the second junction type being a second preset number in each longitudinal point set;
determining a fifth target point corresponding to each longitudinal point set as a fifth target point set, and determining a sixth target point corresponding to each longitudinal point set as a sixth target point set;
in the fifth target point set, taking the point with the minimum abscissa as a first rectangular vertex and taking the point with the maximum abscissa as a second rectangular vertex;
in the sixth target point set, taking the point with the minimum abscissa as a third rectangular vertex and taking the point with the maximum abscissa as a fourth rectangular vertex;
respectively connecting the first rectangular vertex with the second rectangular vertex and the third rectangular vertex, and respectively connecting the fourth rectangular vertex with the second rectangular vertex and the third rectangular vertex to determine a rectangular groove in the two-dimensional image of the wood board;
determining the coordinates of the first rectangular vertex and the fourth rectangular vertex, or the coordinates of the second rectangular vertex and the third rectangular vertex as the minimum circumscribed rectangular coordinates of the rectangular groove;
and determining the intersection point of the connecting line of the first rectangular vertex and the fourth rectangular vertex and the connecting line of the second rectangular vertex and the third rectangular vertex as the central point of the rectangular groove.
7. The method of determining groove location and depth of claim 4 or 5, further comprising:
determining length values of all edges and angle values of all angles of the two-dimensional image of the wood board;
respectively judging whether the length value of each edge belongs to a preset length range corresponding to the edge;
if the length value of each edge belongs to the preset length range corresponding to the edge, judging whether the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle;
and if the angle value of each angle belongs to the preset angle range corresponding to the angle value of the angle, determining that the appearance of the wood board meets the requirement.
8. The method of any one of claims 1 to 6, wherein the coordinates of the minimum bounding rectangle include the abscissa and ordinate of the first diagonal point, the abscissa and ordinate of the second diagonal point; after determining the at least one groove in the target two-dimensional image, the center point of each groove in the at least one groove, and the minimum circumscribed rectangle coordinate, the method further comprises:
determining the groove type of each groove; the groove type comprises a hole type groove;
if the type of the groove is a hole-type groove, taking an absolute value of a difference value between an abscissa of a first diagonal point and an abscissa of a second diagonal point of the groove as a first absolute value;
taking the absolute value of the difference value between the ordinate of the first diagonal point and the ordinate of the second diagonal point as a second absolute value;
determining half of the sum of the first absolute value and the second absolute value as the diameter of the groove;
judging whether the diameter of the groove belongs to a preset diameter range or not;
and if the diameter of the groove belongs to the preset diameter range, determining that the diameter of the groove meets the requirement.
9. The method for determining the position and depth of a groove according to any one of claims 1 to 6, wherein the step of matching the center point of each groove in at least one groove with each point in the point cloud data of the target, determining the target point matching the center point of the groove, and determining the groove depth of the groove according to the height value of the target point comprises:
determining an abscissa and an ordinate of a center point of each of the at least one groove;
screening out points with the horizontal coordinate and the vertical coordinate respectively identical to the horizontal coordinate and the vertical coordinate of the central point of the groove from all points in the target point cloud data, and determining the points as target points corresponding to the central point of the groove;
and determining the difference value of the height value of any point on the surface of the wood board in the target point cloud data and the height value of the target point in the target point cloud data as the groove depth of the groove.
10. A groove position and depth determining device, comprising:
the filtering module is used for filtering points of which the height values are smaller than the preset height in the point cloud data corresponding to the wood board to obtain target point cloud data;
the acquisition module is used for acquiring a target two-dimensional image corresponding to the target point cloud data;
the first determining module is used for determining at least one groove in the target two-dimensional image, the central point of each groove in the at least one groove and the minimum circumscribed rectangular coordinate;
and the second determining module is used for matching the central point of each groove in the at least one groove with each point in the target point cloud data, determining a target point matched with the central point of the groove, and determining the height value of the target point as the groove depth of the groove.
CN202211127607.7A 2022-09-16 2022-09-16 Method and device for determining position and depth of groove Active CN115511807B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211127607.7A CN115511807B (en) 2022-09-16 2022-09-16 Method and device for determining position and depth of groove

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211127607.7A CN115511807B (en) 2022-09-16 2022-09-16 Method and device for determining position and depth of groove

Publications (2)

Publication Number Publication Date
CN115511807A true CN115511807A (en) 2022-12-23
CN115511807B CN115511807B (en) 2023-07-28

Family

ID=84504417

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211127607.7A Active CN115511807B (en) 2022-09-16 2022-09-16 Method and device for determining position and depth of groove

Country Status (1)

Country Link
CN (1) CN115511807B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116030022A (en) * 2023-02-01 2023-04-28 天津风霖物联网科技有限公司 Quality detection system and method for building prefabricated part

Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106225678A (en) * 2016-09-27 2016-12-14 北京正安维视科技股份有限公司 Dynamic object based on 3D camera location and volume measuring method
CN110276793A (en) * 2019-06-05 2019-09-24 北京三快在线科技有限公司 A kind of method and device for demarcating three-dimension object
CN110866930A (en) * 2019-11-18 2020-03-06 北京云聚智慧科技有限公司 Semantic segmentation auxiliary labeling method and device
CN111583663A (en) * 2020-04-26 2020-08-25 宁波吉利汽车研究开发有限公司 Monocular perception correction method and device based on sparse point cloud and storage medium
CN111754515A (en) * 2019-12-17 2020-10-09 北京京东尚科信息技术有限公司 Method and device for sequential gripping of stacked articles
CN111928811A (en) * 2020-09-22 2020-11-13 上海钛米机器人股份有限公司 Ground detection method, device, equipment and storage medium
WO2021023106A1 (en) * 2019-08-02 2021-02-11 杭州海康威视数字技术股份有限公司 Target recognition method and apparatus, and camera
CN112767391A (en) * 2021-02-25 2021-05-07 国网福建省电力有限公司 Power grid line part defect positioning method fusing three-dimensional point cloud and two-dimensional image
CN113327283A (en) * 2021-04-30 2021-08-31 中国人民解放军军事科学院国防科技创新研究院 Automatic labeling method and system for image data target detection rectangular frame
CN113532277A (en) * 2021-09-13 2021-10-22 江苏中车数字科技有限公司 Method and system for detecting plate-shaped irregular curved surface workpiece
CN114140608A (en) * 2021-12-09 2022-03-04 江苏提米智能科技有限公司 Photovoltaic panel marking method and device, electronic equipment and storage medium
CN114237418A (en) * 2021-11-19 2022-03-25 新华三智能终端有限公司 Track identification method and device
CN114693633A (en) * 2022-03-28 2022-07-01 深圳市深视智能科技有限公司 Welding defect detection method, device and system
WO2022148143A1 (en) * 2021-01-08 2022-07-14 华为技术有限公司 Target detection method and device
WO2022148192A1 (en) * 2021-01-07 2022-07-14 新东方教育科技集团有限公司 Image processing method, image processing apparatus, and non-transitory storage medium
CN114862929A (en) * 2022-04-19 2022-08-05 深圳市优必选科技股份有限公司 Three-dimensional target detection method and device, computer readable storage medium and robot
CN114897999A (en) * 2022-04-29 2022-08-12 美的集团(上海)有限公司 Object pose recognition method, electronic device, storage medium, and program product

Patent Citations (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106225678A (en) * 2016-09-27 2016-12-14 北京正安维视科技股份有限公司 Dynamic object based on 3D camera location and volume measuring method
CN110276793A (en) * 2019-06-05 2019-09-24 北京三快在线科技有限公司 A kind of method and device for demarcating three-dimension object
WO2021023106A1 (en) * 2019-08-02 2021-02-11 杭州海康威视数字技术股份有限公司 Target recognition method and apparatus, and camera
CN110866930A (en) * 2019-11-18 2020-03-06 北京云聚智慧科技有限公司 Semantic segmentation auxiliary labeling method and device
CN111754515A (en) * 2019-12-17 2020-10-09 北京京东尚科信息技术有限公司 Method and device for sequential gripping of stacked articles
CN111583663A (en) * 2020-04-26 2020-08-25 宁波吉利汽车研究开发有限公司 Monocular perception correction method and device based on sparse point cloud and storage medium
CN111928811A (en) * 2020-09-22 2020-11-13 上海钛米机器人股份有限公司 Ground detection method, device, equipment and storage medium
WO2022148192A1 (en) * 2021-01-07 2022-07-14 新东方教育科技集团有限公司 Image processing method, image processing apparatus, and non-transitory storage medium
WO2022148143A1 (en) * 2021-01-08 2022-07-14 华为技术有限公司 Target detection method and device
CN112767391A (en) * 2021-02-25 2021-05-07 国网福建省电力有限公司 Power grid line part defect positioning method fusing three-dimensional point cloud and two-dimensional image
CN113327283A (en) * 2021-04-30 2021-08-31 中国人民解放军军事科学院国防科技创新研究院 Automatic labeling method and system for image data target detection rectangular frame
CN113532277A (en) * 2021-09-13 2021-10-22 江苏中车数字科技有限公司 Method and system for detecting plate-shaped irregular curved surface workpiece
CN114237418A (en) * 2021-11-19 2022-03-25 新华三智能终端有限公司 Track identification method and device
CN114140608A (en) * 2021-12-09 2022-03-04 江苏提米智能科技有限公司 Photovoltaic panel marking method and device, electronic equipment and storage medium
CN114693633A (en) * 2022-03-28 2022-07-01 深圳市深视智能科技有限公司 Welding defect detection method, device and system
CN114862929A (en) * 2022-04-19 2022-08-05 深圳市优必选科技股份有限公司 Three-dimensional target detection method and device, computer readable storage medium and robot
CN114897999A (en) * 2022-04-29 2022-08-12 美的集团(上海)有限公司 Object pose recognition method, electronic device, storage medium, and program product

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
THISISZDY: "<Halcon> 计算任意矩形四个顶点坐标", Retrieved from the Internet <URL:https://blog.csdn.net/thisiszdy/article/details/124028382> *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116030022A (en) * 2023-02-01 2023-04-28 天津风霖物联网科技有限公司 Quality detection system and method for building prefabricated part

Also Published As

Publication number Publication date
CN115511807B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN110068270B (en) Monocular vision box volume measuring method based on multi-line structured light image recognition
US7822267B2 (en) Enhanced object reconstruction
CN110443243B (en) Water level monitoring method, storage medium, network device and water level monitoring system
CN112132907B (en) Camera calibration method and device, electronic equipment and storage medium
US10438036B1 (en) System and method for reading and decoding ID codes on a curved, sloped and/or annular object
US20100328308A1 (en) Three Dimensional Mesh Modeling
US9799117B2 (en) Method for processing data and apparatus thereof
KR20110102244A (en) Information processing apparatus, processing method therefor, and computer-readable storage medium
CN107463659B (en) Object searching method and device
CN104634242A (en) Point adding system and method of probe
CN107346040B (en) Method and device for determining grating parameters of naked eye 3D display equipment and electronic equipment
CN111179360B (en) High-precision automatic calibration plate and calibration method
CN116342718B (en) Calibration method, device, storage medium and equipment of line laser 3D camera
CN113074660B (en) Surface shape measuring method for large-size transparent object
CN115511807B (en) Method and device for determining position and depth of groove
CN111161339A (en) Distance measuring method, device, equipment and computer readable medium
CN109190434B (en) Bar code recognition algorithm based on sub-pixel level corner detection
CN113505626A (en) Rapid three-dimensional fingerprint acquisition method and system
CN111699513B (en) Calibration plate, internal parameter calibration method, machine vision system and storage device
KR102023087B1 (en) Method for camera calibration
Wijenayake et al. Dual pseudorandom array technique for error correction and hole filling of color structured-light three-dimensional scanning
CN112801165B (en) Card auditing method and device
JP2565885B2 (en) Spatial pattern coding method
CN116433584A (en) Surface defect detection method, system and storage medium for strip-shaped polishing template
CN112070844A (en) Calibration method and device of structured light system, calibration tool diagram, equipment and medium

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Li Xiaobo

Inventor before: Guo Bin

Inventor before: Li Xiaobo

Inventor before: Xu Zhiyuan

GR01 Patent grant
GR01 Patent grant