Method for measuring the height of an object online based on profile matching

FR3135322B1Inactive Publication Date: 2025-02-21OCEANOGRAPHIC INSTR RES INST SHANDONG ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
FR2022012743
Authority / Receiving Office
FR · FR
Patent Type
Patents
Current Assignee / Owner
Priority Date
2022-05-06
Filing Date
2022-12-05
Publication Date
2025-02-21
Estimated Expiration
Not applicable · inactive patent

Smart Images

  • Figure 00000013_0000
    Figure 00000013_0000
  • Figure 00000014_0000
    Figure 00000014_0000
  • Figure 00000015_0000
    Figure 00000015_0000
Patent Text Reader

Abstract

Method for measuring the height of an object online based on profile matching. The present invention discloses a method for measuring the height of an object online based on profile matching, comprising image acquisition; laser rectangular projection search: obtaining a laser rectangular projection target in five steps: grayscale histogram stretching, adaptive binarization, area filling, morphological denoising, and laser rectangular projection profile matching; socket search: in combination with the laser rectangular projection profile, searching for a socket in five steps: adaptive binarization, morphological denoising, area filling, socket profile matching, and calculating the socket's center height; and recording measurement data. The present invention enables automatic, online, and networked measurement of the height of an object.Figure to be published with the abbreviation: Figure 1.
Need to check novelty before this filing date? Find Prior Art

Description

Title of the invention: Method for online measurement of the height of an object based on profile matching Technical field

[0001] The present invention relates to the field of visual measurement technology, in particular to a method for online measurement of the height of an object based on profile matching. TECHNICAL CONTEXT

[0002] A measuring instrument such as a retractable meter and a laser dias-timometer is generally used to manually measure the height of an object, the problems such as the measuring instrument not being placed vertically when measuring and the inaccurate center position of the object to be measured, result in low measurement accuracy of such a measuring method, low measurement efficiency, inability to upload measurement data to the network in real time and difficulty in plotting the data, resulting in generation of data islands.

[0003] With the development of computer software and hardware, the use of image processing to measure the height of an object in a scene has become an important topic in computer visual measurement. At present, computer visual measurement mainly includes two methods: a single-image measurement method and a multiple-image measurement method.

[0004] For the single-image measurement method, Chinese invention patent NO. 201610244745.1 discloses a height measurement method based on image processing, which comprises manually marking 4 horizontal lines on a single image, then measuring the actual height of 3 horizontal lines, and estimating the actual height of the fourth horizontal line according to a projection matrix between the image plane and the world coordinate system. This method is applicable to the measurement of large-scale objects having the same geographical location or similarity, which can effectively reduce the difficulty of actual measurement, but has disadvantages such as many manual interventions, low measurement efficiency, and inability to automatically measure object height. Chinese invention patent NO. 201811637965.6 discloses a method for measuring dimensions of an object based on depth image processing, which comprises obtaining a depth image with a depth camera, thereby easily obtaining the height of an object within a set range under the condition that the distance between the camera (lens is installed vertically downward) and the object table is fixed, and obtaining the length and width of the object according to the . principle of pinhole imaging. This method allows automatic measurement of object dimensions, but its applications are limited due to the need to fix the distance between the camera and the object table (background).

[0005] The multi-image measurement method mainly consists of continuously sampling with a camera, obtaining a three-dimensional point cloud based on two-dimensional images and depth images, reconstructing a three-dimensional model of the scene, and obtaining the three-dimensional data of an object to achieve the measurement purpose. Chinese invention patent NO. 202010961451.7 is to continuously sample an indoor scene with an RGBD camera and reconstruct a three-dimensional model of an indoor object, which can obtain the position and dimensions of the object, but due to a high cost of sampling equipment and many calculations required with high-performance computers to reconstruct the three-dimensional model, it is difficult to realize online processing with poor general applicability. DISCLOSURE OF THE INVENTION

[0006] To overcome the above drawbacks in the existing art, the present invention provides a method for online measurement of the height of an object based on profile matching.

[0007] A technical solution adopted by the present invention to solve the technical problems consists of: a method for online measurement of the height of an object based on profile matching, comprising the following steps:

[0008] Step 1, image acquisition: Fix two dual-line laser levels and cameras on a support and acquire a single image containing a rectangular laser projection

[0009] Step 2, laser rectangular projection search: search for a laser rectangular projection profile in five steps: grayscale histogram stretching, adaptive binarization, area filling, morphological denoising and laser rectangular projection profile matching;

[0010] Step 3, searching for an object to be measured: in combination with the laser rectangular projection profile obtained in step 2, searching for an object to be measured in five steps: adaptive binarization, morphological denoising, area filling, profile matching of the object to be measured and calculation of the central height of the object to be measured;

[0011] Step 4, recording measurement data: recording a center height mark of the object to be measured on the image and saving it as a table, and further providing a network interface for uploading the data to a server for saving;

[0012] The matching of the laser rectangular projection profile in step 2 is carried out in the following steps, in which the rectangular laser projection is defined as a parallelogram:

[0013] Step 2.1, initialization threshold N=0, sampling rate S=10%;

[0014] Step 2.2, calculate the slopes of four sides of the target of the laser rectangular projection profile, if a slope difference of two pairs of opposite sides is not equal to N, exclude the current target from the profile, and if the slope difference of two pairs of opposite sides is equal to N, go to step 2.3;

[0015] Step 2.3, sample the four sides of the target of the laser rectangular projection profile according to the S, respectively calculate a sampling slope difference of the four sides, if the difference is not equal to N, exclude the current target from the profile, and if the difference is equal to N, consider the profile matching successful;

[0016] Step 2.4, if the number of targets of the laser rectangular projection profile that meet the conditions is equal to 0, do N+0.05, and return to step 2.2; if the number of targets of the profile that meet the conditions is greater than 1, do S+10%, and return to step 2.2 until the number of targets of the profile that meet the conditions is equal to 1;

[0017] Step 2.5, calculate the image slope k, heights hi and h2 in pixels of the upper and lower sides of the rectangular laser projection profile and export a target Z of the rectangular laser projection profile.

[0018] Advantageously, according to the method for online measurement of the height of an object based on profile matching above, the morphological denoising formula in step 2 is: A°B = (A! B) ® B, where, A is a binary image, B is a morphological model of the image, and ! and ® respectively represent the corrosion operation and the expansion operation in morphology.

[0019] Advantageously, according to the method for online measurement of the height of an object based on profile matching above, for the adaptive binarization operation in step 2, the foreground color represents a percentage of less than 10%.

[0020] Advantageously, according to the method for online measurement of the height of an object based on profile matching above, for the adaptive binarization operation in step 3, the foreground color represents a percentage greater than 90%.

[0021] Advantageously, according to the method for online measurement of the height of an object based on profile matching above, for the profile matching of the object to be measured in step 3, the profile target is obtained in the same way as that for the laser rectangular projection profile matching in step 2:

[0022] Step 3.1, calculate the slopes of the left and right sides of the profile of the object to be measured, if the slope of the left side or the slope of the right side is not equal to the slope of the image, exclude the current target from the profile, and if the slope of the left side and the slope of the right side are equal to the slope of the image, go to step 3.2;

[0023] Step 3.2, calculate the sampling slopes of the left and right sides, if the sampling slopes are not equal to the image slope, exclude the current profile, and if the sampling slopes are equal to the image slope, consider the profile matching successful.

[0024] Advantageously, according to the method for online measurement of the height of an object based on profile matching, the formula for calculating the central height of the object to be measured in step 3 is as follows:

[0025] HjL^xh+LH

[0026] where, H is the actual height of the object to be measured in the world coordinate system, LH । is the actual height of the upper horizontal line of the laser rectangular projection in the world coordinate system, LH2 is the actual height of the lower horizontal line of the laser rectangular projection in the world coordinate system, h is the height in pixels of the intersection point of the connecting lines passing through the vertex point of the object to be measured to the lower side of the laser rectangular projection profile, is the height in pixels of the upper horizontal line of the laser rectangular projection and h2 is the height in pixels of the lower horizontal line of the laser rectangular projection.

[0027] The beneficial effects of the present invention are that the present invention can realize automatic, online and networked measurement of the height of an object, avoid the generation of data islands and the limitation of the distance between the camera and the background, automatically correct the error due to the tilt of the image caused by camera installation problems, realize automatic, online and networked measurement of the height of an object, and improve the accuracy and efficiency of the measurement of the height of an object; and the equipment of the present invention has low cost, small size, easy mobile installation, and strong applicability. DESCRIPTION OF FIGURES

[0028] The present invention can be described in more detail below via the attached examples and figures:

[0029] [Fig.l] is a flowchart of embodiment 1 of the invention;

[0030] [Fig.2] is an image obtained by stretching the grayscale histogram to step 2 of embodiment 1 of the invention;

[0031] [Fig.3] is an image obtained by adaptive binarization in step 2 of embodiment 1 of the invention;

[0032] [Fig.4] is an image obtained at the end of the area filling in step 2 of embodiment 1 of the invention;

[0033] [Fig.5] is an image obtained at the end of the morphological denoising in step 2 of embodiment 1 of the invention;

[0034] [Fig.6] is a result of tracking the laser rectangular projection profile in step 2 of embodiment 1 of the invention;

[0035] [Fig.7] is a result of the matching of the laser rectangular projection profile in step 2 of embodiment 1 of the invention;

[0036] [Fig.8] is a flowchart of the projection profile correspondence rec laser tangular in step 2 of embodiment 1 of the invention;

[0037] [Fig.9] is an image obtained by adaptive binarization in step 3 of the example of embodiment 1 of the invention;

[0038] [Fig. 10] is an image obtained at the end of the morphological denoising in step 3 of embodiment 1 of the invention;

[0039] [Fig. 11] is an image obtained at the end of the area filling in step 3 of embodiment 1 of the invention;

[0040] [Fig. 12] is a flowchart of the socket profile matching in step 3 of embodiment 1 of the invention;

[0041] [Fig. 13] is a result of the socket matching in step 3 of the example of embodiment 1 of the invention. DETAILED PRESENTATION OF THE IMPLEMENTATION METHOD

[0042] The technical solution of the present invention can be described in more detail below via the embodiments with reference to the figures, so that those skilled in the art can better understand the present invention.

[0043] The present exemplary embodiment discloses a method for measuring the center height of a socket when accepting work, before measuring, it is necessary to fix two double-line laser levels on a support, take a rectangular projection of a laser beam on the wall as the range of interest, stick a rectangular sheet on the socket to be measured, and measure the upper horizontal line height of laser rectangular projection LH and the lower horizontal line height of laser rectangular projection LH2. In particular, the measuring steps are shown in [Fig.l]:

[0044] Step 1, image acquisition: fix a camera on a support and acquire a single image containing a rectangular laser projection;

[0045] Step 2, laser rectangular projection search: search for a laser rectangular projection profile in five steps: grayscale histogram stretching, adaptive binarization, area filling, morphological denoising and laser rectangular projection profile matching;

[0046] (1) Stretching the grayscale histogram: for filtering, keep better image characteristics using laser color, and stretching the grayscale histogram using the green component of the image in the present embodiment, as shown in [Fig.2].

[0047] (2) Adaptive binarization: to obtain a more rectangular laser projection clear, find the optimal binarization threshold, so that the foreground color represents a percentage less than 10%, i.e. w( t) <0.1, and obtain which fulfill the conditions by iterative approximation, the binarized image being shown in [Fig.3].

[0048] (3) Area Fill: Fill the background of the binarized image with the color white, and fill the foreground with the color black, the filled image being shown in [Fig.4].

[0049] (4) Morphological denoising: perform the opening operation based on the image morphology, smooth the image profile, eliminate the narrow part and eliminate the thin protrusions, the result of the example being shown in [Fig.5], and the formula being:

[0050] AoB=(A\B)®B

[0051] where, A is a binary image, B is a morphological model of the image, and ! and ® represent respectively the corrosion operation and the expansion operation in morphology.

[0052] (5) Correspondence of the laser rectangular projection profile: design the class of profile, the class being suitable for laser rectangular projection and socket, mainly including 12 attributes (attributes can be empty),

[0053] Sequence of profiles P (x, y)

[0054] Upper left point Pi

[0055] Upper right point P2

[0056] Lower left point P3

[0057] Lower right point P4

[0058] Sequence of upper sides L12 (x, y)

[0059] Sequence of right sides L24 (x, y)

[0060] Sequence of lower sides L43 (x, y)

[0061] Left side sequence L31 (x, y)

[0062] Image slope k

[0063] Height in pixels of the upper side h,

[0064] Height in pixels of the bottom side h2

[0065] Obtaining the profile sequence of the foreground color on the image by eight-neighborhood chain code tracing method, and converting it into the target example of the profile, the results of the example are shown in [Fig.6], in which the eight-neighborhood chain code tracing method has been described in the relevant documents and as an existing technique, will not be described here.

[0066] Designing a laser rectangular projection profile matching algorithm and matching the profile target, the successfully matching profile being the laser rectangular projection, and the result of the example being shown in [Fig.7]. To calculate by the laser rectangular projection profile matching algorithm, the coordinate system is automatically established to represent the position of the rectangular projection profile, a vertex point of the rectangular projection profile can be set as the origin of the coordinate system, or another position can be set as the origin of the coordinate system, which is selected according to the actual operation.

[0067] Principle of the algorithm: the laser projection is rectangular, because the acquired image can be tilted, the algorithm defines the projection as a parallelogram, the steps are shown in [Fig.8], including:

[0068] Step 2.1, initialization threshold N=0, sampling rate S=10%, establish a coordinate system and define the origin;

[0069] Step 2.2, calculate the slopes of four sides of the profile object, if a slope difference of the opposite sides is not equal to N, exclude the current target from the profile, and if the slope difference of the opposite sides is equal to N, go to step 2.3;

[0070] Step 2.3, sample the four sides of the target of the laser rectangular projection profile according to the S, respectively calculate a sampling slope difference of the four sides, if the difference is not equal to N, exclude the current target from the profile, and if the difference is equal to N, consider the profile matching successful;

[0071] The calculation process of the sampling slope is as follows: taking the initial sampling rate S = 10% as an example, that is, taking 10% of the sampling points at the identical interval, dividing each side into 10 identical segments, calculating the slope of each segment according to the two-point formula, and then taking a difference between two, if each slope difference is equal to the threshold N, it means it is a straight line instead of an arc;

[0072] Step 2.4, if the number of targets of the laser rectangular projection profile that meet the conditions is equal to 0, do N+0.05, and return to step 2.2; if the number of targets of the profile that meet the conditions is greater than 1, do S+10%, and return to step 2.2 until the number of targets of the profile that meet the conditions is equal to 1;

[0073] Step 2.5, calculate the image slope k, the heights hi and h2 in pixels of the upper and lower sides of the rectangular laser projection profile and export a target Z of the rectangular laser projection profile;

[0074] where the image slope k is the slope of the left side of the profile.

[0075] Step 3, socket search: In combination with the laser rectangular projection profile obtained in step 2, search for a socket in five steps: adaptive binarization, morphological denoising, area filling, socket profile matching and calculate the central height of the socket.

[0076] (1) Adaptive binarization: to obtain a clearer socket, find the threshold of optimal binarization, so that the foreground color represents a percentage greater than 90%, i.e. w(f) > 0.9, and obtain f that meet the conditions by iterative approximation, and perform binarization on the image, which is shown in [Fig.9].

[0077] (2) Morphological denoising: perform the opening operation based on the image morphology, smooth the image profile, eliminate the narrow part and eliminate the thin protrusions, the result of the example being shown in [Fig. 10], and the formula being:

[0078] A<>B= (A'.B)®B

[0079] where, A is a binary image, B is a morphological model of the image, and ! and ® represent respectively the corrosion operation and the expansion operation in morphology.

[0080] (3) Area Filling: Fill the background of the image obtained by Denoising morphological of the white color, and fill the foreground with black color, the processing result being shown in [Fig.l 1].

[0081] (4) Socket profile matching: automatically limit the range of search according to the target of the laser rectangular projection profile, and establish a coordinate system, the steps being shown in [Fig. 12], including:

[0082] Step 3.1, calculate the slopes of the left and right sides of the socket profile target, if the slope of the left side and the slope of the right side are not equal to the slope of the image, exclude the current target from the profile, and if the slope of the left side and the slope of the right side are equal to the slope of the image, go to step 3.2;

[0083] Step 3.2, calculate the sampling slopes of the left and right sides of the socket profile target, if the sampling slopes are not equal to the image slope k, exclude the current profile, and if the sampling slopes are equal to the image slope k, consider the profile matching successful, and the final matching result being shown in [Fig. 13].

[0084] (5) Calculation of the central height of the socket: calculate the height in pixels of the center of the socket, by combining the pixel height and the actual height of the upper horizontal line and the lower horizontal line of the laser rectangular projection, and according to the principle of projection mapping, map it to the world coordinate system, to obtain the actual center height of the socket.

[0085] The calculation formula is:

[0086] H = W£ixh + LH^

[0087] where, H is the actual height of the object to be measured in the world coordinate system, LH^ is the actual height of the upper horizontal line of the laser rectangular projection in the world coordinate system, LH2 is the actual height of the lower horizontal line of the laser rectangular projection in the world coordinate system, h is the height in pixels of the intersection point of the connecting lines passing through the top point of the socket, h} is the height in pixels of the upper horizontal line of the laser rectangular projection and h2 is the height in pixels of the lower horizontal line of the laser rectangular projection.

[0088] Step 4, recording measurement data: recording a center height mark of the socket on the image and saving it as a table, and further providing a network interface for uploading the data to a server for saving.

[0089] The above embodiments are only illustrative, but not limiting, examples of embodiments. Those skilled in the art can propose any equivalent modifications or replacements within the scope of the present invention.

Claims

1. Claims Method for online measurement of the height of an object based on profile matching, characterized in that it comprises the following steps: Step 1, Image Acquisition: Fix two dual-line laser levels and cameras on a stand and acquire a single image containing a rectangular laser projection; Step 2, laser rectangular projection search: search for a laser rectangular projection profile in five steps: grayscale histogram stretching, adaptive binarization, area filling, morphological denoising, and laser rectangular projection profile matching; Step 3, searching for an object to be measured: in combination with the laser rectangular projection profile obtained in step 2, searching for an object to be measured in five steps: adaptive binarization, morphological denoising, area filling, profile matching of the object to be measured and calculation of the central height of the object to be measured; Step 4, recording measurement data: recording a center height mark of the object to be measured on the image and saving it as a table, and further providing a network interface for uploading the data to a server for saving; The matching of the laser rectangular projection profile in step 2 is carried out in the following steps, in which the laser rectangular projection is defined as a parallelogram: Step 2.1, initialization threshold N=0, sampling rate S=10%; Step 2.2, calculate the slopes of four sides of the laser rectangular projection profile target, if a slope difference of two pairs of opposite sides is not equal to N, exclude the current target from the profile, and if the slope difference of two pairs of opposite sides is equal to N, go to step 2.3; Step 2.3, sample the four sides of the laser rectangular projection profile target according to the S, respectively calculate a four-side sampling slope difference, if the difference is not equal to N, exclude the current target from the profile, and if the difference is equal to N, consider the profile matching successful; Step 2.4, if the number of targets of the rectangular projection profile laser targets that meet the conditions is equal to 0, do N+0.05, and return to step 2.2; if the number of profile targets that meet the conditions is greater than 1, do S+10%, and return to step 2.2 until the number of profile targets that meet the conditions is equal to 1; Step 2.5, calculate the image slope k, heights hl and h2 in pixels of the upper and lower sides of the laser rectangular projection profile and export a Z target of the laser rectangular projection profile.

2. A method for online measurement of the height of an object based on profile matching according to claim 1, characterized in that, the morphological denoising formula in step 2 is: AoB — ( A! B) ® B, where, A is a binary image, B is a morphological model of the image, and ! and ® respectively represent the corrosion operation and the expansion operation in morphology.

3. A method for online measurement of the height of an object based on profile matching according to claim 1, characterized in that, for the adaptive binarization operation in step 2, the foreground color represents a percentage less than 10%.

4. A method for online measurement of the height of an object based on profile matching according to claim 1, characterized in that, for the adaptive binarization operation in step 3, the foreground color represents a percentage greater than 90%.

5. A method for online measurement of the height of an object based on profile matching according to claim 1, characterized in that, for the profile matching of the object to be measured in step 3, the profile target is obtained in the same manner as that for the laser rectangular projection profile matching in step 2: Step 3.1, calculate the slopes of the left and right sides of the profile of the object to be measured, if the slope of the left side or the slope of the right side is not equal to the slope of the image, exclude the current target of the profile, and if the slope of the left side and the slope of the right side are equal to the slope of the image, proceed to step 3.2; Step 3.2, calculate the sampling slopes of the left and right sides, if the sampling slopes are not equal to the image slope, exclude the current profile, and if the sampling slopes are equal to the image slope, consider the profile matching successful.

6. Method for online measurement of the height of an object based on cor- profile matching according to claim 1, characterized in that the formula for calculating the central height of the object to be measured in step 3 is as follows: H = , LH where, H is the actual height of the object to be measured in the world coordinate system, LH} is the actual height of the upper horizontal line of the laser rectangular projection in the world coordinate system, LH2 is the actual height of the lower horizontal line of the laser rectangular projection in the world coordinate system, h is the height in pixels of the intersection point of the connecting lines passing through the vertex point of the object to be measured to the lower side of the laser rectangular projection profile, ùj is the height in pixels of the upper horizontal line of the laser rectangular projection and h2 is the height in pixels of the lower horizontal line of the laser rectangular projection.