CN115511807B - Method and device for determining position and depth of groove - Google Patents
Method and device for determining position and depth of groove Download PDFInfo
- Publication number
- CN115511807B CN115511807B CN202211127607.7A CN202211127607A CN115511807B CN 115511807 B CN115511807 B CN 115511807B CN 202211127607 A CN202211127607 A CN 202211127607A CN 115511807 B CN115511807 B CN 115511807B
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/0002—Inspection of images, e.g. flaw detection
- G06T7/0004—Industrial image inspection
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/70—Determining position or orientation of objects or cameras
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10028—Range image; Depth image; 3D point clouds
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/30—Subject of image; Context of image processing
- G06T2207/30108—Industrial image inspection
- G06T2207/30161—Wood; 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 depth of a groove, wherein the method comprises the following steps: filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate 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; and 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. According to the method and the device, the position of the groove is identified from the target two-dimensional image corresponding to the wood board, and then the position of the groove is corresponding 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 depth is measured by manually aligning the groove with the optical sensor is solved, and the effect of improving the measuring efficiency is achieved.
Description
Technical Field
The present disclosure relates to the field of image recognition technologies, and in particular, to a method and an apparatus for determining a groove position and a groove depth.
Background
In the manufacture of 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 depths of the grooves of the targets with the same specification are different, the assembly of the furniture can be seriously affected, so that the wood board is wasted and the loss is caused.
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 the way that an optical sensor emits light to the groove, the optical sensor is used for manually adjusting the target, and the light emitting point of the optical sensor is aligned to the groove to measure accurate data, so that the measuring efficiency of the way is lower.
Disclosure of Invention
In view of this, the present application aims at providing a method and a device for determining the position and depth of a groove at least, and the present application identifies the position of the groove from a target two-dimensional image corresponding to a plank, and then corresponds the position of the groove to point cloud data corresponding to the plank, so as to determine the depth of the groove, solve the technical problem that the groove needs to be manually aligned with an optical sensor to measure the depth of the groove, and achieve 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 position and a depth of a groove, where the method includes: filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate 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; and 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, acquiring the target two-dimensional image corresponding to the target point cloud data includes: projecting each point in the target point cloud data into a two-dimensional image to obtain a projection point positioned in the two-dimensional image; 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, thereby obtaining the target two-dimensional image.
Optionally, the method further includes, after setting the pixel value of the projection point to a first pixel value and setting the pixel value of the two-dimensional image other than the projection point to a second pixel value to obtain the target two-dimensional image: 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; for each transverse point set or each longitudinal point set, respectively calculating a transverse difference value or a longitudinal difference value between the pixel value of each point and the pixel value of the next point of the point; searching the junction type corresponding to the transverse difference value or the longitudinal difference value of each point from the junction type corresponding table; and intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the corresponding intersection type of each point transverse difference value or longitudinal difference value and the appearance sequence number of the intersection type of the point.
Optionally, the interface type includes a first interface type and a second interface type; according to the corresponding junction type of each point longitudinal difference value and the appearance sequence number of the junction type of the point, intercepting the plank two-dimensional image from the target two-dimensional image, comprising: screening out a first target point with a first intersection type and a minimum number of appearance sequence numbers of the first intersection type and a second target point with a second intersection type and a maximum number of appearance sequence numbers of the second intersection type 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 value of the abscissa as a first vertex and taking the point with the maximum value of the abscissa as a second vertex; in the second target point set, taking the point with the minimum value of the abscissa as a third vertex and taking the point with the maximum value of the abscissa as a fourth vertex; and connecting the first vertex with the second vertex and the third vertex respectively, and connecting the fourth vertex with the third vertex and the second vertex respectively to construct the two-dimensional image of the wood board.
Optionally, the interface type includes a first interface type and a second interface type; according to the corresponding junction type of each point transverse difference value and the appearance sequence number of the junction type of the point, intercepting the plank two-dimensional image from the target two-dimensional image, comprising: screening out a third target point with the intersection type of the first intersection type and the appearance sequence number of the first intersection type of the minimum number and a fourth target point with the intersection type of the second intersection type and the appearance sequence number of the second intersection type of the maximum number from 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, 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 value of the ordinate is taken as a seventh vertex, and a point with the maximum value of the 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 the two-dimensional image of the wood board.
Optionally, determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove, and a minimum bounding rectangle coordinate includes: screening out a fifth target point with the intersection type being a first intersection type and the appearance sequence number of the first intersection type being a first preset number and a sixth target point with the intersection type being a second intersection type and the appearance sequence number of the second intersection type being a second preset number from 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 value of the abscissa as a first rectangular vertex and taking the point with the maximum value of the abscissa as a second rectangular vertex; in the sixth target point set, a point with the minimum value of the abscissa is taken as a third rectangular vertex, and a point with the maximum value of the abscissa is taken as a fourth rectangular vertex; the first rectangular vertex is connected with the second rectangular vertex and the third rectangular vertex respectively, and the fourth rectangular vertex is connected with the second rectangular vertex and the third rectangular vertex respectively, so that a rectangular groove in the two-dimensional image of the wood board is determined; 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 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; judging whether the length values of all the sides belong to the preset length range corresponding to the side or not respectively; if the length values of the sides all belong to the preset length range corresponding to the side, judging whether the angle values of the angles all belong to the preset angle range corresponding to the angle value of the angle; 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 requirements.
Optionally, the minimum circumscribed rectangular 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 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 bounding rectangle coordinates, the method further comprises: determining a groove type of each groove; the groove type comprises a hole type groove; if the groove is of a hole type, 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; if the diameter of the groove is within 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 abscissa and the ordinate which are respectively the same as the abscissa and the ordinate of the central point of the groove from all points in the cloud data of the target point, and determining the points as the target points corresponding to the central point of the groove; and determining the difference value of the height value of any point of the plank surface 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 with height values smaller than a preset height in the point cloud data corresponding to the wood plate 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, a center point of each groove in the at least one groove and a 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, embodiments of the present application further provide 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 in communication via the bus when the electronic device is running, the machine readable instructions when executed by the processor performing the steps of the method of determining the position and depth of the groove in the first aspect or any of the possible embodiments of the first aspect.
In a fourth aspect, the embodiments of the present application further provide a computer readable storage medium, on which a computer program is stored, which when executed by a processor performs the steps of the method for determining the position and depth of a groove in the first aspect or any of the possible embodiments 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 height values smaller than a preset height in the point cloud data corresponding to the wood plate 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; and 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. According to the method and the device, the position of the groove is identified from the target two-dimensional image corresponding to the wood board, and then the position of the groove is corresponding 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 depth is measured by manually aligning the groove with the optical sensor is solved, and the technical effect of improving the measuring efficiency is achieved.
In order to make the above objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered limiting the scope, and that other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 shows a flowchart of a method for determining a groove position and a groove depth according to an embodiment of the present application.
Fig. 2 shows a schematic diagram of point cloud data corresponding to a wood board according to an embodiment of the present application.
Fig. 3 shows a schematic diagram of a two-dimensional image of a target provided in 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 shows a functional block diagram of a device for determining a groove position and a groove depth according to an embodiment of the present application.
Fig. 6 shows a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it should be understood that the accompanying drawings in the present application are only for the purpose of illustration and description, and are not intended to limit the protection scope of the present application. In addition, it should be understood that the schematic drawings are not drawn to scale. A flowchart, as used in this application, illustrates operations implemented according to some embodiments of the present application. It should be appreciated that the operations of the flow diagrams may be implemented out of order and that steps without logical context may be performed in reverse order or concurrently. Moreover, one or more other operations may be added to the flow diagrams and one or more operations may be removed from the flow diagrams as directed by those skilled in the art.
In addition, the described embodiments are only some, but not all, of the embodiments of the present application. The components of the embodiments of the present application, which are generally described and illustrated in the figures herein, may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, as provided in the accompanying drawings, is not intended to limit the scope of the application, as claimed, but is merely representative of selected embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, are intended to be within the scope of the present application.
In the prior art, the position of the groove is determined by identifying the position of a hole pattern or a rectangle on the plank, if the specification of the plank is changed, the model needs to be retrained to determine the position of the groove, and the robustness requirement on the model is high; the groove depth is determined by manually aligning the groove with the optical sensor and utilizing the time difference between the laser emitted by the optical sensor and the laser received back, and the wood boards are manually aligned one by one, so that the measurement efficiency is affected.
Based on this, the embodiment of the application provides a method and a device for determining the position and the depth of a groove, and the method and the device for determining the depth of the groove identify the position of the groove from a target two-dimensional image corresponding to a wood board and then correspond the position of the groove to 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 are required to be manually aligned to measure the depth of the groove is solved, and the technical effect of improving the measurement efficiency is achieved. The method comprises the following steps:
referring to fig. 1, fig. 1 is a flowchart of a method for determining a groove position and a groove depth according to an embodiment of the present application. As shown in fig. 1, the method for determining the position and depth of the groove provided in the embodiment of the present application includes the following steps:
S101: and filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate to obtain target point cloud data.
The point cloud data corresponding to the plank refer to point cloud data obtained by placing the plank on a platform and scanning the platform and the plank on the platform by using a three-dimensional scanner (3D scanner). That is, the point cloud data corresponding to the plank includes points obtained by scanning by the 3D camera, in which the points include other surfaces of the plank than the surface of the plank in contact with the platform, and other portions of the surface of the platform on which the plank is placed than the portion in contact with the platform.
Each point in the point cloud data corresponding to the plank 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 board according to an embodiment of the present application. As shown in fig. 2, the coordinate system of the point cloud data corresponding to the plank may be that the point on the platform is constructed as an XOY plane, in this embodiment, the direction of setting the X axis is the direction in which the upper left corner of the platform points to the upper right corner of the platform, the direction of setting the Y axis is the direction in which the upper left corner of the platform points to the lower left corner of the platform, and the direction from the XOY plane to the upper surface of the plank is set as a Z axis. The height value refers to a distance value of each point in the point cloud data corresponding to the plank from the XOY plane. Points on the plank that are less than the preset height are identified by shadows, that is, the shadows and points on the platform are filtered out to obtain cloud data of the target point.
Because the factory assembly line makes the plank, the outward appearance difference of every plank model is not big, and then every plank model can use same default height. The preset height is typically set to the standard board thickness corresponding to the board model of the board minus 2mm. For example, if the standard plank thickness corresponding to the plank model of the plank is 55mm, the preset height is 53mm, and then the target point cloud data of the plank is that only the points with the height value of 53mm to 55mm are reserved in the point cloud data corresponding to the plank, and all the points with the height value of less than 53mm are deleted.
S102: and acquiring a target two-dimensional image corresponding to the target point cloud data.
The obtaining 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 into a two-dimensional image to obtain a projection point positioned in the two-dimensional image; 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, thereby obtaining the target two-dimensional image.
The size of the two-dimensional image is the size of the platform, and each point in the cloud data of the target point is projected into the two-dimensional image to obtain a projection point positioned in the two-dimensional image; the coordinates of the projection point corresponding to each point in the target point cloud data are the horizontal coordinate value and the vertical coordinate value of the point in the point cloud data corresponding to the plank. In general, 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 of a two-dimensional image of a target according to an embodiment of the present application. As shown in fig. 3, since only points on the plank are in the target point cloud data, and thus the black part in the target two-dimensional image is the plank, the white part in the target two-dimensional image is the groove or the land.
Setting the pixel value of the projection point as a first pixel value, setting the pixel value except the projection point in the two-dimensional image as a second pixel value, and obtaining the target two-dimensional image, wherein 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; for each transverse point set or each longitudinal point set, respectively calculating a transverse difference value or a longitudinal difference value between the pixel value of each point and the pixel value of the next point of the point; searching the junction type corresponding to the transverse difference value or the longitudinal difference value of each point from the junction type corresponding table; and intercepting the two-dimensional image of the wood board from the target two-dimensional image according to the corresponding intersection type of each point transverse difference value or longitudinal difference value and the appearance sequence number of the intersection type of the point.
Lateral order refers to left to right or right to left order; longitudinal order refers to an order from top to bottom or bottom to top. The multiple transverse point sets or the multiple 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 of the same row in the target two-dimensional image; the set of vertical points refers to a set of points of the same column in the target two-dimensional image. In the embodiments of the present application, a left-to-right lateral order and a top-to-bottom longitudinal order are selected.
The lateral or longitudinal difference value of the last point of each lateral or longitudinal point set may be set to 0 if the last point of each lateral or longitudinal point set does not have a point subsequent to that point. That is, each point in the target two-dimensional image can calculate the lateral or longitudinal difference corresponding to that point.
Referring to table 1, table 1 shows a table of correspondence between junction types provided in the embodiments of the present application. The type of intersection refers to the color distinction of each point corresponding to the lateral or longitudinal difference of the point subsequent to that point. The interface types include a first interface type (white-black interface) and a second interface type (black-white interface).
Table 1:
difference in transverse or longitudinal direction | Type of junction |
255 | White-black interface (first interface type) |
-255 | Black and white interface (second interface 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 subsequent point of the point is 0, the horizontal difference value or the vertical difference value of the point is 255, and the type of the boundary of the point is considered as 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 transverse difference value or the longitudinal difference value of the point is 255, and the type of the boundary of the point is considered to be black-white boundary; if the lateral or longitudinal difference of the point is 0, the point is considered to have no junction type.
For example, if the pixel size of the target two-dimensional image is w×h, W refers to the number of points in the transverse direction of the target two-dimensional image, and H refers to the number of points in the longitudinal direction of the target two-dimensional image. Dividing the target two-dimensional image into H transverse point sets according to the transverse sequence, wherein each transverse point set comprises W pixel points; for each set of lateral points, a difference between the pixel value of each point in the set of lateral points and the pixel value of the point subsequent to the point is calculated, and the difference is taken as the lateral difference 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; for each vertical point set, calculating the difference between the pixel value of each point in the vertical point set and the pixel value of the point next to the point, and taking the difference as the vertical difference of the point.
For each point in each transverse 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 transverse or longitudinal point set in which the point is located. Since the junction type includes the first junction type and the second junction type, the appearance sequence number of the junction type includes the appearance sequence number of the first junction type and the appearance sequence number of the second junction type. Combining the points with the junction type of the first junction type in each transverse point set or each longitudinal point set into the first junction type set of the transverse point set or the longitudinal point set respectively, wherein the appearance sequence number of the first junction type refers to the appearance sequence of the point with the first junction type in the transverse point set or the longitudinal point set and the first junction type set corresponding to the transverse point set or the longitudinal point set. Combining the points with the junction type of the second junction type in each transverse point set or each longitudinal point set into the second junction type set of the transverse point set or the longitudinal point set respectively, wherein the appearance sequence number of the second junction type refers to the appearance sequence of the point with the second junction type in the transverse point set or the longitudinal point set and the second junction type set corresponding to the transverse point set or the longitudinal point set.
Referring to fig. 4, fig. 4 is a schematic diagram illustrating a set of longitudinal points according to an embodiment of the present application. In fig. 4, the left longitudinal point set a refers to a longitudinal point set arbitrarily selected from the target two-dimensional image, and for the sake of viewing clarity, the left longitudinal point set a is enlarged to obtain the right longitudinal point set a. As shown in fig. 4, the type of the intersection of the point a in the vertical point set a is a white-black intersection, and the appearance sequence of the white-black intersection of the point a in the vertical point set a is numbered 1, that is, the point a is the point of which the type of the first occurrence intersection in the vertical point set a is a white-black intersection.
According to the corresponding junction type of each point longitudinal difference value and the appearance sequence number of the junction type of the point, intercepting the plank two-dimensional image from the target two-dimensional image, comprising: screening out a first target point with a first intersection type and a minimum number of appearance sequence numbers of the first intersection type and a second target point with a second intersection type and a maximum number of appearance sequence numbers of the second intersection type 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 value of the abscissa as a first vertex and taking the point with the maximum value of the abscissa as a second vertex; in the second target point set, taking the point with the minimum value of the abscissa as a third vertex and taking the point with the maximum value of the abscissa as a fourth vertex; and connecting the first vertex with the second vertex and the third vertex respectively, and connecting the fourth vertex with the third vertex and the second vertex respectively to construct the two-dimensional image of the wood board.
That is, for each longitudinal point set, a point whose intersection type is a white-black intersection (first intersection type) is selected from all points of the longitudinal point set; screening out a first target point with the appearance sequence number of 1 from the points with the boundary types of white-black boundaries; and screening out a second target point with the appearance sequence number of the black-white boundary being the largest number from the points with the boundary types of white-black boundary. That is, each longitudinal point set has only one point with a boundary type of white-black and a white-black boundary and an appearance sequence number of 1, and also has only one point with a boundary type of white-black and a white-black boundary and an appearance sequence number of the largest number. Illustratively, as shown in fig. 4, the longitudinal point set a passes through a rectangular groove and a hole groove, the point a is a point on the platform and the subsequent point of the point a is located at the edge of the wood board, the longitudinal difference of the point a is 255, and the appearance sequence of the white-black boundary of the point a is numbered 1; the point b to the point c means that the wood board has grooves, the point b means that the grooves start to appear in the longitudinal point set A, the point c means that the grooves end, 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 black-white boundary of the point c is 2; the point d to the point e means that the groove appears again on the wood board, the point d means that the groove starts in the longitudinal point set A, the point e means that the groove ends, the longitudinal difference value of the point d is 255, the appearance sequence number of the black-white boundary of the point d is 2, the longitudinal difference value of the point e is 255, and the appearance sequence number of the white-black boundary of the point e is 3; the point f is a point on the plank and the subsequent point of the point f is positioned on the platform, the longitudinal difference value of the point f is 255, and the appearance sequence number of the black-white juncture of the point f is 3. That is, the first target point in the vertical point set a is a point a, and the second target point in the vertical point set a is a point f.
The first target point of each longitudinal point set is combined into a first target point set, that is, the first target point set comprises the upper edge of the intersection of the plank and the platform, the point of the minimum value of the abscissa in the first target point set is a first vertex, the first vertex is the point of the upper left corner of the plank in the target two-dimensional image, the point of the maximum value of the abscissa in the first target point set is a second vertex, and the second vertex is the point of the upper right corner of the plank in the target two-dimensional image. Combining the second target points of each longitudinal point set into a second target point set, wherein the point with the minimum value of the abscissa in the second target point set is a third vertex, the third vertex is the point of the lower left corner of the plank in the target two-dimensional image, the point with the maximum value of the abscissa in the second target point set is a fourth vertex, and the fourth vertex is the point of the lower right corner of the plank in the target two-dimensional image.
And respectively connecting the point of the upper left corner of the plank in the target two-dimensional image with the point of the upper right corner and the point of the lower left corner, and respectively connecting the point of the lower right corner of the plank in the target two-dimensional image with the point of the upper right corner and the point of the lower left corner, so as to construct the plank two-dimensional image. That is, the plank two-dimensional image is obtained by deleting the portion representing the platform in the target two-dimensional image, leaving a rectangular area representing the plank.
Or, according to the corresponding junction type of each point transverse difference value and the appearance sequence number of the junction type of the point, intercepting the two-dimensional image of the wood board from the two-dimensional image of the target, including: screening out a third target point with the intersection type of the first intersection type and the appearance sequence number of the first intersection type of the minimum number and a fourth target point with the intersection type of the second intersection type and the appearance sequence number of the intersection type of the maximum number from 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, 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 value of the ordinate is taken as a seventh vertex, and a point with the maximum value of the 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 the two-dimensional image of the wood board.
That is, for each of the lateral point sets, a point whose intersection type is a white-black intersection (first intersection type) is selected from all points of the lateral point set; screening a third target point with the appearance sequence number of 1 from the points with the boundary types of white-black boundary; and screening out a fourth target point with the appearance sequence number of the black-white boundary being the largest number from the points with the boundary types of white-black boundary. Combining the third target point of each transverse point set into a third target point set, namely, the third target point set comprises the left side of the intersection of the plank and the platform, the point of the minimum value of the ordinate in the third target point set is a fifth vertex, the fifth vertex is the point of the lower left corner of the plank in the target two-dimensional image, the point of the maximum value of the ordinate in the third target point set is a sixth vertex, and the sixth vertex is the point of the upper left corner of the plank in the target two-dimensional image. Combining the fourth target point of each transverse point set into a fourth target point set, wherein the point with the minimum ordinate value in the fourth target point set is a seventh vertex, the seventh vertex is the point of the lower right corner of the plank in the target two-dimensional image, the point with the maximum ordinate value in the fourth target point set is an eighth vertex, and the eighth vertex is the point of the upper right corner of the plank in the target two-dimensional image.
And respectively connecting the point of the lower left corner of the plank in the target two-dimensional image with the point of the upper left corner and the point of the lower right corner, and respectively connecting the point of the upper right corner of the plank in the target two-dimensional image with the point of the upper left corner and the point of the lower right corner, so as to construct the plank two-dimensional image.
The method further comprises the steps of: determining the length value of each edge and the angle value of each angle of the two-dimensional image of the wood board; judging whether the length values of all the sides belong to the preset length range corresponding to the side or not respectively; if the length values of the sides all belong to the preset length range corresponding to the side, judging whether the angle values of the angles all belong to the preset angle range corresponding to the angle value of the angle; 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 requirements.
That is, the absolute value of the difference between the abscissa of the first vertex and the abscissa of the second vertex is calculated and recorded as the first absolute value; calculating the absolute value of the difference value between the ordinate of the second vertex and the ordinate of the fourth vertex, and recording the absolute value as a second absolute value; calculating the difference between the abscissa of the third vertex and the abscissa of the fourth vertex, and marking the difference 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 value of each side 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 marking 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 marking 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 marking 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 marking the vector angle as a fourth vector angle; the first vector angle, the second vector angle, the third vector angle and the fourth vector angle are taken as angle values of the angles of the two-dimensional image of the wood board.
S103: and determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove and a minimum circumscribed rectangular coordinate.
Because the target two-dimensional image is a black-and-white picture, at this moment, at least one groove in the target two-dimensional image can be identified through identifying the difference of pixel values of each point in the target two-dimensional image and surrounding points of the point by a closed area detection algorithm, and the center point and the minimum circumscribed 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 bounding rectangular coordinate may be identified.
Alternatively, since the side length of the long side of the rectangular groove is generally similar to the side length of the side of the wooden board parallel to the long side of the rectangular groove, the rectangular groove in the target two-dimensional image can be determined by constructing the wooden board two-dimensional image.
Determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove, and a minimum circumscribed rectangular coordinate, comprising: screening out a fifth target point with the intersection type being a first intersection type and the appearance sequence number of the first intersection type being a first preset number and a sixth target point with the intersection type being a second intersection type and the appearance sequence number of the second intersection type being a second preset number from 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 value of the abscissa as a first rectangular vertex and taking the point with the maximum value of the abscissa as a second rectangular vertex; in the sixth target point set, a point with the minimum value of the abscissa is taken as a third rectangular vertex, and a point with the maximum value of the abscissa is taken as a fourth rectangular vertex; the first rectangular vertex is connected with the second rectangular vertex and the third rectangular vertex respectively, and the fourth rectangular vertex is connected with the second rectangular vertex and the third rectangular vertex respectively, so that a rectangular groove in the two-dimensional image of the wood board is determined; 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 center point of the rectangular groove.
The first preset number and the second preset number are manually set, and as the area of the groove is white, the longitudinal difference value of the starting point of the groove is 255, and the type of the junction is 255; the longitudinal difference at the point where the groove ends must be 255 and the type of junction must be the first type of junction. The first preset number refers to an appearance sequence number of a first boundary type of points at which the rectangular groove ends in most of the longitudinal point sets in the target two-dimensional image. The second preset number refers to an appearance sequence number of a second boundary type of points at which the rectangular groove starts in most of the longitudinal point sets in the target two-dimensional image.
As shown in fig. 4, the second intersection type of points in most of the longitudinal point sets, which means the start point of the rectangular groove, is numbered 1, and the first intersection type of points in most of the longitudinal point sets, which means the end point of the rectangular groove, is numbered 2. 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 intersection type whose appearance sequence number is 1 is the point b and the point of the first intersection type whose appearance sequence number is 2 is the point c in the longitudinal point set a in fig. 4, the points b to c mean that the hole-type groove is not a rectangular groove, but because the hole-type groove is small. Further, the number of longitudinal point sets passing 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 passing through only one rectangular groove. Therefore, the first preset number and the second preset number are only required 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 rectangular vertex is the point of the lower left corner of the rectangular groove, the second rectangular vertex is the point of the lower right corner of the rectangular groove, the third rectangular vertex is the point of the upper left corner of the rectangular groove, and the fourth rectangular vertex is the point of the upper right corner of the rectangular groove.
The edge length of each edge and the angle value of each corner of the groove can be calculated by referring to a manner of determining the length of each edge and the angle value of each corner of the two-dimensional image of the wood board, and will not be described herein.
The minimum circumscribed rectangular coordinates comprise an abscissa and an ordinate of the first diagonal point and an abscissa and an 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 bounding rectangle coordinates, the method further comprises: determining a groove type of each groove; the groove type comprises a hole type groove; if the groove is of a hole type, 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; if the diameter of the groove is within the preset diameter range, determining that the diameter of the groove meets the requirement.
The first corner point and the second corner point are the end points of a diagonal line of the minimum bounding rectangle. After the grooves are determined through the closed area detection algorithm, whether the groove types of the grooves are hole-type grooves or not can be determined through training of the neural network model, the target two-dimensional image is used as sample data, and the groove types of each groove mark in the target two-dimensional image are used as labels for training of the neural network model. The smallest circumscribed rectangle of the hole type groove is a rectangle tangent to the hole type groove, and then the first diagonal point of the hole type groove is a point of the left upper corner of the smallest circumscribed rectangle of the hole type groove, and the second diagonal point of the hole type groove is a point of the right lower corner of the smallest circumscribed rectangle of the hole type groove; alternatively, the first diagonal point of the groove is the point of the bottom left corner of the smallest circumscribed rectangle of the groove, and the second diagonal point of the groove is the point of the top right corner of the smallest circumscribed rectangle of the groove. Thus, the first absolute value and the second absolute value are the side lengths of the minimum bounding rectangle.
S104: and 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 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 abscissa and the ordinate which are respectively the same as the abscissa and the ordinate of the central point of the groove from all points in the cloud data of the target point, and determining the points as the target points corresponding to the central point of the groove; and determining the difference value of the height value of any point of the plank surface 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 of the plank surface may be a manually randomly selected point, which refers to any point in the target point cloud data that is located on the upper surface of the plank, except for a point on the groove. The height value of any point on the surface of the plank in the target point cloud data should belong to the standard plank thickness + -preset error corresponding to the plank specification of the plank. The preset error is an allowable error in the thickness of the wood board due to industrial production.
Based on the same application conception, the embodiment of the application also provides a device for determining the position and the depth of the groove, which corresponds to the method for determining the position and the depth of the groove provided by the embodiment, and because the principle of solving the problem by the device in the embodiment of the application is similar to that of the method for determining the position and the depth of the groove in the embodiment of the application, the implementation of the device can refer to the implementation of the method, and the repetition is omitted.
Fig. 5 is a functional block diagram of a device for determining a groove position and a groove depth according to an embodiment of the present application, as shown in fig. 5. The device for determining the position and depth of the groove comprises: the device comprises a filtering module 101, an acquiring module 102, a first determining module 103 and a second determining module 104. The filtering module 101 is configured to filter points with a height value smaller than a preset height in the point cloud data corresponding to the wood board to obtain target point cloud data; the acquisition module 102 is configured to acquire a target two-dimensional image corresponding to the target point cloud data; a first determining module 103, configured to determine at least one groove in the target two-dimensional image, a center 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, which is a schematic structural diagram of an electronic device provided in an embodiment of the present application, the electronic device 20 includes: processor 201, memory 202, and bus 203, memory 202 storing machine-readable instructions executable by processor 201, which when executed by processor 201 perform the steps of a method of determining groove location and depth as in any of the embodiments described above, when executed by processor 201, by communication between processor 201 and memory 202 via bus 203.
Specifically, machine readable instructions, when executed by processor 201, may perform the following: filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate 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; and 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, the embodiment of the application further provides a computer readable storage medium, wherein a computer program is stored on the computer readable storage medium, and the computer program executes the steps of the groove position and depth determination method provided by the embodiment when being executed by a processor.
Specifically, the storage medium can be a general storage medium, such as a mobile magnetic disk, a hard disk and the like, and when a computer program on the storage medium is run, the method for determining the groove position and the depth can be executed.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system and apparatus may refer to corresponding procedures in the foregoing method embodiments, which are not described herein again. In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods may be implemented in other ways. The above-described apparatus embodiments are merely illustrative, for example, the division of units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in 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 solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product, which is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely a specific embodiment of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes or substitutions are covered in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (7)
1. A method for determining a position and a depth of a groove, the method comprising:
filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate to obtain target point cloud data; the point cloud data corresponding to the plank refer to point cloud data obtained by placing the plank on a platform and scanning the platform and the plank on the platform by using a three-dimensional scanner;
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 center 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 cloud data of the target points, 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;
The obtaining 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 into a two-dimensional image to obtain a projection point positioned in the two-dimensional image; setting the pixel value of the projection point as a first pixel value, and setting the pixel value of a part except the projection point in the two-dimensional image as a second pixel value to obtain a target two-dimensional image; the size of the two-dimensional image is the size of the platform, and each point in the cloud data of the target point is projected into the two-dimensional image to obtain a projection point positioned in the two-dimensional image; the coordinates of the projection point corresponding to each point in the target point cloud data are the horizontal coordinate value and the vertical coordinate value of the point in the point cloud data corresponding to the plank, the first pixel value is set to 0, and the second pixel value is set to 255;
setting the pixel value of the projection point as a first pixel value, setting the pixel value except for the projection point in the two-dimensional image as a second pixel value, and obtaining the target two-dimensional image, wherein 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; for each transverse point set or each longitudinal point set, respectively calculating a transverse difference value or a longitudinal difference value between the pixel value of each point and the pixel value of the next point of the point; searching the junction type corresponding to the transverse difference value or the longitudinal difference value of each point from the junction type corresponding table; according to the corresponding intersection type of each point transverse difference value or longitudinal difference value and the appearance sequence number of the intersection type of the point, intercepting a plank two-dimensional image from the target two-dimensional image;
The junction type comprises a first junction type and a second junction type; the method for capturing the two-dimensional image of the wood board from the two-dimensional image of the target according to the type of the junction corresponding to the longitudinal difference value of each point and the appearance sequence number of the type of the junction of the point comprises the following steps: screening out a first target point with a first intersection type and a minimum number of appearance sequence numbers of the first intersection type and a second target point with a second intersection type and a maximum number of appearance sequence numbers of the second intersection type 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 a point with the minimum value of the abscissa as a first vertex and taking a point with the maximum value of the abscissa as a second vertex; in the second target point set, taking the point with the minimum value of the abscissa as a third vertex and taking the point with the maximum value of the abscissa as a fourth vertex; and connecting the first vertex with the second vertex and the third vertex respectively, and connecting the fourth vertex with the third vertex and the second vertex respectively to construct a two-dimensional image of the wood board.
2. The method of determining a position and depth of a groove of claim 1, wherein the interface type comprises a first interface type and a second interface type; the step of numbering according to the corresponding junction type of each point transverse difference value and the appearance sequence of the junction type of the point comprises the following steps:
screening out a third target point with the intersection type of the first intersection type and the appearance sequence number of the first intersection type of the minimum number and a fourth target point with the intersection type of the second intersection type and the appearance sequence number of the second intersection type of the maximum number from 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, 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 value of the ordinate is taken as a seventh vertex, and a point with the maximum value of the ordinate is taken as an eighth vertex;
and connecting the fifth vertex with the sixth vertex and the seventh vertex respectively, and connecting the eighth vertex with the sixth vertex and the seventh vertex respectively to construct a two-dimensional image of the wood board.
3. The method of determining a groove position and depth according to claim 1, wherein the determining at least one groove in the target two-dimensional image, a center point of each groove in the at least one groove, and a minimum bounding rectangular coordinate comprises:
screening out a fifth target point with the intersection type being a first intersection type and the appearance sequence number of the first intersection type being a first preset number and a sixth target point with the intersection type being a second intersection type and the appearance sequence number of the second intersection type being a second preset number from 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 value of the abscissa as a first rectangular vertex and taking the point with the maximum value of the abscissa as a second rectangular vertex;
in the sixth target point set, a point with the minimum value of the abscissa is taken as a third rectangular vertex, and a point with the maximum value of the abscissa is taken as a fourth rectangular vertex;
the first rectangular vertex is respectively connected with the second rectangular vertex and the third rectangular vertex, the fourth rectangular vertex is respectively connected with the second rectangular vertex and the third rectangular vertex, and a rectangular groove in the two-dimensional image of the wood board is determined;
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 center point of the rectangular groove.
4. The method of determining the position and depth of a groove according to claim 1 or 2, characterized in that 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;
judging whether the length values of all the sides belong to the preset length range corresponding to the side or not respectively;
if the length values of the sides all belong to the preset length range corresponding to the side, judging whether the angle values of the angles all belong to the preset angle range corresponding to the angle value of the angle;
and if the angle values of the angles belong to the preset angle ranges corresponding to the angle values of the angles, determining that the appearance of the wood board meets the requirements.
5. The method of determining the position and depth of a recess according to any one of claims 1 to 4, wherein the minimum bounding rectangular coordinates include an abscissa and an ordinate of a first diagonal point, and an abscissa and an ordinate of a second diagonal point; after the 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 bounding rectangle coordinates, the method further includes:
Determining a groove type of each groove; the groove type comprises a hole type groove;
if the groove is of a hole type, 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;
if the diameter of the groove is within the preset diameter range, determining that the diameter of the groove meets the requirement.
6. The method for determining the position and depth of a groove according to any one of claims 1 to 4, wherein the matching the center point of each groove of at least one groove with each point in the cloud data of the target point, determining the target point matched with the center point of the groove, and determining the 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 abscissa and the ordinate which are respectively the same as the abscissa and the ordinate of the central point of the groove from all points in the cloud data of the target point, and determining the points as the target points corresponding to the central point of the groove;
And determining the difference value of the height value of any point of the plank surface 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.
7. A groove position and depth determining device, characterized in that the groove position and depth determining device comprises:
the filtering module is used for filtering points with height values smaller than a preset height in the point cloud data corresponding to the wood plate 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 point cloud data corresponding to the plank refer to point cloud data obtained by placing the plank on a platform and scanning the platform and the plank on the platform by using a three-dimensional scanner;
the first determining module is used for determining 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 rectangular coordinate;
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;
The acquisition module is further used for projecting each point in the target point cloud data into a two-dimensional image to obtain a projection point located in the two-dimensional image; setting the pixel value of the projection point as a first pixel value, and setting the pixel value of a part except the projection point in the two-dimensional image as a second pixel value to obtain a target two-dimensional image; the size of the two-dimensional image is the size of the platform, and each point in the cloud data of the target point is projected into the two-dimensional image to obtain a projection point positioned in the two-dimensional image; the coordinates of the projection point corresponding to each point in the target point cloud data are the horizontal coordinate value and the vertical coordinate value of the point in the point cloud data corresponding to the plank, the first pixel value is set to 0, and the second pixel value is set to 255;
the third determining module is used for 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; for each transverse point set or each longitudinal point set, respectively calculating a transverse difference value or a longitudinal difference value between the pixel value of each point and the pixel value of the next point of the point; searching the junction type corresponding to the transverse difference value or the longitudinal difference value of each point from the junction type corresponding table; according to the corresponding intersection type of each point transverse difference value or longitudinal difference value and the appearance sequence number of the intersection type of the point, intercepting a plank two-dimensional image from the target two-dimensional image;
The junction type comprises a first junction type and a second junction type; the third determining module is further configured to screen, in each longitudinal point set, a first target point of which the intersection type is a first intersection type and the appearance sequence number of the first intersection type is a minimum number, and a second target point of which the intersection type is a second intersection type and the appearance sequence number of the second intersection type is a maximum number; 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 a point with the minimum value of the abscissa as a first vertex and taking a point with the maximum value of the abscissa as a second vertex; in the second target point set, taking the point with the minimum value of the abscissa as a third vertex and taking the point with the maximum value of the abscissa as a fourth vertex; and connecting the first vertex with the second vertex and the third vertex respectively, and connecting the fourth vertex with the third vertex and the second vertex respectively to construct a two-dimensional image of the wood board.
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 CN115511807A (en) | 2022-12-23 |
CN115511807B true 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) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116030022B (en) * | 2023-02-01 | 2023-06-06 | 天津风霖物联网科技有限公司 | Quality detection system and method for building prefabricated part |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
CN111928811A (en) * | 2020-09-22 | 2020-11-13 | 上海钛米机器人股份有限公司 | Ground detection method, device, equipment and storage medium |
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 |
CN114140608A (en) * | 2021-12-09 | 2022-03-04 | 江苏提米智能科技有限公司 | Photovoltaic panel marking method and device, electronic 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 |
CN114897999A (en) * | 2022-04-29 | 2022-08-12 | 美的集团(上海)有限公司 | Object pose recognition method, electronic device, storage medium, and program product |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106225678B (en) * | 2016-09-27 | 2018-10-19 | 北京正安维视科技股份有限公司 | Dynamic object positioning based on 3D cameras and volume measuring method |
CN110276793A (en) * | 2019-06-05 | 2019-09-24 | 北京三快在线科技有限公司 | A kind of method and device for demarcating three-dimension object |
CN111753609B (en) * | 2019-08-02 | 2023-12-26 | 杭州海康威视数字技术股份有限公司 | Target identification method and device and camera |
CN111754515B (en) * | 2019-12-17 | 2024-03-01 | 北京京东乾石科技有限公司 | Sequential gripping method and device for stacked articles |
CN113532277B (en) * | 2021-09-13 | 2021-12-07 | 江苏中车数字科技有限公司 | Method and system for detecting plate-shaped irregular curved surface workpiece |
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 |
CN114862929A (en) * | 2022-04-19 | 2022-08-05 | 深圳市优必选科技股份有限公司 | Three-dimensional target detection method and device, computer readable storage medium and robot |
-
2022
- 2022-09-16 CN CN202211127607.7A patent/CN115511807B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
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 |
CN114140608A (en) * | 2021-12-09 | 2022-03-04 | 江苏提米智能科技有限公司 | Photovoltaic panel marking method and device, electronic equipment and storage medium |
CN114897999A (en) * | 2022-04-29 | 2022-08-12 | 美的集团(上海)有限公司 | Object pose recognition method, electronic device, storage medium, and program product |
Also Published As
Publication number | Publication date |
---|---|
CN115511807A (en) | 2022-12-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107025663B (en) | Clutter scoring system and method for 3D point cloud matching in vision system | |
US7822267B2 (en) | Enhanced object reconstruction | |
US7456842B2 (en) | Color edge based system and method for determination of 3D surface topology | |
CN110443243B (en) | Water level monitoring method, storage medium, network device and water level monitoring system | |
US10438036B1 (en) | System and method for reading and decoding ID codes on a curved, sloped and/or annular object | |
US9799117B2 (en) | Method for processing data and apparatus thereof | |
CN112132907B (en) | Camera calibration method and device, electronic equipment and storage medium | |
CN107463659B (en) | Object searching method and device | |
CN111412842B (en) | Method, device and system for measuring cross-sectional dimension of wall surface | |
CN107346040B (en) | Method and device for determining grating parameters of naked eye 3D display equipment and electronic equipment | |
CN104634242A (en) | Point adding system and method of probe | |
CN115511807B (en) | Method and device for determining position and depth of groove | |
CN107239742A (en) | A kind of gauge pointer scale value calculating method | |
KR100456628B1 (en) | System and method for processing a discrimination of object information | |
CN113074660B (en) | Surface shape measuring method for large-size transparent object | |
CN113610933A (en) | Log stacking dynamic scale detecting system and method based on binocular region parallax | |
CN111179347B (en) | Positioning method, positioning equipment and storage medium based on regional characteristics | |
CN116342718A (en) | Calibration method, device, storage medium and equipment of line laser 3D camera | |
CN109784328B (en) | Method for positioning bar code, terminal and computer readable storage medium | |
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 | |
CN111006599B (en) | Object surface micro-scale measurement method based on pixel grating and computer vision | |
CN115018735B (en) | Crack width identification method and system based on Hough transformation correction two-dimensional code image | |
CN116125489A (en) | Indoor object three-dimensional detection method, computer equipment and storage medium | |
CN115713553A (en) | Blind hole plate blind hole depth measuring method and related device |
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 |
Inventor after: Li Xiaobo Inventor before: Guo Bin Inventor before: Li Xiaobo Inventor before: Xu Zhiyuan |
|
CB03 | Change of inventor or designer information | ||
GR01 | Patent grant | ||
GR01 | Patent grant |