Area measurement method based on probability statistics
By adopting a probabilistic statistics-based area measurement method in the aerospace field, using a monocular camera and auxiliary patterns for image processing and area calculation, the problem of difficult to achieve high precision and stability in the prior art is solved, and is especially suitable for irregular shapes. Target measurement.
Patent Information
- Application Number
- CN202411914914.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-02-18
AI Technical Summary
The existing optical imaging measurement technology has problems that high accuracy, stability and real-time requirements are difficult to meet in the aerospace field, especially when the shape of the measured target is irregular, the algorithm effect deteriorates or cannot be measured.
Using the area measurement method based on probability statistics, the known auxiliary patterns and the measured patterns are arranged in the same plane, and the images are acquired by taking pictures with ordinary monocular cameras. After mapping, preprocessing, grid processing and edge detection, the probability formula is used. Calculate the area of the pattern to be measured.
It realizes that the area of the measured pattern is measured with high precision without calibration of the camera's internal and external parameters, especially suitable for the goal of irregular shapes, and improves the stability and generalization ability of the measurement results.
Smart Images

Figure CN119478019A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of optical imaging, and in particular to an area measurement method based on probability statistics. Background Art
[0002] From the successful launch of Dongfanghong-1 to the successful launch of the Shenzhou series of spacecraft, and then to the operation of the Beidou series of satellites, the development of optical measurement has played a vital role behind this series of achievements; currently, with the increasing complexity and diversification of my country's space missions, there are higher requirements for measurement technology in the aerospace context: mainly high precision, stability and real-time performance. Obtaining the accurate area of the measured target is an important task in the field of optical imaging measurement in aviation missions; most of the current methods use geometric optical measurement, but this method needs to be implemented through binocular cameras or through monocular cameras plus laser ranging, such as using two cameras or binocular cameras to observe the target area at a certain spatial distance at the same time. By performing geometric calculations on the pixel coordinates of the target in the two images, the coordinates of the target point in three-dimensional space can be obtained, and the three-dimensional image can be used to obtain the target area. Point cloud data in space is used to calculate the area of the target area. For the method of monocular camera plus laser ranging, a laser beam is emitted by the laser rangefinder, and the coordinates in the three-dimensional coordinates are calculated by triangulation through the camera parameters and the distance information provided by the laser rangefinder. After repeated multiple times, multiple points in the target area are obtained to measure the area of the target area. The preparation process of the above method is complicated, and the internal and external parameters of the camera need to be calibrated at the same time. If the imaging equipment used has poor thermal stability, the internal and external parameters will cause large numerical changes due to temperature changes, affecting the final measurement results. In addition, the existing technology also requires the shape of the object to be measured to be relatively regular. For laser processing and similar fields, such as the ablation area formed by laser processing, the light source illumination area, etc., due to the irregular shape of the target to be measured, the algorithm effect is degraded or even cannot be measured.
[0003] In the prior art, the invention with publication number CN117990004A discloses a three-dimensional measurement method and system for a yarn strand based on a multi-camera system. The method obtains yarn images of the yarn strand taken by multiple cameras, determines the projection spacing of the yarn strand in the yarn image, and uses the camera shooting angle and the projection spacing to determine the size parameters of the yarn strand. Finally, the cross-sectional area content of the yarn strand is calculated. This method requires multiple cameras to complete the photography of the yarn strand at a certain angle, and calculates the cross-sectional area of the yarn strand by constructing a three-dimensional measurement system. There are problems such as using multiple cameras, complex shooting process, and many calculation parameters. The invention with publication number CN106468536A discloses a leaf area measurement method. The camera lens is positioned parallel to the reference baffle by a laser pen to ensure that the leaf surface remains unchanged. The camera takes pictures to obtain the leaf image and then performs leaf area analysis and leaf area calculation. This method requires the use of multiple laser pens for positioning to ensure that the camera lens angle is fixed, and there is a problem of complex shooting process. Summary of the invention
[0004] In order to overcome the shortcomings of the above-mentioned prior art, the purpose of the present invention is to propose an area measurement method based on probability statistics. After a known auxiliary pattern and a measured pattern are arranged in the same plane, an ordinary monocular camera is used to take pictures to obtain an image of the measured pattern, and the area of the measured pattern is obtained through a series of processing and calculation. This method has the advantages of simple process, less environmental influence, and strong generalization ability.
[0005] To achieve the above object, the technical solution of the present invention is:
[0006] A method for measuring area based on probability statistics comprises the following steps:
[0007] (1) construct auxiliary patterns of arbitrary regular shapes with known precise areas;
[0008] (2) placing the auxiliary pattern constructed in step (1) and the pattern to be measured on the same plane, and acquiring an image of the pattern to be measured and an image of the auxiliary pattern;
[0009] (3) mapping the measured pattern image and the auxiliary pattern image obtained in step (2) into a measured pattern front view and an auxiliary pattern front view respectively and performing preprocessing;
[0010] (4) gridding the front view of the pattern to be tested and the front view of the auxiliary pattern preprocessed in step (3);
[0011] (5) performing edge detection on the front view of the pattern to be tested and the front view of the auxiliary pattern that have been subjected to the gridding process in step (4);
[0012] (6) Calculate the area of the front view of the pattern to be detected after edge detection in step (5).
[0013] Furthermore, the measured pattern image and the auxiliary pattern image obtained in step (2) are achieved by taking photos with a camera.
[0014] Furthermore, in step (3), the measured pattern image and the auxiliary pattern image are mapped into a front view by using a perspective transformation or an affine transformation method, which mainly includes the following steps:
[0015] (3.1) Detecting feature points: Detecting common feature points in the pattern image to be tested, the auxiliary pattern image, and the corresponding front view. These feature points can be corner points, edges, or other significant image features.
[0016] (3.2) Calculating the transformation matrix: using the feature points detected in step (3.1), respectively calculating the transformation matrix from the measured pattern image and the auxiliary pattern image to the corresponding front view, specifically by perspective transformation or affine transformation;
[0017] (3.3) Apply transformation: Use the transformation matrix calculated in step (3.2) to map each pixel in the measured pattern image and the auxiliary pattern image to the corresponding position in the corresponding front view.
[0018] Furthermore, the preprocessing of the front view of the tested pattern and the front view of the auxiliary pattern in step (3) includes denoising and sharpening, and the preprocessed front view of the tested pattern and the front view of the auxiliary pattern are superimposed respectively.
[0019] Furthermore, the denoising adopts a wavelet semi-soft threshold denoising algorithm, and sets two thresholds T1 and T2. The threshold function is as follows:
[0020]
[0021] Among them, f T is the threshold function, W ij is the wavelet transform.
[0022] Furthermore, the sharpening process adopts the following method: using a histogram to equalize the image, eliminating the influence of unbalanced illumination, and obtaining an image with uniform brightness distribution; using a Laplace operator to sharpen the image, making the image edge details clear.
[0023] Furthermore, the edge detection in step (5) uses the Canny operator to perform edge detection, including the following steps:
[0024] (5.1) Noise suppression: Gaussian blur is performed on the image to obtain a blurred image to reduce the noise in the image. Gaussian blur uses convolution operation and is achieved by weighted averaging the neighborhood around each pixel.
[0025] (5.2) Calculating gradients: On the blurred image in step (5.1), using the Sobel operator to calculate the horizontal and vertical gradients of the blurred image to obtain a gradient image. The Sobel operator is a discrete differential operator used to detect edges in an image.
[0026] (5.3) Non-maximum suppression: Process the gradient image in step (5.2) to suppress non-maximum points to retain edge pixels corresponding to high gradient values. This can be done by comparing the gradient direction of each edge pixel and retaining the pixel at the peak position of the gradient direction.
[0027] (5.4) Double threshold processing: The pixels at the peak position of the gradient direction in step (5.3) are divided into three categories: strong edge, weak edge and non-edge. First, by defining a high threshold and a low threshold, the pixels with gradient values greater than the high threshold are marked as strong edges. Then, the pixels with gradient values between the low threshold and the high threshold are marked as weak edges, and it is checked whether they are connected to the strong edge. Finally, the pixels with gradient values lower than the low threshold are marked as non-edges.
[0028] (5.5) Edge connection: Connect the strong edge in step (5.4) with the adjacent weak edge pixels to form a connected edge.
[0029] Furthermore, the area of the front view of the pattern under test in step (6) is calculated using the following probability formula:
[0030]
[0031] Wherein, s is the area of the front view of the pattern under test, n is the number of grids occupied by the front view of the pattern under test after edge detection, N is the number of grids occupied by the front view of the auxiliary pattern after edge detection, and M is the original area of the auxiliary pattern.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] 1. The present invention only needs one monocular camera to complete the area measurement of irregular and regular patterns, without calibrating the internal and external parameters of the camera, and has extremely low requirements on the positional relationship between the pattern to be measured and the camera. While ensuring the accuracy of area measurement, the generalization ability of the algorithm in various environments is guaranteed, and the stability of the measurement results is greatly improved.
[0034] 2. The present invention has simple requirements for the auxiliary pattern and is easy to implement. Non-contact measurement can be achieved by simply calibrating the auxiliary pattern once, and it has excellent adaptability in spacecraft measurement, laser processing, etc.
[0035] 3. The present invention realizes the area measurement of the measured pattern by means of probability statistics, and quickly performs grid statistics on irregular patterns, thereby ensuring the accuracy of the algorithm.
[0036] In summary, the present invention arranges the known auxiliary pattern and the measured pattern in the same plane, uses an ordinary monocular camera to take pictures to obtain the measured pattern image and the auxiliary pattern image, and then obtains the measured pattern area through a series of mapping processing, preprocessing, gridding processing and edge detection, and then calculates through a probability formula. This method has the advantages of simple process, less environmental impact, strong generalization ability, etc., and can be widely used in spacecraft measurement, laser processing and other fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 is a flow chart of the steps of the method of the present invention;
[0038] Figure 2 The image of the pattern to be measured and the image of the auxiliary pattern captured by the embodiment of the present invention;
[0039] Figure 3 A schematic diagram of gridding a front view of a pattern under test provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0040] Combine the following Figures 1 to 3 The present invention is described in further detail.
[0041] A method for measuring area based on probability statistics comprises the following steps:
[0042] (1) constructing an auxiliary pattern of any regular shape with a known precise area. In actual use, the auxiliary pattern can be the table of the workpiece or a geometric shape planned in the target;
[0043] (2) placing the auxiliary pattern constructed in step (1) and the pattern to be measured on the same plane, and acquiring an image of the pattern to be measured and an image of the auxiliary pattern;
[0044] (3) mapping the measured pattern image and the auxiliary pattern image obtained in step (2) into a measured pattern front view and an auxiliary pattern front view respectively and performing preprocessing;
[0045] (4) gridding the front view of the pattern to be tested and the front view of the auxiliary pattern preprocessed in step (3), and gridding the image. The grids used can be of any polygonal shape, but all grids must have the same area and no gaps between grids.
[0046] (5) performing edge detection on the front view of the pattern to be tested and the front view of the auxiliary pattern that have been subjected to the gridding process in step (4);
[0047] (6) Calculate the area of the front view of the pattern to be detected after edge detection in step (5).
[0048] Furthermore, the acquisition of the measured pattern image and the auxiliary pattern image in step (2) is achieved by taking pictures with a camera, and the measured pattern and the auxiliary pattern can be in any angle relationship with the camera.
[0049] Furthermore, in step (3), the measured pattern image and the auxiliary pattern image are mapped into a front view using a perspective transformation or an affine transformation method, which mainly includes the following steps:
[0050] (3.1) Detecting feature points: Detecting common feature points in the pattern image to be tested, the auxiliary pattern image, and the corresponding front view. These feature points can be corner points, edges, or other significant image features.
[0051] (3.2) Calculating the transformation matrix: Using the feature points detected in step (3.1), respectively calculate the transformation matrix from the measured pattern image, the auxiliary pattern image to the corresponding front view, which is specifically achieved through perspective transformation or affine transformation.
[0052] (3.3) Apply transformation: Use the transformation matrix calculated in step (3.2) to map each pixel in the measured pattern image and the auxiliary pattern image to the corresponding position in the corresponding front view.
[0053] Furthermore, the preprocessing of the front view of the tested pattern and the front view of the auxiliary pattern in step (3) includes denoising and sharpening, and the preprocessed front view of the tested pattern and the front view of the auxiliary pattern are superimposed respectively.
[0054] Furthermore, the denoising adopts a wavelet semi-soft threshold denoising algorithm, and sets two thresholds T1 and T2. The threshold function is as follows:
[0055]
[0056] Among them, f T is the threshold function, W ij is the wavelet transform.
[0057] Furthermore, the sharpening process adopts the following method: using a histogram to equalize the image, eliminating the influence of unbalanced illumination, and obtaining an image with uniform brightness distribution; using a Laplace operator to sharpen the image, making the image edge details clear.
[0058] Furthermore, the edge detection in step (5) uses the Canny operator to perform edge detection, including the following steps:
[0059] (5.1) Noise suppression: Gaussian blur is performed on the image to obtain a blurred image to reduce the noise in the image. Gaussian blur uses convolution operation and is achieved by weighted averaging the neighborhood around each pixel.
[0060] (5.2) Calculating gradients: On the blurred image in step (5.1), using the Sobel operator to calculate the horizontal and vertical gradients of the blurred image to obtain a gradient image. The Sobel operator is a discrete differential operator used to detect edges in an image.
[0061] (5.3) Non-maximum suppression: Process the gradient image in step (5.2) to suppress non-maximum points to retain edge pixels corresponding to high gradient values. This can be done by comparing the gradient direction of each edge pixel and retaining the pixel at the peak position of the gradient direction.
[0062] (5.4) Double threshold processing: The pixels at the peak position of the gradient direction in step (5.3) are divided into three categories: strong edge, weak edge and non-edge. First, by defining a high threshold and a low threshold, the pixels with gradient values greater than the high threshold are marked as strong edges. Then, the pixels with gradient values between the low threshold and the high threshold are marked as weak edges, and it is checked whether they are connected to the strong edge. Finally, the pixels with gradient values lower than the low threshold are marked as non-edges.
[0063] (5.5) Edge connection: Connect the strong edge in step (5.4) with the adjacent weak edge pixels to form a connected edge.
[0064] Edge detection uses an edge detection operator to complete the first detection of the auxiliary pattern front view. After that, only the front view of the measured pattern needs to be edge detected. After the auxiliary pattern is initially calibrated, there is no need to perform secondary edge detection on the auxiliary pattern when the camera and the measured plane are stationary.
[0065] Furthermore, the area of the pattern under test in step (6) is calculated using the following probability formula:
[0066]
[0067] Wherein, s is the area of the pattern under test, n is the number of grids occupied by the front view of the pattern under test after edge detection, N is the number of grids occupied by the front view of the auxiliary pattern after edge detection, and M is the original area of the auxiliary pattern.
[0068] Example
[0069] The camera used is a 1024×1024 resolution camera, and the angle between the camera and the measured laser spot is unknown.
[0070] Based on the above basic structure, this embodiment performs the following operations:
[0071] (1) This time, a rectangular frame with known dimensions of 100 mm × 100 mm is used as the auxiliary pattern;
[0072] (2) This time, the laser illumination spot projected on a rectangular frame of 100 mm × 100 mm size is used as the measured pattern. A camera is used to take pictures of the laser illumination spot and the rectangular frame to obtain the following Figure 2 The image of the pattern under test and the image of the auxiliary pattern are shown;
[0073] (3) performing front view image mapping on the measured pattern image and the auxiliary pattern image obtained above to obtain a front view of the measured pattern and a front view of the auxiliary pattern respectively;
[0074] (4) De-noising and sharpening the front view of the measured pattern and the front view of the auxiliary pattern obtained above;
[0075] (5) Meshing the front view of the pattern to be measured and the front view of the auxiliary pattern after the above denoising and sharpening processing, such as Figure 3 As shown, the rectangular box is divided into 100×100 grids and labeled;
[0076] (6) performing edge detection on the front view of the pattern to be tested and the front view of the auxiliary pattern that have been subjected to the gridding process;
[0077] (7) By calculating the area of the front view of the pattern to be measured after the edge detection, the area of the original pattern to be measured is obtained: first, the number of grids occupied by the front view of the pattern to be measured after the edge detection is counted. According to the statistics, the number of grids of the pattern to be measured in this embodiment is 103. The area of the pattern to be measured is calculated by the above probability formula: s = (103 / (100×100))×(100mm×100mm) = 103mm 2 Since the light spot is uniform, the radius of the pattern being measured can be approximately calculated to be 5.73 mm.
Claims
1. An area measurement method based on probability statistics, characterized in that: The following steps are involved: (1) construct auxiliary patterns of arbitrary regular shapes with known precise areas; (2) placing the auxiliary pattern constructed in step (1) and the pattern to be measured on the same plane, and acquiring an image of the pattern to be measured and an image of the auxiliary pattern; (3) mapping the measured pattern image and the auxiliary pattern image obtained in step (2) into a measured pattern front view and an auxiliary pattern front view respectively and performing preprocessing; (4) gridding the front view of the pattern to be tested and the front view of the auxiliary pattern preprocessed in step (3); (5) performing edge detection on the front view of the pattern to be tested and the front view of the auxiliary pattern that have been subjected to the gridding process in step (4); (6) Calculate the area of the front view of the pattern to be detected after edge detection in step (5).
2. The area measurement method according to claim 1, characterized in that: The measured pattern image and the auxiliary pattern image obtained in step (2) are achieved by taking photos with a camera.
3. The area measurement method according to claim 1, characterized in that: Step (3) The measured pattern image and the auxiliary pattern image are mapped into a front view by using a perspective transformation or an affine transformation method, which mainly includes the following steps: (3.1) Detecting feature points: Detecting common feature points in the pattern image to be tested, the auxiliary pattern image, and the corresponding front view. These feature points can be corner points, edges, or other significant image features. (3.2) Calculating the transformation matrix: using the feature points detected in step (3.1), respectively calculating the transformation matrix from the measured pattern image and the auxiliary pattern image to the corresponding front view, specifically by perspective transformation or affine transformation; (3.3) Apply transformation: Use the transformation matrix calculated in step (3.2) to map each pixel in the measured pattern image and the auxiliary pattern image to the corresponding position in the corresponding front view.
4. The area measurement method according to claim 1, characterized in that: The preprocessing of the front view of the measured pattern and the front view of the auxiliary pattern in step (3) includes denoising and sharpening, and the preprocessed front view of the measured pattern and the front view of the auxiliary pattern are superimposed respectively.
5. The area measurement method according to claim 4, characterized in that: The denoising adopts the wavelet semi-soft threshold denoising algorithm, sets two thresholds T1 and T2, and the threshold function is as follows: Among them, f T is the threshold function, W ij is the wavelet transform.
6. The area measurement method according to claim 4, characterized in that: The sharpening process adopts the following method: using a histogram to equalize the image, eliminating the influence of unbalanced illumination, and obtaining an image with uniform brightness distribution; using a Laplace operator to sharpen the image, making the image edge details clear.
7. The area measurement method according to claim 1, characterized in that: The edge detection in step (5) uses the Canny operator to perform edge detection, including the following steps: (5.1) Noise suppression: Gaussian blur is performed on the image to obtain a blurred image to reduce the noise in the image. Gaussian blur uses convolution operation and is achieved by weighted averaging the neighborhood around each pixel. (5.2) Calculating gradients: On the blurred image in step (5.1), using the Sobel operator to calculate the horizontal and vertical gradients of the blurred image to obtain a gradient image. The Sobel operator is a discrete differential operator used to detect edges in an image. (5.3) Non-maximum suppression: Process the gradient image in step (5.2) to suppress non-maximum points to retain edge pixels corresponding to high gradient values. This can be done by comparing the gradient direction of each edge pixel and retaining the pixel at the peak position of the gradient direction. (5.4) Double threshold processing: The pixels at the peak position of the gradient direction in step (5.3) are divided into three categories: strong edge, weak edge and non-edge. First, by defining a high threshold and a low threshold, the pixels with gradient values greater than the high threshold are marked as strong edges. Then, the pixels with gradient values between the low threshold and the high threshold are marked as weak edges, and it is checked whether they are connected to the strong edge. Finally, the pixels with gradient values lower than the low threshold are marked as non-edges. (5.5) Edge connection: Connect the strong edge in step (5.4) with the adjacent weak edge pixels to form a connected edge.
8. The area measurement method according to claim 1, characterized in that: The area of the front view of the pattern under test in step (6) is calculated using the following probability formula: Wherein, s is the area of the front view of the pattern under test, n is the number of grids occupied by the front view of the pattern under test after edge detection, N is the number of grids occupied by the front view of the auxiliary pattern after edge detection, and M is the original area of the auxiliary pattern.
Citation Information
Patent Citations
Leaf area measuring method
CN106468536A
Yarn evenness three-dimensional measurement method and system based on multi-camera system
CN117990004A
Automatic leaf area measurement system based on multivariate normal distribution statistics and level set variation method
CN111553943A