A method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping

Through a monocular camera method based on four-point five-line calibration mapping, combined with Gaussian projection and five-line constraint algorithm, the limitations of satellite remote sensing technology in monitoring the area of ​​harmful aquatic plants are solved, and accurate and low-cost calculation of aquatic plants is achieved.

CN118229762BActive Publication Date: 2025-04-22SHANGHAI UBIQUITOUS NAVIGATION TECHNOLOGYCO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410357642.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-27
Publication Date
2025-04-22
Estimated Expiration
2044-03-27

AI Technical Summary

Technical Problem

Existing satellite remote sensing technologies have limitations in monitoring the area of ​​harmful aquatic plants, including weather-affected, low image resolution, difficult and high cost of post-processing of data.

Method used

The real area calculation method of monocular camera based on four-point five-line calibration mapping is adopted. By detecting the homographic matrix and area ratio, combining Gaussian projection and five-line constraint algorithm, the actual physical area calculation of pixel blocks in the image is realized.

Benefits of technology

This method achieves stable, reliable, fast convergence area calculation, accurate results, reduce costs, is suitable for the field of water ecological monitoring, and can accurately give the physical area of ​​aquatic plants.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118229762B_ABST
    Figure CN118229762B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping, which specifically includes the following steps: S1, it is necessary to first detect whether there is a homography matrix h that can map the cyanobacteria in the image to the Gaussian projection plane, and the ratio r of the actual area to the area in the Gaussian projection. After obtaining the homography matrix h and the ratio r, it is only necessary to input the polygon coordinates surrounding the cyanobacteria area into the algorithm to deduce the actual area of ​​the cyanobacteria. The present invention relates to the technical field of reasoning and calculation of the physical area of ​​aquatic plants. The method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping has a stable and reliable algorithm, fast convergence, and accurate results. The ingenious combination of computer technology and mathematical knowledge ensures the reliability of the algorithm and improves the work efficiency of regional monitoring. The calculation results obtained by the algorithm are post-processed, and timely notification can be made before the cyanobacteria reach too large an area. The deployment of the algorithm is simple and the cost is low.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of aquatic plant physical area reasoning calculation, and in particular to a monocular camera real area calculation method based on four-point five-line calibration mapping. Background Art

[0002] With the rapid development of computer technology and the increasing attention paid to water ecology in my country, the area control of cyanobacteria, water hyacinth or other harmful aquatic plants has received unprecedented attention. It is particularly important to avoid excessive growth of harmful aquatic plants and damage the water ecological environment. In existing technologies, satellite remote sensing technology is usually used to monitor the scale of harmful aquatic plants. Satellite remote sensing technology refers to the technology of using sensors carried by artificial satellites to detect, record and analyze natural and human phenomena on the surface of the earth from space. Although satellite remote sensing technology can capture data on the scale of harmful aquatic plants, it still has certain limitations. First, satellite remote sensing is greatly affected by weather. When blocked by clouds, fog or water vapor, the image quality will be reduced or imaging will not be possible. Second, the image resolution is low, and it is difficult to identify detailed features. Third, data post-processing is difficult, requiring professional knowledge and skills, and the threshold for employment is high. Fourth, the cost of satellites is high, requiring a lot of funds and human resources.

[0003] Using surveillance cameras and edge computers to monitor the scale of harmful aquatic plants can obtain more significant features, and the calculation process and output data results are easy to understand, while the cost is low. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention provides a method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping, which solves the problems mentioned in the above background technology.

[0005] To achieve the above objectives, the present invention is implemented by the following technical solutions: a method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping, specifically comprising the following steps:

[0006] S1. It is necessary to first detect whether there is a homography matrix h that can map the cyanobacteria in the image to the Gaussian projection plane, as well as the ratio r of the actual area to the area in the Gaussian projection. After obtaining the homography matrix h and the ratio r, it is only necessary to input the coordinates of the polygon surrounding the cyanobacteria area into the algorithm to calculate the actual area of ​​the cyanobacteria.

[0007] S2. If the homography matrix h and the area ratio r do not exist, the matrix and the ratio need to be calculated in advance. First, two sets of coordinate systems are established: the first is a two-dimensional coordinate system based on the image, and the coordinates of the points in the image coordinate system are represented by their pixel positions; the second is a Gaussian plane rectangular coordinate system based on the Gaussian projection of the actual plane of the area in the image, and the point coordinates are represented by the latitude and longitude of the point converted into two-dimensional xy coordinates;

[0008] S3. Then find four points [a, b, c, d] in the image coordinates and four corresponding points [e, f, g, h] in the Gaussian projection. At this time, if the five-line length of the quadrilateral is input into the algorithm, the five-line method can be used to constrain the shape of the quadrilateral efgh and optimize the coordinate accuracy of e, f, g, h.

[0009] S4. Then, normalize e, f, g, and h to reduce the quadrilateral efgh to e'f'g'h'. Then, calculate the area ratio r of the actual quadrilateral efgh and the image area e'f'g'h' and save it. At the same time, calculate the homography matrix h of abcd and e'f'g'h'.

[0010] Beneficial Effects

[0011] The present invention provides a method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping. Compared with the prior art, it has the following beneficial effects:

[0012] The real area calculation method of the monocular camera based on the four-point five-line calibration mapping is stable and reliable, converges quickly, and has accurate results. The clever combination of computer technology and mathematical knowledge ensures the reliability of the algorithm and improves the work efficiency of regional monitoring. The calculation results obtained by the algorithm can be post-processed to timely report before the blue algae reach a large area. The deployment of the algorithm is simple and low-cost. Compared with satellite remote sensing technology, it requires lower costs, lower equipment requirements, and more accurate results. The four-point homography matrix transformation is used to map and transform the image coordinates and GPS plane coordinates to realize the algorithm for calculating the actual physical area of ​​the pixel block in the image, overcoming the physical limitations of the monocular camera in terms of distance, area, etc. In order to accurately give the exact position of the four physical points, a five-line constraint algorithm is proposed. The five-line algorithm realizes the relationship constraints of the four mapping points, eliminates GPS positioning errors, and accurately constrains the pixel correspondence between the image quadrilateral and the GPS plane coordinate polygon. When reasoning about the area calculation, the image polygon is mapped to the GPS plane polygon using the calibrated homography matrix, and the physical area reasoning is realized according to the proportional area. It is particularly suitable for the field of water ecological monitoring and can realize the inference calculation of the physical area of ​​aquatic plants. BRIEF DESCRIPTION OF THE DRAWINGS

[0013] Figure 1 It is the algorithm flow chart of the present invention;

[0014] Figure 2 It is the Gauss Kruger projection and Gauss plane rectangular coordinate system diagram of the present invention;

[0015] Figure 3 A possible set diagram of the error range of the present invention B;

[0016] Figure 4 A possible set diagram of the error range of C of the present invention;

[0017] Figure 5 Schematic diagram of coordinates in the image of the present invention;

[0018] Figure 6 This is a viewing angle diagram of the Gaussian projection of the present invention. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0020] See also Figure 1-6 The present invention provides the following technical solution: a method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping, specifically comprising the following steps:

[0021] S1. It is necessary to first detect whether there is a homography matrix h that can map the cyanobacteria in the image to the Gaussian projection plane, as well as the ratio r of the actual area to the area in the Gaussian projection. After obtaining the homography matrix h and the ratio r, it is only necessary to input the coordinates of the polygon surrounding the cyanobacteria area into the algorithm to calculate the actual area of ​​the cyanobacteria.

[0022] S2. If the homography matrix h and the area ratio r do not exist, the matrix and the ratio need to be calculated in advance. First, two sets of coordinate systems are established: the first is a two-dimensional coordinate system based on the image, and the coordinates of the points in the image coordinate system are represented by their pixel positions; the second is a Gaussian plane rectangular coordinate system based on the Gaussian projection of the actual plane of the area in the image, and the point coordinates are represented by the latitude and longitude of the point converted into two-dimensional xy coordinates;

[0023] S3. Then find four points [a, b, c, d] in the image coordinates and four corresponding points [e, f, g, h] in the Gaussian projection. At this time, if the five-line length of the quadrilateral is input into the algorithm, the five-line method can be used to constrain the shape of the quadrilateral efgh and optimize the coordinate accuracy of e, f, g, h.

[0024] S4. Then normalize e, f, g, and h (to avoid excessively large values ​​that are not conducive to calculation), reduce the quadrilateral efgh to e'f'g'h', and then calculate the area ratio r of the actual quadrilateral efgh and the image area e'f'g'h' and save it. At the same time, calculate the homography matrix h of abcd and e'f'g'h'.

[0025] In the actual application of the algorithm, it relies on a surveillance camera with a fixed viewing angle, the longitude and latitude of four points within the monitoring range, the straight-line distance between the four points, and an edge computer. The surveillance camera is responsible for real-time monitoring of the changes in the scale of cyanobacteria in the area and transmitting it to the edge computer for processing. The longitude and latitude of the four points and the straight-line distance between the four points need to be manually measured with the help of equipment. After saving the calculated homography matrix and area ratio, the edge computer can use other artificial intelligence algorithms to predict or manually provide cyanobacteria coordinates to calculate the cyanobacteria area. In this way, the cyanobacteria area data of the monitoring area can be accurately controlled.

[0026] The core of the algorithm is the clever application of Gauss-Krüger projection, five-line constrained quadrilateral and homography matrix.

[0027] Gauss Krüger projection: Since the surface of the earth is curved, not flat, it is necessary to map the actual area into a plane projection in order to obtain rigorous calculation results. To this end, the Gauss projection can be used to project the actual area into a plane projection. On the projection plane, the projections of the central meridian and the equator are both straight lines, and the intersection o of the central meridian and the equator is used as the coordinate origin, the projection of the central meridian is used as the ordinate x-axis, and the projection of the equator is used as the abscissa y-axis. The Gauss plane rectangular coordinate system is established, and the coordinate units are converted from longitude and latitude to meters.

[0028] Five-line method: Since the device has errors in obtaining the longitude and latitude of the four points, the coordinates of the four points in the Gaussian projection also have errors. In order to compensate for the errors caused by the equipment, the length of the four sides and one diagonal side of the quadrilateral can be used to constrain the shape of the quadrilateral to improve the accuracy of the four-point coordinates. Assume that there are four points A (x1, y1), B (x2, y2), C (x3, y3), D (x4, y4) of the actual area projection in the Gaussian projection, and the actual lengths AB = l1, BC = l2, CD = l3, DA = l4, AC = l5 measured by the tool. First, assuming that there is no error in the coordinates of point A, correct B, C, and D. As follows Figure 3As shown: the blue area is the error range, draw a circle with A as the center and l1 as the radius, and the points on the arc where the circle intersects with the blue range are the possible point set of B and p. Similarly, the possible point set of D can be obtained q. The second step is to traverse the set p, draw a circle with each possible point as the center and l2 as the radius, and the points on the arc where each circle intersects with the error range of C belong to the possible point set o of C. Similarly, the set q can also generate a second possible point set t within the error range of C. Finally, find a point in the intersection of set t and set o that is closest to l5 to A, and correct B and D according to point A and the corrected C.

[0029] Homography matrix: Since the image perspective presented by the monitoring device is not a bird's-eye view, the objects in the image are distorted compared to the objects in the Gaussian projection. Therefore, the image needs to be corrected and the image perspective is converted to a bird's-eye view, that is, the image is mapped to the Gaussian projection. To this end, the homography matrix can be used to represent the transformation relationship between the image and the Gaussian projection. Assume that there is a coordinate point in the image Corresponding homogeneous coordinates There are corresponding coordinate points in the Gauss projection Corresponding homogeneous coordinates Then the homography matrix H satisfies:

[0030]

[0031] Since a homogeneous coordinate system is used, H has only 8 degrees of freedom, so h9 is set to 1, and the calculation and arrangement can be obtained:

[0032] h1u1+h2v1+h3-h7u1u2-h8v1u2=u2

[0033] h4u1+h5v1+h6-h7u1v2-h8v1v2=v2

[0034] Arranged into a matrix:

[0035]

[0036] It can be found that to solve the 8 unknowns of the homography matrix H, 4 pairs of corresponding coordinate points in the image and Gaussian projection are required.

[0037] Ratio of projection area to actual plane area: Since the coordinate values ​​of the points in Gaussian projection are often too large, in order to reduce the burden on the computer and improve the efficiency of the algorithm, the coordinates of the four points converted from longitude and latitude are normalized so that the values ​​of the new coordinates are maintained in [0,1], and the ratio of the area enclosed by the initial four points to the area enclosed by the new four points is calculated as the ratio of the projection area to the actual area.

[0038] Experimental results:

[0039] The calculation result of the algorithm shows that the area of ​​the plane (p1, p1-1, p2-1, p2) is 171.34m 2 The actual area is about 178.88m 2 , the accuracy reaches 95.78%; the area calculation result of the plane (p1, p2-1, p3-1, p2) is 220.11m 2 , the actual area is about 206.32m 2 , the accuracy reaches 93.73%; the area calculation result of the plane (p2, p2-1, p3-1, p3) is 190.76m 2 , the actual area is about 176.64m 2 ,The accuracy reaches 92.60%. In general, the algorithm accuracy can be above 90%, with high credibility.

[0040] Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.

[0041] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so 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 also includes elements inherent to such process, method, article or device.

[0042] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for calculating the real area of ​​a monocular camera based on four-point five-line calibration mapping, characterized in that: The specific steps include: S1. It is necessary to first detect whether there is a homography matrix h that can map the cyanobacteria in the image to the Gaussian projection plane, as well as the ratio r of the actual area to the area in the Gaussian projection. After obtaining the homography matrix h and the ratio r, it is only necessary to input the coordinates of the polygon surrounding the cyanobacteria area into the algorithm to calculate the actual area of ​​the cyanobacteria. S2. If the homography matrix h and the area ratio r do not exist, the matrix and the ratio need to be calculated in advance. First, two sets of coordinate systems are established: the first is a two-dimensional coordinate system based on the image, and the coordinates of the points in the image coordinate system are represented by their pixel positions; the second is a Gaussian plane rectangular coordinate system based on the Gaussian projection of the actual plane of the area in the image, and the point coordinates are represented by the latitude and longitude of the point converted into two-dimensional xy coordinates; S3. Then find four points [a, b, c, d] in the image coordinates and four corresponding points [e, f, g, h] in the Gaussian projection. At this time, if the five-line length of the quadrilateral is input into the algorithm, the five-line method can be used to constrain the shape of the quadrilateral efgh and optimize the coordinate accuracy of e, f, g, h. S4, then normalize e, f, g, h to reduce the quadrilateral efgh to e'f'g'h', then calculate the area ratio r of the actual quadrilateral efgh and the image area e'f'g'h' and save it, and at the same time, calculate the homography matrix h of abcd and e'f'g'h'; The five-line method in step S3 includes the following steps: constraining the shape of the quadrilateral using the lengths of the four sides and one diagonal side of the quadrilateral to improve the accuracy of the four-point coordinates; assuming that there are four points A, B, C, and D of the actual area projection in the Gaussian projection, and the actual lengths AB, BC, CD, DA, and AC measured by the tool, assuming that there is no error in the coordinates of point A, correcting B, C, and D; drawing a circle with A as the center and AB as the radius, and taking the points on the arc line where the circle intersects with the error range as the possible point set of B and p; similarly, the possible point set of D can be obtained q; Then traverse the set p, draw a circle with each possible point as the center and BC as the radius. Each point on the arc that intersects the error range of C belongs to the possible point set o of C. Similarly, the set q can also generate a second possible point set t within the error range of C. Finally, find a point in the intersection of set t and set o that is closest to AC, and correct B and D according to point A and the corrected C.

Citation Information

Patent Citations

  • Camera Surveillance Area Calculation Method and System

    CN102279974A

  • Projector array for multiple images

    US20120099081A1