Scale identification method and device, electronic equipment and storage medium
By identifying and filtering point-shaped coded points and auxiliary feature points in point cloud data, automatic recognition of the ruler is achieved, solving the problem of automatic recognition of the ruler in the prior art, and improving the accuracy and efficiency of the recognition.
Patent Information
- Application Number
- CN202510323574.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-18
- Publication Date
- 2025-06-24
AI Technical Summary
It is difficult for the prior art to realize automatic identification of the scale, especially in application scenarios such as industrial testing, medical imaging and intelligent measurement equipment.
By obtaining the point cloud data of the current frame, identifying the dot-shaped coded points in the target ruler, and filtering the point cloud data based on these points, further identifying the auxiliary feature points and the endpoints at both ends of the ruler, realizing automatic identification of the ruler.
It realizes accurate and automatic recognition of the ruler, solves the problem of distinguishing the ruler with the same encoding points, and improves the accuracy and efficiency of ruler recognition.
Smart Images

Figure CN120198899A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of three-dimensional scanning, and particularly relates to a scale recognition method, device, electronic device, and storage medium. Background Art
[0002] Scale products are widely used in application scenarios such as industrial inspection, medical imaging, intelligent measurement devices, and precision instrument calibration. How to automatically recognize scales needs to be solved. Summary of the Invention
[0003] This application aims to solve at least one of the technical problems existing in the related art. For this purpose, this application provides a scale recognition method, device, electronic device, and storage medium, which can effectively recognize scales.
[0004] In a first aspect, this application provides a scale recognition method, which includes:
[0005] Obtain the first point cloud data of the current frame, where the current frame is obtained by photographing a target scale;
[0006] Based on the first point cloud data, identify the dot coding points in the target scale;
[0007] According to the dot coding points, screen the first point cloud data to obtain the second point cloud data;
[0008] Based on the second point cloud data, identify the auxiliary feature points in the target scale, where the auxiliary feature points are used to distinguish scales with the same dot coding points;
[0009] According to the dot coding points and the design dimension information of the target scale, identify the endpoints at both ends of the target scale.
[0010] In the above technical solution, by obtaining the first point cloud data of the current frame, identifying the dot coding points in the target scale, screening the point cloud data, further identifying the auxiliary feature points in the target scale, and according to the dot coding points and the design dimension information of the target scale, identifying the endpoints at both ends of the target scale, the automatic recognition of the scale is realized.
[0011] According to an embodiment of this application, the obtaining the first point cloud data of the current frame includes:
[0012] Obtain all three-dimensional marker point clouds in the current frame space.
[0013] In the above technical solution, by obtaining the three-dimensional marker point cloud, the automatic recognition of the three-dimensional scale can be realized.
[0014] According to an embodiment of the present application, screening the first point cloud data according to the dot - coded points to obtain second point cloud data includes:
[0015] Constructing a plane of the target scale according to the dot - coded points to obtain third point cloud data;
[0016] Using the structure where the target scale is located to further screen the third point cloud data to delete the marked points not within the structure, thereby obtaining second point cloud data.
[0017] In the above - mentioned technical solution, by acquiring the 3D marked - point cloud, identifying the dot - coded points of the target scale based on the 3D marked - point cloud, and further screening the 3D marked - point cloud according to the identified dot - coded points by constructing the scale plane and using the structure where the scale is located, the screening of the marked points belonging to the scale is realized.
[0018] According to an embodiment of the present application, acquiring the first point cloud data of the current frame includes:
[0019] Acquiring all 2D marked - point clouds in the field of view of the current - frame camera.
[0020] In the above - mentioned technical solution, by acquiring the 2D marked - point cloud, the automatic recognition of the 2D scale can be realized.
[0021] According to an embodiment of the present application, screening the first point cloud data according to the dot - coded points to obtain second point cloud data includes:
[0022] Projecting all the 2D marked - point clouds onto an orthographic coordinate system according to the dot - coded points to obtain third point cloud data;
[0023] Using the structure where the target scale is located after equal - ratio scaling to further screen the third point cloud data to delete the marked points not within the structure, thereby obtaining second point cloud data.
[0024] In the above - mentioned technical solution, performing an affine transformation on the 2D marked points according to the dot - coded points and performing equal - ratio scaling on the structure where the scale is located can effectively reduce the influence of the shooting distortion caused by the shooting angle and improve the accuracy of scale recognition.
[0025] According to an embodiment of the present application, identifying the auxiliary feature points in the target scale based on the second point cloud data includes:
[0026] Calculating a first distance from each marked point in the second point cloud data to the center point of the dot - coded points;
[0027] Sort the respective marked points according to the first distance. After removing the marked points belonging to the dot - coded points, identify the N marked points closest to the center point of the dot - coded points as the auxiliary feature points in the target scale.
[0028] In the above - mentioned technical solution, calculate the first distance from each marked point in the second point cloud data to the center point of the dot - coded point; sort the respective marked points according to the first distance. After removing the marked points belonging to the dot - coded points, identify the N marked points closest to the center point of the dot - coded points as the auxiliary feature points in the target scale. By identifying the auxiliary feature points, the recognition problem of scales with the same coded points can be solved.
[0029] According to an embodiment of the present application, the identifying the end points at both ends of the target scale according to the dot - coded point and the design dimension information of the target scale includes:
[0030] Based on the center point of the dot - coded point, search for multiple end points at both ends of the target scale within a preset range of a preset distance;
[0031] According to the design dimension information of the target scale, determine whether the current end point belongs to the target scale, where the current end point is any one of the multiple end points at both ends of the target scale found;
[0032] In the case where the current end point belongs to the target scale, determine whether the current end point is on the left or right side of the dot - coded point.
[0033] In the above - mentioned technical solution, according to the center point of the dot - coded point and the design dimension information of the target scale, identify the end points at both ends of the target scale, and verify whether the identified end points belong to the target scale, thus realizing the identification of the marked points at both ends of the scale.
[0034] According to an embodiment of the present application, the method further includes:
[0035] In the case where all the end points on the current side of the target scale have not been fully identified, do not identify the end points on the current side as the marked points of the target scale.
[0036] In the above - mentioned technical solution, according to the center point of the dot - coded point and the design dimension information of the target scale, identify the end points at both ends of the target scale, and only determine that the identified end points are the marked points at both ends of the target scale when it is determined that all the end points at both ends of the scale have been fully identified, thereby improving the accuracy of scale recognition.
[0037] According to an embodiment of the present application, the method further includes:
[0038] Perform unique encoding on the dot - coded points, auxiliary feature points, and both end points.
[0039] In the above - mentioned technical solution, after identifying the dot - coded points, auxiliary feature points, and marker points located at both ends of the target scale on the scale, perform unique encoding on the dot - coded points, auxiliary feature points, and both end points in sequence, so as to obtain the scale recognition result.
[0040] In a second aspect, the present application provides a scale recognition device, which includes:
[0041] An acquisition module, configured to acquire first point cloud data of the current frame, where the current frame is obtained by photographing the target scale;
[0042] A first recognition module, configured to identify dot - coded points in the target scale based on the first point cloud data;
[0043] A screening module, configured to screen the first point cloud data according to the dot - coded points to obtain second point cloud data;
[0044] A second recognition module, configured to identify auxiliary feature points in the target scale based on the second point cloud data, where the auxiliary feature points are used to distinguish scales with the same dot - coded points;
[0045] A third recognition module, configured to identify the end points at both ends of the target scale according to the dot - coded points and the design dimension information of the target scale.
[0046] In the above - mentioned technical solution, by acquiring the first point cloud data of the current frame, identifying the dot - coded points in the target scale, screening the point cloud data and then further identifying the auxiliary feature points in the target scale, and identifying the end points at both ends of the target scale according to the dot - coded points and the design dimension information of the target scale, the automatic recognition of the scale is realized.
[0047] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the computer program, the scale recognition method described in the first aspect above is implemented.
[0048] In a fourth aspect, the present application provides a non - transitory computer - readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the scale recognition method described in the first aspect above is implemented.
[0049] In a fifth aspect, the present application provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the scale recognition method described in the first aspect.
[0050] In a sixth aspect, the present application provides a computer program product, including a computer program, which when executed by a processor implements the scale recognition method as described in the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, where:
[0052] Figure 1 is a schematic flowchart of the scale recognition method provided by some embodiments of the present application;
[0053] Figure 2 is a schematic diagram of marked points on a three-dimensional scale provided by some embodiments of the present application;
[0054] Figure 3 is a schematic diagram of encoding marked points on a scale provided by some embodiments of the present application;
[0055] Figure 4 is a schematic structural diagram of a scale recognition device provided by some embodiments of the present application;
[0056] Figure 5 is a schematic structural diagram of an electronic device provided by some embodiments of the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0057] The technical solutions in the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application belong to the scope of protection of the present application.
[0058] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, rather than to describe a specific order or sequence. It should be understood that such used data may be interchanged under appropriate circumstances so that the embodiments of the present application can be implemented in an order different from those illustrated or described herein, and the objects distinguished by "first", "second", etc. generally belong to the same category, and the number of objects is not limited. For example, the first object may be one or multiple. In addition, "and / or" in the specification and claims means at least one of the connected objects, and the character " / " generally indicates an "or" relationship between the associated objects before and after.
[0059] The scale recognition method provided by the embodiments of the present application will be described in detail below with reference to the drawings through specific embodiments and their application scenarios.
[0060] The ruler recognition method provided by the embodiments of the present application may be executed by an electronic device or a functional module or functional entity in the electronic device that can implement the ruler recognition method. It should be noted that the electronic device mentioned in the embodiments of the present application may be an electronic device integrated with a ruler product, for example, a scanning device. The scanning devices mentioned in the embodiments of the present application include but are not limited to handheld scanning devices (such as handheld laser scanners or tracking scanners, etc.) and non-handheld scanning devices. The non-handheld scanning device may be, for example, an intelligent robot equipped with a binocular camera, a drone, or a surround scanning device, etc. The present application does not specifically limit the scanning device.
[0061] Taking the electronic device as the execution subject as an example, the ruler recognition method provided by the embodiments of the present application will be described below.
[0062] Figure 1 It is a schematic flowchart of the ruler recognition method provided by some embodiments of the present application. As Figure 1 shown, the ruler recognition method includes: step 110, step 120, step 130, step 140, and step 150.
[0063] Step 110: Obtain the first point cloud data of the current frame, where the current frame is obtained by photographing the target ruler;
[0064] A ruler can be a tool for measuring length or size, and a ruler can also refer to an instrument component for precise measurement. A ruler can also be used as a measurement reference. The embodiments of the present application do not limit the type, use, and application scenario of the ruler.
[0065] The purpose of the present application is to realize the recognition of the target ruler, which means to identify the marker points belonging to the target ruler from the three-dimensional marker point cloud or the two-dimensional marker point cloud.
[0066] By photographing the target ruler, the current frame is obtained. Further, the three-dimensional marker point cloud in the three-dimensional space corresponding to the current frame, or the two-dimensional marker point cloud in the camera field of view corresponding to the current frame is obtained. That is, the first point cloud data is a three-dimensional marker point cloud or a two-dimensional marker point cloud.
[0067] A marker point is a reference point in physical space or an image, which is used to assist the algorithm in positioning, calibration, or data alignment. For example, circular patches or coded patterns in 3D scanning.
[0068] Marking points can be divided into coded marking points and non-coded marking points. Among them, coded marking points are widely used in photogrammetry systems. The working principle of photogrammetry is often based on camera shooting, providing rich information through images to achieve the reconstruction of three-dimensional objects in space. Aerotriangulation (abbreviated as AT) is a common three-dimensional reconstruction method based on photogrammetry. Coded marking points can be used as a means to calibrate the internal parameters of the camera in it. When calibrating the camera in AT, several coded marking points are usually photographed from various angles. Since each coded marking point corresponds to a different unique code value, it provides an important basis for image recognition, and then the internal parameters of the camera, such as focal length, distortion, offset, etc., are calculated according to the triangulation algorithm. Each coded marking point has unique coding information, ensuring the uniqueness of the marking points and avoiding the possibility of confusion with other marking points. Non-coded marking points usually refer to the type of marking points widely used in the field of 3D scanners. Optionally, non-coded marking points usually adopt a circular design.
[0069] Step 120: Based on the first point cloud data, identify the dot-coded points in the target scale.
[0070] An embodiment of the present application proposes a scale model. The marking points on the scale model include: dot-coded points, auxiliary feature points, and marking points located at both ends (i.e., the left and right ends) of the scale. Figure 2 It is a schematic diagram of the marking points on the 3D scale provided by some embodiments of the present application. As Figure 2 shown, the scale includes: 7 dot-coded points 201, 3 auxiliary feature points 202, and 6 marking points 203 located at both ends of the scale.
[0071] Therefore, identifying the marking points on the target scale includes: identifying the dot-coded points, auxiliary feature points, and marking points located at both ends of the target scale.
[0072] Optionally, the dot-coded point is a group of marking points or a coded flag composed of multiple positioning points and coded points, which constitutes the ID of the scale and is used to uniquely identify the scale. Among them, the positioning points are used to define the coordinate system of the dot-coded point, and the coded points are used to describe the coding. Multiple coded points are distributed at the remaining positions of the positioning points and do not intersect with the positioning points. Optionally, each coded point is assigned a unique number according to its different design positions to form a unique code value. The dot-coded points can still maintain consistent recognition under different perspectives. The auxiliary feature points are used to assist in uniquely determining the identification information (ID) of the scale, mainly used to distinguish scales with the same dot-coded points. That is, when the dot-coded points of two scales are the same, these two scales can be distinguished by the auxiliary feature points.
[0073] In some embodiments, the identification process of dot - coded points is as follows: Determine the central positioning of the coded points, perform image binarization, scan the code segment information of the coded points, determine whether the code segment information is scanned. If the code segment information is scanned, record the scanned code segment information as 1 or 0 according to solid or hollow, perform binary - to - decimal conversion on the binary code, and perform accurate code matching according to the determined decimal digital code.
[0074] Step 130: Screen the first point cloud data according to the dot - coded points to obtain the second point cloud data;
[0075] After identifying the dot - coded points of the target scale, other marker points belonging to the target scale are further identified. Optionally, according to the dot - coded points, a plane of the target scale is constructed, and the marker points on the plane of the target scale are screened out; further, with the center point of the dot - coded point as the reference, along the horizontal direction as the central axis of the structure, the radius or length or width, etc. of the structure are set according to the size information of the dot - coded points, so that the structure where the target scale is located can be determined. Further screening is performed according to the structure where the target scale is located, and the marker points outside the structure are removed to obtain the second point cloud data, thereby improving the accuracy of scale identification. The form of the structure where the target scale is located can be a cylinder, or a square structure, or a strip structure, etc., and the embodiments of the present application do not limit this.
[0076] Step 140: Based on the second point cloud data, identify the auxiliary feature points in the target scale, and the auxiliary feature points are used to distinguish scales with the same dot - coded points;
[0077] Optionally, the auxiliary feature points are set near the dot - coded points. Therefore, the auxiliary feature points near the dot - coded points can be determined by calculating the distances from each marker point in the second point cloud data to the center point of the dot - coded points. In the case where the dot - coded points of different scales are the same, different scales can be distinguished by the auxiliary feature points. Optionally, the auxiliary feature points and the dot - coded points have a topological relationship.
[0078] Step 150: Identify the end points at both ends of the target scale according to the dot - coded points and the design dimension information of the target scale.
[0079] Optionally, the design dimension information of the target scale includes the distances from the center point of the dot - coded points to the end points at both ends. According to the distances from the center point of the dot - coded points to the end points at both ends, the end points at both ends of the target scale can be identified.
[0080] It should be noted that the identification of the end points at both ends of the target scale can also be performed first, and then the identification of the auxiliary feature points can be performed. The embodiments of the present application do not limit this.
[0081] The scale recognition method provided by the embodiments of the present application realizes the automatic recognition of a scale by obtaining the first point cloud data of the current frame, identifying the dot-coded points in the target scale, further identifying the auxiliary feature points in the target scale after screening the point cloud data, and identifying the endpoints at both ends of the target scale according to the dot-coded points and the design dimension information of the target scale.
[0082] In some embodiments, obtaining the first point cloud data of the current frame includes:
[0083] Obtaining all three-dimensional marker point clouds in the current frame space.
[0084] Taking a binocular system as an example, the acquisition of three-dimensional marker points is obtained through the following steps: First, identify two-dimensional marker points; perform left and right eye matching; further, perform binocular reconstruction to obtain three-dimensional marker points.
[0085] The scale recognition method provided by the embodiments of the present application can realize the automatic recognition of a three-dimensional scale by obtaining the three-dimensional marker point cloud.
[0086] In some embodiments, screening the first point cloud data according to the dot-coded points to obtain the second point cloud data includes:
[0087] Constructing a plane of the target scale according to the dot-coded points to obtain the third point cloud data;
[0088] Using the structure where the target scale is located to further screen the third point cloud data to delete the marker points not in the structure and obtain the second point cloud data.
[0089] Specifically, by using the dot-coded points to fit the plane of the target scale, calculating the distance from each marker point in the first point cloud data to the plane of the target scale, if the distance from a marker point to the plane of the target scale is less than or equal to a preset threshold, it can be considered that the marker point is a point on the plane of the target scale, so that the marker points belonging to the plane of the target scale in the first point cloud data can be screened out to obtain the third point cloud data.
[0090] Further, taking the center point of the dot-coded points as a reference, with the horizontal direction as the central axis of the structure, setting information such as the radius or length or width of the structure according to the dimension information of the dot-coded points, so as to determine the structure where the target scale is located, judge whether the marker points in the third point cloud data are in the structure, and remove the points not inside the structure to obtain the second point cloud data.
[0091] For example, the structure is a cylinder (which can be simply referred to as a column). Taking the center point of the dot - coded point as a reference, along the horizontal direction is the central axis of the cylinder, and the radius of the cylinder is set according to the size information of the dot - coded point. Thus, the cylinder where the target scale is located can be determined. Further screening is performed based on the cylinder where the target scale is located, and the marked points outside the cylinder are removed to obtain the second point cloud data, thereby improving the accuracy of scale recognition.
[0092] The scale recognition method provided by the embodiments of the present application obtains the 3D marked - point cloud, identifies the dot - coded points of the target scale based on the 3D marked - point cloud, and further screens the 3D marked - point cloud by constructing a scale plane and using the structure where the scale is located according to the identified dot - coded points, realizing the screening of the marked points belonging to the scale.
[0093] In some embodiments, obtaining the first point cloud data of the current frame includes:
[0094] Obtaining all 2D marked - point clouds in the camera view of the current frame.
[0095] The scale recognition method provided by the embodiments of the present application can realize the automatic recognition of 2D scales by obtaining 2D marked - point clouds.
[0096] In some embodiments, screening the first point cloud data according to the dot - coded points to obtain the second point cloud data includes:
[0097] Projecting all 2D marked - point clouds onto an orthographic coordinate system according to the dot - coded points to obtain the third point cloud data;
[0098] Using the structure where the target scale is located after equal - ratio scaling to further screen the third point cloud data to delete the marked points not inside the structure, obtaining the second point cloud data.
[0099] It should be noted that the orthographic coordinate system refers to the image coordinate system obtained by shooting directly at the scale. By projecting all 2D marked points onto the orthographic coordinate system, the affine transformation of 2D marked points is realized.
[0100] Furthermore, taking the center point of the dot - coded point as a reference, along the horizontal direction is the central axis of the structure, and information such as the radius, length, or width of the structure is set according to the size information of the dot - coded point. Thus, the structure where the target scale is located can be determined, and this structure is scaled equally to obtain the structure where the target scale is located after equal - ratio scaling. It is judged whether the marked points in the third point cloud data are inside the structure where the target scale is located after equal - ratio scaling, and the points not inside the structure are removed to obtain the second point cloud data.
[0101] For example, the structure is a cylinder (which can be simply referred to as a column). Taking the center point of the dot-coded point as a reference, the horizontal direction is the central axis of the cylinder, and the radius of the cylinder is set according to the size information of the dot-coded point, so that the cylinder where the target scale is located can be determined. The cylinder where the target scale is located is scaled proportionally to obtain the cylinder where the target scale is located after proportional scaling. It is judged whether the marked points in the third point cloud data are inside the cylinder where the target scale is located after proportional scaling, and the points not inside the cylinder are removed to obtain the second point cloud data.
[0102] The scale recognition method provided by the embodiment of the present application performs an affine transformation on the two-dimensional marked points according to the dot-coded points, and by proportionally scaling the structure where the scale is located, it can effectively reduce the influence of shooting distortion caused by the shooting angle and improve the accuracy of scale recognition.
[0103] In some embodiments, based on the second point cloud data, the auxiliary feature points in the target scale are recognized, including:
[0104] Calculating the first distance from each marked point in the second point cloud data to the center point of the dot-coded point;
[0105] Sorting each marked point according to the first distance, and after removing the marked points belonging to the dot-coded point, the N marked points closest to the center point of the dot-coded point are recognized as the auxiliary feature points in the target scale.
[0106] In this embodiment, based on the second point cloud data and the center point of the dot-coded point, the auxiliary feature points in the target scale are recognized. Calculate the distance from each marked point in the second point cloud data to the center point of the dot-coded point, and record this distance as the first distance; according to the first distance from each marked point in the second point cloud data to the center point of the dot-coded point, sort each marked point, and after removing the marked points belonging to the dot-coded point, the N marked points closest to the center point of the dot-coded point are recognized as the auxiliary feature points in the target scale.
[0107] It should be noted that the auxiliary feature points are used to assist in uniquely determining the identification information (ID) of the scale, mainly used to distinguish scales with the same dot-coded points, that is, in the case where the dot-coded points of two scales are the same, these two scales can be distinguished by the auxiliary feature points.
[0108] Optionally, N is greater than or equal to 3, that is, according to the first distance from each marked point in the second point cloud data to the center point of the dot-coded point, sort each marked point, and after removing the marked points belonging to the dot-coded point, at least 3 marked points closest to the center point of the dot-coded point are recognized as the auxiliary feature points in the target scale. It should be noted that at least three of these points can have topological features to uniquely determine the scale ID, mainly used to distinguish scales with the same dot-coded points.
[0109] Optionally, the auxiliary feature points may also be one or two points. In this case, the topological structure between the auxiliary feature points and the dot-coded points can be used to uniquely determine the scale ID.
[0110] The scale recognition method provided by the embodiments of the present application calculates the first distance from each marked point in the second point cloud data to the center point of the dot-coded point; sorts each marked point according to the first distance, and after removing the marked points belonging to the dot-coded point, identifies the N marked points closest to the center point of the dot-coded point as the auxiliary feature points in the target scale. By identifying the auxiliary feature points, the recognition problem of scales with the same coded points can be solved.
[0111] In some embodiments, identifying the end points at both ends of the target scale according to the dot-coded point and the design dimension information of the target scale includes:
[0112] Searching for multiple end points at both ends of the target scale within a preset range of a preset distance based on the center point of the dot-coded point;
[0113] Judging whether the current end point belongs to the target scale according to the design dimension information of the target scale, where the current end point is any one of the multiple end points at both ends of the target scale found;
[0114] When the current end point belongs to the target scale, determining whether the current end point is on the left or right side of the dot-coded point.
[0115] It can be understood that based on the second point cloud data, searching for the end points at both ends of the target scale within a preset range of a preset distance from the center point of the dot-coded point, the end points at both ends of the target scale are the marked points located at the left and right ends of the target scale.
[0116] According to the scale design dimension information, the second distance from the multiple end points at both ends of the scale to the center point of the dot-coded point can be calculated, that is, using the second distance as a reference distance to judge whether the currently found end point belongs to the target scale. If the distance from the current end point to the center point of the dot-coded point meets the scale design dimension information (that is, meets the corresponding second distance), it is determined that the current end point belongs to the target scale.
[0117] When the current end point belongs to the target scale, further determine whether the current end point is on the left or right side of the dot-coded point.
[0118] Optionally, according to the coding of the coded point, when the printed number is facing up, it is the positive direction. At this time, the left side is the left side of the coded point, and the right side is the right side of the coded point.
[0119] Thus, all the marked points belonging to the target scale are obtained, including the multiple end points at both ends of the target scale, the dot-coded point, and the auxiliary feature points.
[0120] The scale recognition method provided by the embodiments of the present application identifies the end points at both ends of the target scale according to the center points of the dot-shaped coding points and the design dimension information of the target scale, and verifies whether the identified end points belong to the target scale, thereby realizing the recognition of the marking points at both ends of the scale.
[0121] In some embodiments, the method further includes:
[0122] In the case where all the end points on the current side of the target scale have not been fully recognized, the end points on the current side are not recognized as the marking points of the target scale.
[0123] It can be understood that only when all the end points on the left side of the target scale have been fully recognized, the end points on the left side are recognized as the marking points of the target scale. Or, only when all the end points on the right side of the target scale have been fully recognized, the end points on the right side are recognized as the marking points of the target scale.
[0124] The scale recognition method provided by the embodiments of the present application identifies the end points at both ends of the target scale according to the center points of the dot-shaped coding points and the design dimension information of the target scale, and only when it is determined that all the end points at both ends of the scale have been fully recognized, it is determined that the identified end points are the marking points at both ends of the target scale, thereby improving the accuracy of scale recognition.
[0125] In some embodiments, the method further includes:
[0126] Perform unique coding on the dot-shaped coding points, auxiliary feature points, and both end points.
[0127] Optionally, after identifying the dot-shaped coding points, auxiliary feature points, and both end points of the target scale, a unique number is sequentially assigned to the dot-shaped coding points, auxiliary feature points, and both end points respectively, so as to realize the coding of all the marking points of the scale.
[0128] Figure 3 It is a schematic diagram of coding the marking points of the scale provided by some embodiments of the present application. As Figure 3 , the dot-shaped coding points are coded as 0 to 6, where the center point of the dot-shaped coding point is coded as 3, the auxiliary feature points are coded as 7 to 9, the 3 end points on the left side are coded as 10 to 12, and the 3 end points on the right side are coded as 13 to 15. It should be noted that the embodiments of the present application do not limit the specific implementation manner of coding all the marking points of the scale.
[0129] The scale recognition method provided by the embodiments of the present application, after identifying the dot-shaped coding points, auxiliary feature points, and the marking points located at both ends of the target scale, performs unique coding on the dot-shaped coding points, auxiliary feature points, and both end points in sequence, thereby obtaining the scale recognition result.
[0130] The ruler recognition method provided by the embodiments of the present application may have a ruler recognition device as the execution subject. In the embodiments of the present application, taking the ruler recognition device as an example to execute the ruler recognition method, the ruler recognition device provided by the embodiments of the present application is described.
[0131] As Figure 4 shown, the ruler recognition device 400 includes: an acquisition module 410, a first recognition module 420, a screening module 430, a second recognition module 440, and a third recognition module 450.
[0132] The acquisition module 410 is configured to acquire first point cloud data of the current frame, and the current frame is obtained by photographing a target ruler;
[0133] The first recognition module 420 is configured to recognize dot - shaped coding points in the target ruler based on the first point cloud data;
[0134] The screening module 430 is configured to screen the first point cloud data according to the dot - shaped coding points to obtain second point cloud data;
[0135] The second recognition module 440 is configured to recognize auxiliary feature points in the target ruler based on the second point cloud data, and the auxiliary feature points are used to distinguish rulers with the same dot - shaped coding points;
[0136] The third recognition module 450 is configured to recognize the end points at both ends of the target ruler according to the dot - shaped coding points and the design dimension information of the target ruler.
[0137] The ruler recognition device provided by the embodiments of the present application realizes the automatic recognition of the ruler by acquiring the first point cloud data of the current frame, recognizing the dot - shaped coding points in the target ruler, further recognizing the auxiliary feature points in the target ruler after screening the point cloud data, and recognizing the end points at both ends of the target ruler according to the dot - shaped coding points and the design dimension information of the target ruler.
[0138] In some embodiments, acquiring the first point cloud data of the current frame includes:
[0139] Acquiring all three - dimensional marker point clouds in the current frame space.
[0140] The ruler recognition device provided by the embodiments of the present application can realize the automatic recognition of three - dimensional rulers by acquiring three - dimensional marker point clouds.
[0141] In some embodiments, screening the first point cloud data according to the dot - shaped coding points to obtain second point cloud data includes:
[0142] Constructing a plane of the target ruler according to the dot - shaped coding points to obtain third point cloud data;
[0143] Using the structure where the target scale is located, the third point cloud data is further filtered to delete the marked points not within the structure, obtaining the second point cloud data.
[0144] The scale recognition device provided by the embodiment of the present application obtains the three-dimensional marked point cloud, identifies the dot-coded points of the target scale based on the three-dimensional marked point cloud, and further filters the three-dimensional marked point cloud by constructing a scale plane and using the structure where the scale is located according to the identified dot-coded points, realizing the filtering of the marked points belonging to the scale.
[0145] In some embodiments, obtaining the first point cloud data of the current frame includes:
[0146] Obtaining all two-dimensional marked point clouds in the camera field of view of the current frame.
[0147] The scale recognition device provided by the embodiment of the present application can realize the automatic recognition of two-dimensional scales by obtaining two-dimensional marked point clouds.
[0148] In some embodiments, filtering the first point cloud data according to the dot-coded points to obtain the second point cloud data includes:
[0149] Projecting all two-dimensional marked point clouds onto the orthographic coordinate system according to the dot-coded points to obtain the third point cloud data;
[0150] Using the structure where the target scale is located after equal-proportion scaling to further filter the third point cloud data to delete the marked points not within the structure, obtaining the second point cloud data.
[0151] The scale recognition device provided by the embodiment of the present application performs affine transformation on two-dimensional marked points according to dot-coded points, and can effectively reduce the influence of shooting distortion caused by the shooting angle by equally scaling the structure where the scale is located, improving the accuracy of scale recognition.
[0152] In some embodiments, based on the second point cloud data, identifying the auxiliary feature points in the target scale includes:
[0153] Calculating the first distance from each marked point in the second point cloud data to the center point of the dot-coded points;
[0154] Sorting each marked point according to the first distance, and after removing the marked points belonging to the dot-coded points, identifying the N marked points closest to the center point of the dot-coded points as the auxiliary feature points in the target scale.
[0155] The scale recognition device provided by the embodiment of the present application calculates the first distance from each marked point in the second point cloud data to the center point of the dot code point; sorts each marked point according to the first distance, and after removing the marked points belonging to the dot code point, identifies the N marked points closest to the center point of the dot code point as the auxiliary feature points in the target scale. By identifying the auxiliary feature points, the recognition problem of scales with the same code points can be solved.
[0156] In some embodiments, according to the dot code point and the design dimension information of the target scale, identifying the end points at both ends of the target scale includes:
[0157] Based on the center point of the dot code point, searching for multiple end points at both ends of the target scale within a preset range at a preset distance;
[0158] According to the design dimension information of the target scale, determining whether the current end point belongs to the target scale, where the current end point is any one of the multiple end points at both ends of the target scale found;
[0159] When the current end point belongs to the target scale, determining whether the current end point is on the left or right side of the dot code point.
[0160] The scale recognition device provided by the embodiment of the present application identifies the end points at both ends of the target scale according to the center point of the dot code point and the design dimension information of the target scale, and verifies whether the identified end points belong to the target scale, realizing the recognition of the marked points at both ends of the scale.
[0161] In some embodiments, the third recognition module is further configured to:
[0162] When not all the end points on the current side of the target scale are identified, not identifying the end points on the current side as the marked points of the target scale.
[0163] The scale recognition device provided by the embodiment of the present application identifies the end points at both ends of the target scale according to the center point of the dot code point and the design dimension information of the target scale, and determines that the identified end points are the marked points at both ends of the target scale only when it is determined that all the end points at both ends of the scale are identified, improving the accuracy of scale recognition.
[0164] In some embodiments, the device further includes: an encoding module, configured to perform unique encoding on the dot code point, the auxiliary feature points, and the end points at both ends.
[0165] The scale recognition device provided by the embodiment of the present application, after identifying the dot code point, the auxiliary feature points, and the marked points located at both ends of the target scale, performs unique encoding on the dot code point, the auxiliary feature points, and the end points at both ends in sequence, thereby obtaining the scale recognition result.
[0166] The scale recognition device in the embodiments of the present application may be an electronic device or a component in an electronic device, such as an integrated circuit or a chip.
[0167] The scale recognition device in the embodiments of the present application may be a device with an operating system. The operating system may be the Microsoft (Windows) operating system, the Android operating system, the IOS operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
[0168] The scale recognition device provided by the embodiments of the present application can implement Figure 1 each process implemented by the method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein again.
[0169] In some embodiments, as Figure 5 shown, the embodiments of the present application further provide an electronic device 500, including a processor 501, a memory 502, and a computer program stored on the memory 502 and executable on the processor 501. When the program is executed by the processor 501, it implements each process of the above-mentioned scale recognition method embodiments and can achieve the same technical effects. To avoid repetition, details are not described herein again.
[0170] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
[0171] The embodiments of the present application further provide a non-transitory computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements each process of the above-mentioned scale recognition method embodiments and can achieve the same technical effects. To avoid repetition, details are not described herein again.
[0172] The processor is the processor in the electronic device in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0173] The embodiments of the present application further provide a computer program product, including a computer program, which implements the above-mentioned scale recognition method when executed by a processor.
[0174] The processor is the processor in the electronic device in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disks, or optical discs, etc.
[0175] Another embodiment of the present application further provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor. The processor is configured to run programs or instructions to implement each process of the above-described embodiment of the ruler recognition method, and can achieve the same technical effects. To avoid repetition, details are not described herein again.
[0176] It should be understood that the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, system chip, chip system, or system-on-chip, etc.
[0177] It should be noted that in this document, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device including a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article, or device including the element. In addition, it should be pointed out that the methods and devices in the embodiments of the present application are not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in a reverse order according to the functions involved. For example, the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0178] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-described embodiment methods can be implemented by means of software plus a necessary general hardware platform. Of course, they can also be implemented by hardware, but in many cases, the former is a better implementation. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the related art, can be embodied in the form of a computer software product. The computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disc), and includes several instructions for causing a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of the present application.
[0179] The embodiments of the present application have been described above in conjunction with the accompanying drawings. However, the present application is not limited to the above specific embodiments. The above specific embodiments are merely illustrative and not restrictive. Under the inspiration of the present application, those of ordinary skill in the art can also make many forms without departing from the purpose of the present application and the scope protected by the claims, and all of them belong to the protection scope of the present application.
[0180] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "schematic embodiments", "examples", "specific examples", or "some examples", etc. mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0181] Although the embodiments of this application have been shown and described, those of ordinary skill in the art can understand that various changes, modifications, substitutions, and variations can be made to these embodiments without departing from the principles and purposes of this application, and the scope of this application is defined by the claims and their equivalents.
Claims
1. A scale recognition method, characterized in that: include: Acquire first point cloud data of a current frame, where the current frame is obtained by photographing a target scale; Based on the first point cloud data, identifying point-shaped coded points in the target scale; According to the dot-shaped coded points, the first point cloud data is screened to obtain second point cloud data; Based on the second point cloud data, identifying auxiliary feature points in the target scale, wherein the auxiliary feature points are used to distinguish scales with the same point-shaped coded points; The endpoints at both ends of the target scale are identified according to the dot-shaped coding points and the design size information of the target scale.
2. The scale recognition method according to claim 1, characterized in that: The obtaining of the first point cloud data of the current frame includes: Get the point cloud of all 3D marker points in the current frame space.
3. The scale recognition method according to claim 2, characterized in that: The step of screening the first point cloud data according to the dot-shaped coded points to obtain the second point cloud data comprises: constructing a plane of the target scale according to the dot-shaped coded points to obtain third point cloud data; The third point cloud data is further screened using the structure where the target scale is located to delete the marking points that are not in the structure to obtain the second point cloud data.
4. The scale recognition method according to claim 1, characterized in that: The obtaining of the first point cloud data of the current frame includes: Get the point cloud of all 2D marker points in the camera's field of view for the current frame.
5. The scale recognition method according to claim 4, characterized in that: The step of screening the first point cloud data according to the dot-shaped coded points to obtain the second point cloud data comprises: According to the dot-shaped coding points, projecting the point clouds of all the two-dimensional marking points into an orthographic coordinate system to obtain third point cloud data; The third point cloud data is further screened using the proportionally scaled structure where the target scale is located, so as to delete the marking points that are not in the structure, and obtain the second point cloud data.
6. The scale recognition method according to claim 1, characterized in that: The step of identifying auxiliary feature points in the target scale based on the second point cloud data includes: Calculating a first distance from each marking point in the second point cloud data to a center point of the dot-shaped coded point; The marking points are sorted according to the first distance, and after the marking points belonging to the point-shaped coding points are removed, the N marking points closest to the center point of the point-shaped coding points are identified as auxiliary feature points in the target scale.
7. The scale recognition method according to claim 1, characterized in that: The step of identifying the endpoints at both ends of the target scale according to the dot-shaped coding points and the design size information of the target scale comprises: Based on the center point of the dot-shaped coded point, searching for multiple endpoints at both ends of the target scale within a preset range of a preset distance; According to the design size information of the target scale, judging whether the current endpoint belongs to the target scale, the current endpoint being any endpoint among the multiple endpoints at both ends of the target scale found; In the case that the current endpoint belongs to the target scale, it is determined that the current endpoint is located on the left side or the right side of the dot-shaped coding point.
8. The scale recognition method according to claim 7, characterized in that: The method further comprises: In the case that all the endpoints of the current side of the target scale are not recognized, the endpoints of the current side are not recognized as marking points of the target scale.
9. The scale recognition method according to any one of claims 1 to 8, characterized in that: The method further comprises: The dot-shaped coding points, the auxiliary feature points and the two end points are uniquely coded.
10. A scale recognition device, characterized in that: include: An acquisition module, used to acquire first point cloud data of a current frame, wherein the current frame is obtained by shooting a target scale, and the first point cloud data is a three-dimensional marked point cloud or a two-dimensional marked point cloud; A first recognition module, used for recognizing point-shaped coded points in the target scale based on the first point cloud data; A screening module, used for screening the first point cloud data according to the point-shaped coding points to obtain second point cloud data; A second recognition module, used for recognizing auxiliary feature points in the target scale based on the second point cloud data, wherein the auxiliary feature points are used to distinguish scales with the same point-shaped coded points; The third identification module is used to identify the endpoints at both ends of the target scale according to the dot-shaped coding points and the design size information of the target scale.
11. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the scale recognition method according to any one of claims 1 to 9 is implemented.
12. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the scale recognition method as described in any one of claims 1 to 9 is implemented.