Projection-assisted monocular camera ranging method
By fixing the point projector and monocular camera on the mechanical platform, using the distance relationship fit between the receiving plane and the camera, the problems of poor distance measurement accuracy of monocular camera and complex binocular camera calculation are solved, achieving high accuracy and low cost and real-time measurement of monocular camera ranging method.
Patent Information
- Application Number
- CN202410983095.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-08
AI Technical Summary
The existing monocular camera ranging method has poor accuracy, and the binocular or multi-eye visual ranging calculation is complex and difficult to achieve real-time performance, resulting in high cost and large calculation amount.
Using the point-assisted monocular camera distance measurement method, the point-aper and monocular camera are fixedly installed on the mechanical platform, and the receiving plane perpendicular to the camera's optical axis is set, image data is obtained and relationship fitted, reducing equipment costs and Calculate the amount of real-time measurement.
It improves ranging accuracy and adaptability, reduces equipment cost and calculation amount, and enables real-time measurements in complex scenarios.
Smart Images

Figure CN118913204A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distance measurement and calculation, and in particular to a point-projection-assisted monocular camera distance measurement method. Background Art
[0002] At present, there are two main methods of using vision to measure distance. One is the monocular camera ranging method. This algorithm relies on a specific ruler, such as the actual size of a specific target, the height of the camera, etc. A specific ruler is placed at the position to be measured, and the target depth is calculated by the principle of similar triangles. This method is easily affected by external interference and has poor accuracy. The other is binocular or multi-eye vision ranging. Although this method does not rely on a specific ruler, it is difficult to achieve real-time performance due to the complexity of the calculation model and the long algorithm running time. Summary of the invention
[0003] Aiming at the problems of high cost and poor precision of the existing machine vision ranging method, the present invention proposes a monocular camera ranging method assisted by projecting a point. Firstly, a projector and a monocular camera are fixedly installed on a calibrated mechanical platform, a receiving plane perpendicular to the optical axis of the camera is arranged in the field of view of the monocular camera, an image captured by the monocular camera is obtained, and the distance from the center of the circle to the center of the image and the distance from the receiving plane to the monocular camera are obtained; the distance from the receiving plane to the monocular camera is changed, and several groups of recorded data are obtained and fitted to obtain the relationship between the distance between the receiving plane and the camera and the distance between the center of the projected point and the center of the image, and the distance between the position to be measured and the monocular camera is obtained according to the relationship, so as to reduce the equipment cost of machine vision ranging, reduce the amount of calculation while ensuring high precision, and perform real-time measurement.
[0004] The specific implementation contents of the present invention are as follows: A method for measuring distance with a monocular camera using a point projection aid comprises the following steps: Step 1: The projector and the monocular camera are fixedly mounted on a calibrated mechanical platform, a receiving plane perpendicular to the optical axis of the camera is arranged within the field of view of the monocular camera, and the coordinates of the monocular camera and the receiving plane on the mechanical platform are taken as the initial coordinates; Step 2: Obtain the image captured by the monocular camera, fit the center of the circle, calculate the distance from the center of the circle to the center of the image, and record the distance D1 from the center of the circle to the center of the image and the distance L1 from the receiving plane to the monocular camera; Step 3: Change the distance from the receiving plane to the monocular camera, recalculate the distance from the center of the circle to the center of the image, and record the distance D2 from the center of the circle to the center of the image and the distance L2 from the receiving plane to the monocular camera. Step 4: Repeat steps 2 to 3 to obtain several groups of recorded data, fit the recorded data according to the least squares method, obtain the relationship between the distance between the receiving plane and the camera and the distance between the center of the projected circle and the center of the image, and obtain the distance between the position to be measured and the monocular camera according to the relationship.
[0005] In order to better implement the present invention, further, when installing the projector and the monocular camera in step 1, the optical axis of the projector is parallel to the optical axis of the monocular camera, and the distance between the optical axis of the projector and the optical axis of the monocular camera is fixed.
[0006] In order to better implement the present invention, further, the projection point of the projection device is a single circular point, and the center of the single circular point is on the optical axis of the projection device.
[0007] In order to better implement the present invention, further, before measuring the distance to be measured, the distance to be measured is equivalent to a number of line segments, the monocular camera is installed at the endpoints of the line segments, and the lens direction of the monocular camera is directed toward the endpoint where the monocular camera is not installed.
[0008] In order to better implement the present invention, further, in step 2, obtaining the image captured by the monocular camera specifically includes the following operations: first, obtaining the intersection position of the optical axis of the monocular camera and the image plane, performing image denoising, image segmentation, feature extraction, and center fitting on the image captured by the monocular camera, obtaining the position of the center of the circle in the image, and calculating the distance between the intersection of the optical axis of the monocular camera and the image plane and the center of the circle.
[0009] In order to better implement the present invention, further, the relationship between the distance between the receiving plane and the camera in step 4 and the distance between the center of the projected circle and the center of the image is: D 测 =aD 投 +b; Among them, Dmeasured is the distance between the position to be measured and the monocular camera, Dcast is the distance between the receiving plane and the monocular camera, and a and b are fitting constants.
[0010] In order to better implement the present invention, further, the plurality of groups of recorded data are recorded in at least 200 groups.
[0011] The present invention has the following beneficial effects: (1) The present invention can adjust the size, color and brightness of the dots according to the actual situation of the position to be measured. Compared with the existing monocular camera measurement with a fixed scale, it has stronger adaptability and can adapt to complex and changing application scenarios; (2) Compared with the complex calculation model of the existing binocular camera distance measurement, the method of calculating the distance to be measured of the present invention has a fast calculation speed and can perform real-time measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 It is a flowchart of a method for measuring distance with a monocular camera with the aid of a point projection provided by an embodiment of the present invention.
[0013] Figure 2 It is a schematic diagram of the measurement principle of the point-projection-assisted monocular camera ranging method provided in an embodiment of the present invention.
[0014] Among them, 1. The movable trajectory of the optical axis of the projector, 2. The image plane, 3. The position to be measured, 4. The throwing circle of the projector, 5. The optical axis of the projector, 6. The optical axis of the monocular camera, and 7. The receiving plane. DETAILED DESCRIPTION
[0015] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. It should be understood that the described embodiments are only part of the embodiments of the present invention, not all of the embodiments, and therefore should not be regarded as limiting the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technical personnel in this field without making creative work are within the scope of protection of the present invention.
[0016] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "disposed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0017] Embodiment 1: This embodiment provides a method for measuring distance with a monocular camera using a point projection aid, which specifically includes the following steps: Step 1: The projector and the monocular camera are fixedly mounted on a calibrated mechanical platform, a receiving plane 7 perpendicular to the optical axis 6 of the monocular camera is arranged in the field of view of the monocular camera, and the coordinates of the monocular camera and the receiving plane 7 on the mechanical platform are taken as the initial coordinates; When installing the projector and the monocular camera in step 1, the optical axis of the projector is parallel to the optical axis of the monocular camera, and the distance between the optical axis of the projector and the optical axis of the monocular camera is fixed.
[0018] Furthermore, the projection point of the projector is a single circular point, and the center of the single circular point is on the optical axis of the projector.
[0019] Step 2: Obtain the image captured by the monocular camera, fit the center of the throwing circle 4 of the thrower, calculate the distance from the center to the center of the image, and record the distance D1 from the center to the center of the image and the distance L1 from the receiving plane 7 to the monocular camera.
[0020] In step 2, obtaining the image captured by the monocular camera specifically includes the following operations: first, obtaining the intersection position of the monocular camera optical axis 6 and the image plane 2, performing image denoising, image segmentation, feature extraction, and center fitting on the image captured by the monocular camera, obtaining the position of the center of the circle in the image, and calculating the distance between the intersection point of the monocular camera optical axis 6 and the image plane 2 and the center of the circle.
[0021] Step 3: Change the distance from the receiving plane 7 to the monocular camera, recalculate the distance from the center of the circle to the center of the image, and record the distance D2 from the center of the circle to the center of the image and the distance L2 from the receiving plane 7 to the monocular camera. Step 4: Repeat steps 2-3 to obtain several groups of recorded data, fit the recorded data according to the least squares method, obtain the relationship between the distance between the receiving plane 7 and the camera and the distance between the center of the circle and the center of the image, and obtain the distance between the measured position 3 and the monocular camera based on the relationship.
[0022] Furthermore, the plurality of groups of recorded data include at least 200 groups.
[0023] The relationship between the distance between the receiving plane 7 and the camera in step 4 and the distance between the center of the projected circle and the center of the image is: D 测 =aD 投 +b; Among them, D 测 is the distance between the position to be measured 3 and the monocular camera, D 投 is the distance between the receiving plane 7 and the monocular camera, and a and b are fitting constants.
[0024] Furthermore, before measuring the distance to be measured, the distance to be measured is equivalent to a number of line segments, the monocular camera is installed at the endpoints of the line segments, and the lens direction of the monocular camera is directed toward the endpoint where the monocular camera is not installed.
[0025] Working principle: In this embodiment, a point projector and a monocular camera are first fixedly mounted on a calibrated mechanical platform, a receiving plane 7 perpendicular to the camera optical axis 6 is provided in the field of view of the monocular camera, and the image captured by the monocular camera is obtained to obtain the distance from the center of the circle to the center of the image and the distance from the receiving plane 7 to the monocular camera; the distance from the receiving plane 7 to the monocular camera is changed to obtain several groups of recorded data and fit them to obtain the relationship between the distance between the receiving plane 7 and the camera and the distance between the center of the projected circle and the center of the image, and the distance between the position to be measured 3 and the monocular camera is obtained according to the relationship, thereby reducing the equipment cost of machine vision ranging, reducing the amount of calculation while ensuring high accuracy, and enabling real-time measurement.
[0026] Embodiment 2: This embodiment is based on the above embodiment 1. Figure 1 , Figure 2 As shown, detailed description is given in conjunction with the accompanying drawings.
[0027] In view of the high cost and poor accuracy of existing machine vision distance measurement methods, this embodiment provides a point-casting-assisted monocular camera distance measurement method, such as Figure 1 As shown, the method includes the following steps: step 1: installing a monocular camera and a point projector; step 2: projecting a point to the position to be measured 3; step 3: image acquisition; step 4: image processing; step 5: distance calculation. The method can reduce the equipment cost of machine vision distance measurement, has high accuracy, and has the characteristics of small calculation amount, and can be used for real-time measurement.
[0028] Step 1: Install the monocular camera and the projector. During installation, ensure that the optical axis 5 of the projector is parallel to the optical axis 6 of the monocular camera. The projector can rotate around the monocular camera. The distance between the optical axis 5 of the projector and the optical axis 6 of the monocular camera is fixed. The point projected by the projector is a single circular point with the center on the optical axis 5 of the projector.
[0029] Step 2: Cast a dot at the position to be measured 3. The size, color and brightness of the dot can be adjusted when casting the dot, so that the dot of the circle 4 thrown by the dot caster is clear and complete in the field of view of the monocular camera.
[0030] Step 3: Image acquisition: use a monocular camera to capture the image of the position 3 to be measured.
[0031] Step 4: Image processing. First, obtain the intersection position of the monocular camera optical axis 6 and the image plane 2. Perform image denoising, image segmentation, feature extraction, center fitting and other processing on the image taken by the monocular camera to obtain the position of the center of the point throwing circle 4 of the projector in the image. Calculate the distance from the intersection point of the monocular camera optical axis 6 and the image plane 2 to the center of the point throwing circle 4 of the projector, which is used to calculate the distance between the measured position 3 and the camera.
[0032] Step 5: Distance calculation The calculation formula is obtained by the following method: The installed monocular camera and the dot thrower are placed on a calibrated mechanical platform and fixed. A plane 6 perpendicular to the optical axis of the monocular camera is set in the field of view of the monocular camera to receive the dots of the dot thrower circle 4. The coordinates of the monocular camera and the receiving plane 7 on the platform are recorded as the initial coordinates; Use a projector to project points onto the plane and use a monocular camera to capture images; Process the collected image, fit the center of the throwing circle 4 of the dot thrower, obtain the distance from the center to the center of the image through the algorithm, and record the distance D1 from the center of the throwing circle 4 of the dot thrower to the center of the image and the distance L1 from the receiving plane 7 to the monocular camera; Changing the distance between the receiving plane 7 and the monocular camera, projecting points onto the receiving plane 7 with a projector, and collecting images with the monocular camera; Process the collected image, fit the center of the throwing circle 4 of the dot thrower, obtain the distance from the center to the center of the image through the algorithm, and record the distance D2 from the center of the throwing circle 4 of the dot thrower to the center of the image and the distance L2 from the receiving plane 7 to the monocular camera; Repeat the above operation to form at least 200 sets of data. The recorded data are fitted by the least square method to obtain the relationship between the distance between the receiving plane 7 and the camera and the distance between the center of the dot throwing circle 4 of the dot thrower and the center of the image, as follows.
[0033] D 测 =aD 投 +b; Where D 测 is the distance between the position to be measured 3 and the monocular camera, D 投 is the distance between the receiving plane 7 and the monocular camera, and a and b are constants obtained after fitting.
[0034] The conventional monocular camera measurement scale is fixed and difficult to adapt to complex and changeable application scenarios. The auxiliary measurement tool of this embodiment can be adjusted according to the actual situation of the position 3 to be measured and has strong adaptability.
[0035] The core calculation formula of this embodiment is only a linear equation of one variable. Compared with the complex calculation model of traditional binocular camera ranging, it has a fast calculation speed and can perform real-time measurement.
[0036] The other parts of this embodiment are the same as those of the above-mentioned embodiment 1, and thus will not be described in detail.
[0037] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any simple modification or equivalent change made to the above embodiment based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for measuring distance with a monocular camera using a point projection aid, characterized in that: The specific steps include: Step 1: The projector and the monocular camera are fixedly mounted on a calibrated mechanical platform, a receiving plane (7) perpendicular to the optical axis (6) of the monocular camera is arranged within the field of view of the monocular camera, and the coordinates of the monocular camera and the receiving plane (7) on the mechanical platform are used as initial coordinates; Step 2: Obtain an image captured by the monocular camera, fit the center of the throwing circle (4) of the pointer, calculate the distance from the center to the center of the image, and record the distance D1 from the center to the center of the image and the distance L1 from the receiving plane (7) to the monocular camera; Step 3: changing the distance from the receiving plane (7) to the monocular camera, recalculating the distance from the center of the circle to the center of the image, and recording the distance D2 from the center of the circle to the center of the image and the distance L2 from the receiving plane (7) to the monocular camera; Step 4: Repeat steps 2 and 3 to obtain several groups of recorded data, fit the recorded data according to the least square method, obtain the relationship between the distance between the receiving plane (7) and the camera and the distance between the center of the circle and the center of the image, and obtain the distance between the position to be measured (3) and the monocular camera according to the relationship.
2. The method for measuring distance using a monocular camera with the aid of a projection point according to claim 1, characterized in that: When installing the projector and the monocular camera in step 1, the optical axis (5) of the projector is parallel to the optical axis (6) of the monocular camera, and the distance between the optical axis (5) of the projector and the optical axis (6) of the monocular camera is fixed.
3. The method for measuring distance using a monocular camera with the aid of a projection point according to claim 2, characterized in that: The projection point of the projection device is a single circular point, and the center of the single circular point is on the optical axis (5) of the projection device.
4. The method for measuring distance using a monocular camera with the aid of a projection point according to claim 1, characterized in that: Before measuring the position to be measured (3), the distance to be measured of the position to be measured (3) is equivalent to a number of line segments, the monocular camera is installed at the endpoints of the number of line segments, and the lens direction of the monocular camera is directed toward the endpoint where the monocular camera is not installed.
5. The method for measuring distance with a monocular camera using a point projection aid according to claim 1, characterized in that: The step 2 of acquiring the image captured by the monocular camera specifically includes the following operations: firstly, acquiring the intersection position of the monocular camera optical axis (5) and the image plane (2); performing image denoising, image segmentation, feature extraction, and center fitting on the image captured by the monocular camera; then acquiring the position of the center of the circle in the image; and calculating the distance between the intersection point of the monocular camera optical axis (6) and the image plane (2) and the center of the circle.
6. The method for measuring distance using a monocular camera with the aid of a projection point according to claim 1, characterized in that: The relationship between the distance between the receiving plane (7) and the monocular camera in step 4 and the distance between the center of the circle and the center of the image is: D 测 =aD 投 +b; Among them, D 测 is the distance between the position to be measured (3) and the monocular camera, D 投 is the distance between the receiving plane (7) and the monocular camera, and a and b are fitting constants.
