Binocular and multi-view-based displacement measurement method, device, equipment, medium and product
By compensating the subpixel offset between the main camera and the subcamera, the misjudgment problem of displacement monitoring caused by thermal expansion and contraction of the internal structure of the equipment in the prior art is solved, and a higher displacement monitoring accuracy is achieved.
Patent Information
- Application Number
- CN202510152884.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2045-02-12
AI Technical Summary
The existing displacement monitoring technology lacks effective compensation methods due to the thermal expansion and contraction of the internal structure of the equipment.
In the state where the main camera and the sub-camera are connected to each other, the sub-pixel offset corresponding to the main camera is compensated by using the sub-pixel offset corresponding to the main camera to be monitored, and the displacement amount and direction of the object to be monitored are determined.
It improves the accuracy of displacement monitoring, effectively avoids misjudgment of the displacement of the monitoring target, and enhances the accuracy of determining the displacement amount and direction of the object to be monitored.
Smart Images

Figure CN119618081A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of displacement monitoring technology, and in particular to a binocular and multi-camera displacement measurement method, device, equipment, medium and product. Background Art
[0002] Displacement monitoring is an important means to understand the safety status of structures and changes in deformation trends. Accurately monitoring the displacement of structural objects with safety hazards can facilitate timely detection of dangers and reduce the occurrence of safety accidents.
[0003] Existing displacement monitoring methods mainly rely on fixed monitoring equipment, which captures images of targets on the monitored object, determines the offset of the target based on the image of the target, and then determines the displacement of the monitored object. However, once the fixed position of the monitoring device changes (such as vibration) or is affected by temperature, the internal structure of the device will expand and contract, causing the monitoring device to move, thereby causing the captured monitoring image to move, which will lead to misjudgment of the displacement of the monitored target. Summary of the invention
[0004] The present invention provides a binocular and multi-camera displacement measurement method, device, equipment, medium and product, so as to achieve the state that when a main camera and a sub-camera are connected to each other, the sub-pixel offset corresponding to the sub-camera is used to compensate the sub-pixel offset corresponding to the main camera, so as to determine the displacement size and direction of the object to be monitored, thereby improving the accuracy of displacement monitoring.
[0005] According to one aspect of the present invention, a binocular and multi-camera displacement measurement method is provided, the method comprising:
[0006] Acquire a main image corresponding to the object to be monitored shot by a main camera, and a sub-image corresponding to a first object shot by at least one sub-camera connected to the main camera; wherein the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera;
[0007] Based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target is determined, and based on the sub-image and a predetermined sub-target reference image, a second sub-pixel offset of the sub-target is determined; wherein the main target reference image is based on an initial frame taken by the main camera for the main target; and the sub-target reference image is based on an initial frame taken by the sub-camera for the sub-target;
[0008] Correcting the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target;
[0009] Based on the physical size of the main target, the main target reference image, camera deployment properties and the target sub-pixel offset, the displacement magnitude and direction of the object to be monitored are determined.
[0010] According to another aspect of the present invention, a binocular and multi-camera displacement measurement device is provided, the device comprising:
[0011] An image acquisition module, used to acquire a main image corresponding to the object to be monitored shot by a main camera, and a sub-image corresponding to a first object shot by at least one sub-camera connected to the main camera; wherein the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera;
[0012] a first sub-pixel offset determination module, configured to determine a first sub-pixel offset of the main target based on the main image and a predetermined main target reference image, and to determine a second sub-pixel offset of the sub-target based on the sub-image and a predetermined sub-target reference image; wherein the main target reference image is based on an initial frame shot by the main camera at the main target; and the sub-target reference image is based on an initial frame shot by the sub-camera at the sub-target;
[0013] a target sub-pixel offset determination module, configured to correct the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target;
[0014] The displacement determination module is used to determine the displacement size and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset.
[0015] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0016] at least one processor; and a memory in communication with the at least one processor; wherein,
[0017] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the binocular and multi-camera displacement measurement method described in any embodiment of the present invention.
[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the binocular and multi-camera displacement measurement method described in any embodiment of the present invention when executed.
[0019] According to another aspect of the present invention, a computer program product is provided, including a computer program, which, when executed by a processor, implements the binocular and multi-camera displacement measurement method as described in any embodiment of the present invention.
[0020] The technical solution of the embodiment of the present invention is to obtain a main image corresponding to the object to be monitored based on a main camera, and a sub-image corresponding to the first object based on at least one sub-camera connected to the main camera; the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target is determined, and based on the sub-image and a predetermined sub-target reference image, a second sub-pixel offset of the sub-target is determined; wherein the main target reference image is an initial frame based on the main camera shooting the main target; the sub-target reference image is an initial frame based on the sub-camera shooting the sub-target; the first sub-pixel offset is corrected based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target. Displacement; based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset, the displacement size and direction of the monitored object are determined, which solves the problem of misjudgment of the deformation of the monitored target due to thermal expansion and contraction of the internal structure of the equipment in the prior art, and realizes that when the main camera and the sub-camera are connected to each other, the first sub-pixel offset of the main target is determined by the main image and the predetermined main target reference image, and the second sub-pixel offset of the sub-target is determined by the sub-image and the predetermined sub-target reference image. The first sub-pixel offset corresponding to the sub-camera is used to compensate the second sub-pixel offset corresponding to the main camera to obtain the target sub-pixel offset of the main target, thereby improving the accuracy of the offset determination, thereby improving the accuracy of the displacement size and direction of the monitored object, and effectively avoiding the misjudgment of the displacement of the monitored target.
[0021] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is a flow chart of a binocular and multi-camera displacement measurement method provided according to Embodiment 1 of the present invention;
[0024] Figure 2 is a schematic diagram for representing the connection structure of a main camera and a sub-camera provided according to the first embodiment of the present invention;
[0025] Figure 3 is a schematic diagram for representing the connection structure of a main camera and a sub-camera provided according to the first embodiment of the present invention;
[0026] Figure 4 is a schematic diagram for representing the connection structure of a main camera and a sub-camera provided according to the first embodiment of the present invention;
[0027] Figure 5 is a schematic diagram for representing the connection structure of a main camera and a sub-camera provided according to the first embodiment of the present invention;
[0028] Figure 6 is a schematic diagram for representing the connection structure of a main camera and a sub-camera provided according to the first embodiment of the present invention;
[0029] Figure 7 is a schematic diagram for representing the head-up state of a main camera provided according to the first embodiment of the present invention;
[0030] Figure 8 is a schematic diagram for representing the upward-looking state of a main camera provided according to the first embodiment of the present invention;
[0031] Fig. 9 is a schematic diagram for representing a top-down state of a main camera provided according to Embodiment 1 of the present invention;
[0032] Fig.10 This is a flow chart of a binocular and multi-camera displacement measurement method provided according to the second embodiment of the present invention;
[0033] Fig.11 This is a schematic diagram of the structure of a binocular and multi-camera displacement measurement device provided according to Embodiment 3 of the present invention;
[0034] Fig.12 It is a structural schematic diagram of an electronic device for implementing a binocular and multi-eye displacement measurement method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme 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. 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 should fall within the scope of protection of the present invention.
[0036] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0037] Embodiment 1
[0038] Figure 1 This is a flow chart of a binocular and multi-eye displacement measurement method provided according to the first embodiment of the present invention. This embodiment is applicable to the case of displacement monitoring of the object to be detected. The method can be performed by a binocular and multi-eye displacement measurement device. The binocular and multi-eye displacement measurement device can be implemented in the form of hardware and / or software. The binocular and multi-eye displacement measurement device can be configured in a computing device. Figure 1 As shown, the method includes:
[0039] S110, acquiring a main image corresponding to the object to be monitored taken by a main camera, and a sub-image corresponding to the first object taken by at least one sub-camera connected to the main camera; the object to be monitored includes the main target; the first object includes the sub-target.
[0040] Among them, the object to be monitored may be an object for which displacement monitoring is required, for example, the object to be monitored may be various buildings and structures, such as dams, tunnels, bridges, etc.; or slopes, rivers or roads, etc. The first object is an object with a fixed position and a stable structure, that is, the position of the first object in space is fixed, and it will not move or change position, and will not be deformed or damaged; that is, the position of the sub-target on the first object is assumed to be unchanged. The main camera and the sub-camera may be fixedly connected together by a physical connection method, such as screw fixing, clamp fixing, and magnetic fixing. That is, the main camera and the sub-camera constitute an integral device, and the shooting field of the sub-camera changes with the shooting field of the main camera. The shooting field of view may refer to the range of scenes that can be captured by the camera lens. It can be understood that when the position of the main camera moves, its shooting field of view will change, and accordingly, the position of the sub-camera will move with the position of the main camera, and the shooting field of the sub-camera will change. The main camera is used to capture the overall image or partial image of the object to be monitored. The sub-camera is used to capture the overall image or partial image of the first object. The main target is installed at the displacement monitoring part of the object to be monitored, and the sub-target is installed on the first object, and the installation method can be threaded installation, plug-in installation or adhesive installation, etc. The geometric shapes of the main target and the sub-target can be circular, square, elliptical or other geometric shapes.
[0041] In practical applications, the positions of the main camera and the sub-camera may be fixed, and the main camera is used to collect images of the main target on the object to be monitored, and the sub-camera is used to collect images of the sub-target on the first object. The main image corresponding to the object to be monitored taken by the main camera at the same time and the sub-image corresponding to the first object taken by at least one sub-camera connected to the main camera may be obtained in real time or periodically, so as to comprehensively determine whether the object to be monitored is deformed based on the main image and the sub-image.
[0042] For example, see Figures 2 to 6 The main camera and the sub-camera are a master-sub-camera as a whole. Of course, the structure of the main-sub-camera includes but is not limited to Figures 2 to 6 The structural form shown. The main camera and the sub-camera can be placed back to back or in the same direction. Multiple main and sub-cameras are deployed at preset positions, and multiple main targets are deployed on each displacement monitoring part of the object to be monitored, and multiple sub-targets are deployed on the first object. When deploying the main and sub-cameras, the shooting field of view of the main camera in the main and sub-cameras includes the main target; the shooting field of view of the sub-camera in the main and sub-cameras includes the sub-target, so that the main camera can capture a main image including the main target, and the sub-camera can capture a sub-image including the sub-target. The main image and sub-image with the same timestamp are obtained for displacement monitoring of the object to be monitored.
[0043] S120: Determine a first sub-pixel offset of the main target based on the main image and a predetermined main target reference image, and determine a second sub-pixel offset of the sub-target based on the sub-image and a predetermined sub-target reference image.
[0044] The main target reference image is based on the initial frame shot by the main camera at the main target, that is, it refers to the image of the main target of the monitored object that is first photographed when the initial shooting angle of the main camera does not change and the monitored object does not deform, and the main target reference image includes the main target. The sub-target reference image is based on the initial frame shot by the sub-camera at the sub-target, that is, it refers to the image of the sub-target of the first object that is first photographed when the initial shooting angle of the sub-camera does not change, and the sub-target reference image includes the sub-target.
[0045] It is understandable that when the main camera moves or the monitored object is deformed, the main camera's field of view changes, and there will be a certain difference between the position information of the main target in the main image and the position information of the main target in the main target reference image. This difference is the first sub-pixel offset. The sub-pixel offset can be used to characterize the position change of the object at the sub-pixel level in the image.
[0046] In this embodiment, the main target position information in the main image and the position information corresponding to the main target in the main target reference image can be subjected to difference processing to obtain the sub-pixel offset of the main target in the horizontal direction and the vertical direction as the first sub-pixel offset. At the same time, the sub-target position information in the sub-image and the position information corresponding to the sub-target in the sub-target reference image can be subjected to difference processing to obtain the sub-pixel offset of the sub-target in the horizontal direction and the vertical direction as the second sub-pixel offset.
[0047] S130 , correcting the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target.
[0048] In this embodiment, the first sub-pixel offset can be corrected based on the second sub-pixel offset of the sub-target to obtain the corrected target sub-pixel offset. The specific implementation method can be: input the second sub-pixel offset into the main-sub camera calibration model to obtain the estimated sub-pixel movement offset corresponding to the main camera; based on the estimated sub-pixel movement offset, correct the first sub-pixel offset to obtain the target sub-pixel offset of the main target.
[0049] Among them, the estimated sub-pixel movement offset can be the sub-pixel offset that should be theoretically generated when the main camera shoots the main target when the second sub-pixel offset is generated when the sub-camera shoots the sub-target. The first sub-pixel offset refers to the sub-pixel offset actually generated when the main camera shoots the main target. The main-sub camera calibration model is determined based on the correlation between the pixel offset of the main camera and the pixel offset of the sub-camera. It can be understood that the position of the sub-camera moves with the position movement of the main camera; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera. Conversely, the position of the main camera will also move with the position movement of the sub-camera; the shooting field of view of the main camera will also change with the shooting field of view of the sub-camera. In other words, the pixel offset of the sub-camera shooting the sub-target will change with the pixel offset of the main camera shooting the main target, and the pixel offset of the main camera shooting the main target will change with the pixel offset of the sub-camera shooting the sub-target. Since the main and sub-cameras are the same device, if the sub-camera image is offset, the main camera image will also be offset accordingly. The specific offset can be realized through the main and sub-camera calibration model. The main and sub-cameras are located in the same temperature environment. If the temperature changes, the internal structure of the main and sub-cameras may expand and contract due to thermal expansion, and the images of the main and sub-cameras will drift in temperature, and the objects in the images will be offset. The specific offset relationship can be realized through the main and sub-camera calibration model.
[0050] Based on this, the second sub-pixel offset can be used as the input of the main-sub camera calibration model to output the estimated sub-pixel movement offset corresponding to the main camera. Furthermore, the first sub-pixel offset and the estimated sub-pixel movement offset can be difference processed, that is, the first sub-pixel offset minus the estimated sub-pixel movement offset, and the difference is used as the target sub-pixel offset of the main target. The advantage of this setting is that when the main camera and the sub-camera are connected to each other, the sub-pixel offset corresponding to the sub-camera is used to compensate the sub-pixel offset corresponding to the main camera to determine the displacement size and direction of the object to be monitored, which can effectively avoid the misjudgment of the displacement of the monitored object caused by thermal expansion and contraction of the internal structure of the main and sub-cameras.
[0051] For example, the main and sub-cameras (including the main camera and sub-camera) can be placed in the same temperature and lighting environment for calibration. The main target and sub-target are fixed in the calibration state. During calibration, the main and sub-cameras can be moved to consider the three situations of the main camera looking horizontally, looking up, and looking down. Figure 7 As shown, when the main camera is in the horizontal state, the distance between the main camera and the main target is , the distance between the sub-camera and the sub-target is ;like Figure 8 and Fig. 9 As shown in Figure 2, when the main camera is looking up or looking down, the distance between the main camera and the main target is , the distance between the sub-camera and the sub-target is ; is the angle between the main sub-camera and the horizontal plane. The main sub-camera calibration model can be constructed with the sub-camera pixel offset as the independent variable and the main camera pixel offset as the dependent variable. For example, the main sub-camera calibration model can be expressed as: ; Among them, X S and Y S are respectively represented as the sub-pixel offset in the horizontal direction and the sub-pixel offset in the vertical direction in the second sub-pixel offset; X M and Y M They are respectively represented as the sub-pixel offset in the horizontal direction and the sub-pixel offset in the vertical direction in the target sub-pixel offset. and Represents the objective function in the main camera calibration model. The objective function includes but is not limited to first-order linear function, n-order polynomial, nonlinear function and neural network function.
[0052] S140, determining the displacement size and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment attributes, and the target sub-pixel offset.
[0053] Among them, physical size can refer to the actual physical quantity of the main target, such as length, radius, diameter, circumference, etc. Camera deployment attributes can refer to relevant information about the deployment of the main camera and sub-camera, such as camera focal length, camera resolution, camera deployment position, camera deployment orientation, camera deployment viewing angle, distance between camera and target, angle between camera and horizontal plane, positional relationship between main camera and sub-camera, etc. Displacement measurement includes the measurement of object deformation and the monitoring of the direction of object movement. For example, deformation can refer to the change in shape or volume of an object under the action of force, such as bending, torsion, stretching, compression or other types of deformation. Direction can include tilt, subsidence and rise, etc.
[0054] In this embodiment, the target sub-pixel offset can be converted into an actual physical quantity, such as length, by combining the physical size of the main target and the main target reference image; the actual physical quantity is used as the actual deformation of the object to be monitored. The displacement size and direction of the object to be monitored can be determined based on the camera deployment attributes and the actual physical quantity.
[0055] In this embodiment, the displacement magnitude and direction of the object to be monitored are determined based on the physical size of the main target, the main target reference image, the camera deployment properties, and the target sub-pixel offset, including: determining conversion parameters based on the physical size of the main target and the second circle attribute corresponding to the main target in the main target reference image; determining the actual offset based on the conversion parameters and the target sub-pixel offset; determining the displacement magnitude and direction of the object to be monitored based on the camera deployment properties and the actual offset.
[0056] Among them, the second circle attribute is used to characterize the theoretical position information of the main target in the image taken by the main camera. The second circle attribute may include the circle radius, circle diameter, circle center position of the main target in the main target reference image, and the position of one or some marking points on the main target. The actual offset includes the current actual offset in the horizontal direction and the current actual offset in the vertical direction. The current actual offset in the horizontal direction is used to characterize the horizontal movement at the main target position, and the current actual offset in the vertical direction is used to characterize the vertical movement at the main target position.
[0057] Specifically, the ratio between the physical size of the main target and the pixel value of the circle diameter in the second circle attribute can be used as a conversion parameter; then, the target sub-pixel offset and the conversion parameter can be multiplied to obtain the actual offset. Furthermore, the camera deployment attribute and the actual offset can be combined to determine the displacement size and direction of the monitored object.
[0058] The technical solution provided by the embodiment of the present invention is to obtain a main image corresponding to the object to be monitored based on a main camera, and a sub-image corresponding to the first object based on at least one sub-camera connected to the main camera; the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target is determined, and based on the sub-image and a predetermined sub-target reference image, a second sub-pixel offset of the sub-target is determined; wherein the main target reference image is an initial frame based on the main camera shooting the main target; the sub-target reference image is an initial frame based on the sub-camera shooting the sub-target; the first sub-pixel offset is corrected based on the second sub-pixel offset to obtain a target sub-pixel of the main target. Offset; based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset, the displacement size and direction of the monitored object are determined, which solves the problem of misjudgment of the deformation of the monitored target due to thermal expansion and contraction of the internal structure of the equipment in the prior art, and realizes that when the main camera and the sub-camera are connected to each other, the first sub-pixel offset of the main target is determined by the main image and the predetermined main target reference image, and the second sub-pixel offset of the sub-target is determined by the sub-image and the predetermined sub-target reference image. The first sub-pixel offset corresponding to the sub-camera is used to compensate the second sub-pixel offset corresponding to the main camera to obtain the target sub-pixel offset of the main target, thereby improving the accuracy of the offset determination, thereby improving the accuracy of the displacement size and direction determination of the monitored object, and effectively avoiding the misjudgment of the deformation of the monitored target.
[0059] Embodiment 2
[0060] Fig.10 This is a flow chart of a binocular and multi-eye displacement measurement method provided according to the second embodiment of the present invention. On the basis of the above embodiment, S120 is further refined. The specific implementation method can refer to the technical solution of this embodiment. Among them, the technical terms that are the same or corresponding to the above embodiment are not repeated here.
[0061] like Fig.10 As shown, the method specifically comprises the following steps:
[0062] S210, acquiring a main image corresponding to the object to be monitored taken by a main camera, and a sub-image corresponding to the first object taken by at least one sub-camera connected to the main camera; the object to be monitored includes a main target; the first object includes a sub-target.
[0063] S220, performing circle fitting based on first pixel attributes of multiple pixel points in the main image to obtain first circle attributes of the main target fitting circle.
[0064] Among them, the first pixel attribute includes but is not limited to color, brightness, transparency, position, contrast, saturation, color temperature, and various types of pixel information such as texture, gradient, and depth. The main target fitting circle may refer to a circle obtained by performing circle fitting on the first pixel attributes of multiple pixels in the main image. The main target fitting circle may be used to characterize the size and proportion of the main target in the main image. The first circle attributes include but are not limited to the diameter, radius, center position of the main target fitting circle, and the position of one or more marking points on the main target, etc.
[0065] In this embodiment, the first pixel attributes of the pixels in the main image can be analyzed using the least squares method, the Hough transform algorithm, the RANSAC (Random Sample Consensus) algorithm, etc., to obtain a circle as the main target fitting circle, and determine the first circle attribute of the main target fitting circle. Alternatively, an interpolation algorithm, such as Lagrange interpolation, bilinear interpolation, or cubic spline interpolation, can be used to insert new points between known pixels in the main image, construct a circle contour, obtain the main target fitting circle, and extract the first circle attribute of the main target fitting circle. The advantage of performing circle fitting based on the interpolation algorithm is that the accuracy of circle fitting can be improved when the pixel points are unevenly distributed or there are few data points. Alternatively, the main target in the main image can be identified, and a circle fitting is performed according to the first pixel attribute of the pixel point corresponding to the main target to obtain the main target fitting circle.
[0066] In order to improve the accuracy of displacement monitoring, the main image and sub-image can also be pre-processed before circle fitting, such as image enhancement processing, to suppress the difference in influence of different light changes on the main image and sub-image, and obtain enhanced main image and sub-image.
[0067] In this embodiment, circle fitting is performed based on the first pixel attributes of multiple pixels in the main image to obtain the first circle attribute of the main target fitting circle, including: processing the first pixel attribute of each pixel in the main image to obtain a grayscale image; filtering the grayscale image to obtain an image to be edge detected; performing edge detection on the image to be edge detected, and determining at least one potential circular edge point from multiple pixels in the image to be edge detected; performing circle fitting on the position information of at least one potential circular edge point based on the least squares method to obtain the first circle attribute of the main target fitting circle.
[0068] The first pixel attribute at least includes color. The color can be represented by different combinations of red, green, and blue (RGB). The image to be edge detected can be an image obtained by filtering a grayscale image.
[0069] In this embodiment, the first pixel attribute of each pixel in the main image can be weighted by using a conversion formula, and the color of the pixel can be converted into a grayscale value, thereby converting the main image into a grayscale image. Then, the grayscale image can be filtered using a filtering algorithm to obtain an image to be edge detected. Optionally, the filtering algorithm includes but is not limited to limiting filtering, median filtering, mean filtering, Gaussian filtering, wavelet transform filtering, Kalman filtering, adaptive filtering, minimum mean square filtering, etc. Further, a pre-trained edge detection model can be used to process the second pixel attribute of each pixel in the image to be edge detected, extract the edge contour in the image to be edge detected, and use the pixel points on the edge contour as potential circular edge points. Among them, the second pixel attribute includes at least grayscale information and position information. Optionally, the edge detection model can be a model based on Roberts operator, a model based on Sobel operator, a model based on Prewitt operator, a model based on Laplacian operator, a model based on Log / Marr operator, and a model based on Canny operator. The multiple potential circular edge points screened out are approximately distributed on a circle. The least square method can be used to perform circle fitting based on the position information of multiple potential circle edge points to obtain the first circle attribute of the main target fitting circle, such as the center and radius.
[0070] Exemplarily, the conversion formula can be expressed as: I = a ×R + b×G + c×B; where I represents the grayscale value of the pixel, which is a single-channel brightness value; R, G, and B represent the red, green, and blue components of the pixel, respectively (the value range is 0~255); a, b, and c are weighted coefficients based on the user's visual sensitivity to different color components, such as a=0.299, b=0.587, and c=0.114.
[0071] Specifically, the method for obtaining the image to be edge detected can be: for each pixel in the grayscale image, the position information of the pixel in the grayscale image can be processed based on a Gaussian filter of a two-dimensional Gaussian distribution function to obtain the Gaussian weight of the pixel. Then, the Gaussian weight and grayscale value of the pixel are weighted to obtain the grayscale information corresponding to the pixel. Accordingly, the grayscale information corresponding to each pixel can be obtained. The grayscale information corresponding to the neighborhood pixels within the preset neighborhood of the pixel can also be determined. The grayscale information corresponding to the neighborhood pixels can be averaged to obtain the average value, and the grayscale information corresponding to the pixel can be updated based on the average value. Further, the grayscale information corresponding to each pixel is combined to obtain the image to be edge detected.
[0072] Exemplarily, the two-dimensional Gaussian distribution function can be expressed as: G(x, y) = (1 / 2πσ²) exp(- (x² + y²) / 2σ²); where (x, y) represents the two-dimensional coordinates of the pixel; G(x, y) represents the Gaussian weight of the pixel; σ is the standard deviation, which controls the smoothness of the Gaussian filter; exp is an exponential function.
[0073] The technical solution of this embodiment is to obtain the image to be detected by edge by converting the main image into a grayscale image and filtering the grayscale image, thereby improving the efficiency of circle fitting. Then, edge detection is performed on the image to be detected, and at least one potential circular edge point is determined from multiple pixel points in the image to be detected. Then, circle fitting is performed on the position information of at least one potential circular edge point based on the least squares method to obtain the first circle attribute of the main target fitting circle, thereby improving the accuracy of circle fitting and the accuracy of displacement monitoring of the monitored object.
[0074] In this embodiment, edge detection is performed on an image to be edge detected, and at least one potential circular edge point is determined from a plurality of pixels in the image to be edge detected, including: performing a convolution operation on the image to be edge detected and a preset operator matrix to obtain a gradient of each pixel in the image to be edge detected, and determining a gradient amplitude of the pixel based on the gradient of the pixel; determining the pixel as a strong edge point when the gradient amplitude of the pixel satisfies a preset strong edge condition, and determining the pixel as a weak edge point when the gradient amplitude of the pixel satisfies a preset weak edge condition; if a strong edge point is included in a preset neighborhood corresponding to the weak edge point, updating the weak edge point to a strong edge point; and determining a potential circular edge point from the strong edge points and the candidate edge points based on preset circle information.
[0075] Among them, the preset operator matrix can be a Sobel operator matrix. There are two groups of matrices in the preset operator matrix, one group is a horizontal detection matrix (one column of elements in the matrix is 0), and the other group is a vertical detection matrix (one row of elements in the matrix is 0). The gradient of the pixel point can be used to characterize the change of the grayscale of the pixel point, and can be used to reflect the strength of the edge. For example, for the edge part of the image, its grayscale value changes greatly and the gradient is also large. For the relatively smooth part of the image, its grayscale value changes less and the corresponding gradient is also smaller. The gradient amplitude of the pixel point can be used to characterize the speed and size of the change of the grayscale of the pixel point. Generally speaking, the larger the amplitude, the more drastic the grayscale change of the pixel point, and the more likely it is an edge or contour in the image. The preset neighborhood can be used to characterize the surrounding area of the pixel point. For example, the preset neighborhood can be a rectangle (the side length can be customized), such as a 3×3 rectangle; or, the preset neighborhood can be a circle (the radius can be customized), such as a circle with a radius of m. The preset strong edge condition can be a condition for determining whether a pixel point is a strong edge point. The preset weak edge condition may be a condition for determining whether a pixel point is a weak edge point. It should be noted that a weak edge point may be a true edge point or a point caused by noise or color change. In order to obtain an accurate circular edge point result, the weak edge points caused by the latter should be removed.
[0076] In this embodiment, the image to be edge detected is convolved with the horizontal detection matrix and the vertical detection matrix in the preset operator matrix to obtain a horizontal gradient matrix after horizontal edge detection and a vertical gradient matrix after horizontal edge detection. Among them, the horizontal gradient matrix includes the gradient of each pixel in the image to be edge detected in the horizontal direction; the vertical gradient matrix includes the gradient of each pixel in the vertical direction. For each pixel in the image to be edge detected, the gradient of the same pixel in the horizontal direction and the vertical direction can be squared respectively, and then the sum of the two square values is squared, and the obtained value can be used as the gradient amplitude of the pixel. Further, it can be judged whether the gradient amplitude of the pixel meets the preset strong edge condition. Optionally, the preset strong edge condition can be that the gradient amplitude is greater than the preset amplitude. If the gradient amplitude of the pixel is greater than the preset amplitude, the pixel is determined to be a strong edge point. Otherwise, it is judged whether the gradient amplitude of the pixel meets the preset weak edge condition. Optionally, the preset weak edge condition can be that the gradient amplitude is within a preset range, such as the upper limit value of the preset range can be the preset amplitude. If the gradient amplitude of a pixel point is within a preset range, the pixel point is determined to be a weak edge point. If the gradient amplitude of a pixel point is less than the lower limit of the preset range, the pixel point can be ignored and not processed. Furthermore, for each weak edge point, the preset neighborhood corresponding to the weak edge point can be determined with the weak edge point as the center, and the pixels located in the preset neighborhood are regarded as other pixels. It is determined whether the other pixels contain strong edge points. If so, the weak edge point is used as a candidate edge point. If not, the weak edge point is ignored and considered to be noise and not processed. Furthermore, the preset circle information can be combined to determine whether the strong edge point and the candidate edge point are potential edge points on the circumference, that is, potential circular edge points.
[0077] Exemplarily, the calculation formula for determining the gradient amplitude of a pixel point can be expressed as: ;in, and are the gradients of the pixel in the horizontal and vertical directions respectively; represents the gradient magnitude of the pixel. Furthermore, for each pixel (x, y), if its gradient magnitude satisfies the preset strong edge condition (G> T high ), then mark the pixel as a strong edge point; for each pixel (x, y), if its gradient amplitude meets the preset strong edge condition (T low < G ≤ T high ), then the pixel is marked as a weak edge point; where G represents the gradient amplitude; T high Indicates the preset amplitude, that is, the upper limit of the preset range; T lowis the lower limit of the preset range. Further, check whether each weak edge point is connected to at least one strong edge point in its 8-Neighbors (i.e., the preset neighborhood). If there is a strong edge point in the 8-neighbors of the weak edge point, the weak edge point is retained and marked as a candidate edge point. If there is no strong edge point in the 8-neighbors of the weak edge point, the weak edge point is suppressed as a non-edge point.
[0078] In this embodiment, after performing a convolution operation on the image to be edge detected and a preset operator matrix to obtain the gradient of each pixel in the image to be edge detected, the gradient angle of the pixel can be determined based on the gradient of the pixel; when the gradient angle of the pixel is an angle in the preset angle, the first pixel adjacent to the pixel is determined from the image to be edge detected based on the gradient angle and position information of the pixel; when the gradient amplitude of the pixel is less than the gradient amplitude of the first pixel adjacent to it, the gradient amplitude of the pixel is updated to a preset threshold to determine whether the updated gradient amplitude of the pixel satisfies the preset strong edge condition or the preset weak edge condition.
[0079] The gradient angle refers to the gradient direction of the pixel, that is, the direction of grayscale change of the pixel. If the gradient angle is equal to zero, it means that the pixel has a vertical edge, and the left side is darker than the right side. The preset angle may include one or more, for example, the preset angle may be 0 degrees (i.e. horizontal direction), 45 degrees (i.e. diagonal direction from the upper right to the lower left), 90 degrees (i.e. vertical direction), 135 degrees (i.e. diagonal direction from the upper left to the lower right). The preset threshold may be 0.
[0080] In this embodiment, the gradient of the pixel point in the horizontal direction and the gradient in the vertical direction can be processed as a quotient to obtain a quotient value; the arctangent value of the quotient value is determined using an inverse tangent function, and the inverse tangent value can be used as the gradient angle of the pixel point. If the gradient angle of the pixel point is any of the preset angles, the first neighborhood point and the second neighborhood point along the gradient angle can be determined based on the gradient angle and position information of the pixel point; the pixel point on the line segment between the first neighborhood point and the second neighborhood point in the image to be edge detected is used as the first pixel point. Further, if the gradient amplitude of the pixel point is less than the gradient amplitude of the first pixel point adjacent to it, the gradient amplitude of the pixel point is updated to a preset threshold value, that is, the gradient amplitude of the pixel point is suppressed to zero. After updating the gradient amplitude of the pixel point, it can be determined whether the pixel point meets the preset strong edge condition or the preset weak edge condition based on the updated gradient amplitude corresponding to the pixel point.
[0081] Exemplarily, the calculation formula for determining the gradient angle of a pixel point can be expressed as: ;in, and are the gradients of the pixel in the horizontal and vertical directions respectively; Indicates the gradient angle of the pixel; Represents the inverse tangent function. For a pixel point (x, y), if its gradient magnitude G(x, y) is not greater than the adjacent pixel point (i.e., the first pixel point) along the gradient angle, the pixel point is adjusted to zero.
[0082] In this embodiment, the position information of the pixel point includes a horizontal coordinate value and a vertical coordinate value. Accordingly, according to the gradient angle and position information of the pixel point, the first neighborhood point and the second neighborhood point along the gradient angle can be determined in the following manner: when the gradient angle of the pixel point is 0 degrees, the difference between the horizontal coordinate value of the pixel point and the preset first value is determined as the first horizontal coordinate; the horizontal coordinate value of the pixel point and the preset second value are summed to obtain the second horizontal coordinate; the first neighborhood point is determined according to the first horizontal coordinate and the vertical coordinate value of the pixel point; the second neighborhood point is determined according to the second horizontal coordinate and the vertical coordinate value of the pixel point. Exemplarily, if the position information of the pixel point is (x, y), the first neighborhood point is (x-1, y), the second neighborhood point is (x+1, y), and the preset second value and the preset first value are 1.
[0083] When the gradient angle of the pixel point is 45 degrees, the vertical coordinate value of the pixel point and the preset third value are summed to obtain the first vertical coordinate; the difference between the vertical coordinate value of the pixel point and the preset fourth value is determined as the second vertical coordinate; the first neighborhood point is determined according to the first horizontal coordinate and the first vertical coordinate; the second neighborhood point is determined according to the second horizontal coordinate and the second vertical coordinate. Exemplarily, if the position information of the pixel point is (x, y), the first neighborhood point is (x-1, y+1), the second neighborhood point is (x+1, y-1), and the preset second value, the preset first value, the preset third value, and the preset fourth value are 1.
[0084] When the gradient angle of the pixel point is 90 degrees, the first neighborhood point is determined based on the horizontal coordinate value and the second vertical coordinate of the pixel point; the second neighborhood point is determined based on the horizontal coordinate value and the second vertical coordinate of the pixel point. Exemplarily, if the position information of the pixel point is (x, y), the first neighborhood point is (x, y-1) and the second neighborhood point is (x, y+1).
[0085] When the gradient angle of the pixel point is 135 degrees, the first neighborhood point is determined based on the first horizontal coordinate and the second vertical coordinate; the second neighborhood point is determined based on the second horizontal coordinate and the first vertical coordinate. Exemplarily, if the position information of the pixel point is (x, y), the first neighborhood point is (x-1, y-1) and the second neighborhood point is (x+1, y-1).
[0086] In this embodiment, based on the preset circle information, the method of determining the potential circumferential edge points from the strong edge points and the candidate edge points may include at least two methods:
[0087] One method may be: all strong edge points and all candidate edge points are taken as first edge points; for each first edge point, the distance between the position information of the first edge point and the center of the circle in the preset circle information is determined, and the difference between the distance and the radius of the circle in the preset circle information is determined, and the absolute value of the difference is taken as the geometric distance difference; if the difference is less than a preset threshold, the first edge point is determined to be a potential circular edge point. Exemplarily, the calculation formula for determining the geometric distance difference corresponding to the first edge point can be expressed as: ;in Indicates The geometric distance difference corresponding to the first edge points is Indicates The position information of the first edge point, is the coordinate information of the center of the circle in the preset circle information; R is the radius of the circle. When it is less than T (i.e. the preset threshold), the The first edge points are taken as potential circumferential edge points.
[0088] Another way may be: all strong edge points and all candidate edge points are taken as first edge points; for each first edge point, the angle between the line from the first edge point to the center of the circle in the preset circle information and the x-coordinate axis is determined, and the angle difference between the angle and the gradient angle of the first edge point is determined; if the angle difference is less than a preset angle error threshold, the first edge point is determined to be a potential circular edge point. Exemplarily, the calculation formula for determining the angle difference corresponding to the first edge point can be expressed as: ;in Indicates The angle difference corresponding to the first edge point is Indicates The gradient angle of the first edge point; Indicates The angle between the line connecting the first edge point to the center of the circle in the preset circle information and the x-coordinate axis. Less than (i.e. preset angle error threshold), the The first edge points are taken as potential circumferential edge points.
[0089] It should be noted that the above two methods can be combined to determine whether the first edge point is a potential circular edge point. The first edge point can be used as a potential circular edge point as long as one of the above methods is satisfied. The advantage of determining the potential circular edge point is that the accuracy of circle fitting can be improved, and the accuracy of displaying the main target in the image can be improved, so as to improve the accuracy of determining the first sub-pixel offset of the main target.
[0090] S230: Determine a first sub-pixel offset of the main target based on the first circle attribute and a second circle attribute corresponding to the main target in the main target reference image.
[0091] In this embodiment, the center position of the circle in the first circle attribute and the center position of the circle in the second circle attribute corresponding to the main target in the main target reference image can be differenced to obtain the sub-pixel offset of the main target in the horizontal and vertical directions as the first sub-pixel offset.
[0092] Exemplarily, the calculation formula for determining the first sub-pixel offset may be: .in, and are the sub-pixel offsets of the main target in the horizontal and vertical directions respectively; Indicates the center position of the first circle attribute; represents the center position of the main target in the main target reference image. The calculation formula for determining the second sub-pixel offset can be: .in, and They are respectively represented as the sub-pixel offset of the sub-target in the horizontal and vertical directions, Indicates the center position of the second circle attribute; Shows the center position of the sub-target in the sub-target reference image.
[0093] S240: Determine a second sub-pixel offset of the sub-target based on the sub-image and a predetermined sub-target reference image.
[0094] It should be noted that the method of determining the second sub-pixel offset of the sub-target based on the sub-image and the predetermined sub-target reference image is similar to the method of determining the first sub-pixel offset of the main target based on the main image and the predetermined main target reference image, and will not be repeated here.
[0095] S250: Correct the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target.
[0096] S260: Determine the displacement size and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment attributes, and the target sub-pixel offset.
[0097] The technical solution of this embodiment obtains the first circle attribute of the main target fitting circle by performing circle fitting based on the first pixel attributes of multiple pixel points in the main image, and then determines the first sub-pixel offset of the main target based on the first circle attribute and the second circle attribute corresponding to the main target in the main target reference image, thereby achieving the representation of the offset at the sub-pixel level and improving the accuracy of determining the target offset, thereby improving the accuracy of displacement monitoring.
[0098] Embodiment 3
[0099] Fig.11 Schematic diagram of a binocular and multi-camera displacement measurement device according to the third embodiment of the present invention. Fig.11 As shown, the device includes: an image acquisition module 310, a first sub-pixel offset determination module 320, a target sub-pixel offset determination module 330 and a displacement determination module 340.
[0100] The image acquisition module 310 is used to acquire a main image corresponding to the object to be monitored based on the main camera, and a sub-image corresponding to the first object based on at least one sub-camera connected to the main camera; wherein the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; the first sub-pixel offset determination module 320 is used to determine the first sub-pixel offset of the main target based on the main image and a predetermined main target reference image, and based on the sub-image and the predetermined sub-target A reference image is used to determine the second sub-pixel offset of the sub-target; wherein the main target reference image is based on the initial frame taken by the main camera of the main target; the sub-target reference image is based on the initial frame taken by the sub-camera of the sub-target; a target sub-pixel offset determination module 330 is used to correct the first sub-pixel offset based on the second sub-pixel offset to obtain the target sub-pixel offset of the main target; a displacement determination module 340 is used to determine the displacement size and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset.
[0101] The technical solution of this embodiment is to obtain a main image corresponding to the object to be monitored based on a main camera, and a sub-image corresponding to the first object based on at least one sub-camera connected to the main camera; the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target is determined, and based on the sub-image and a predetermined sub-target reference image, a second sub-pixel offset of the sub-target is determined; wherein the main target reference image is an initial frame based on the main camera shooting the main target; the sub-target reference image is an initial frame based on the sub-camera shooting the sub-target; the first sub-pixel offset is corrected based on the second sub-pixel offset to obtain the target sub-pixel of the main target. Offset: Based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset, the displacement size and direction of the monitored object are determined, which solves the problem of misjudgment of the deformation of the monitored target due to thermal expansion and contraction of the internal structure of the equipment in the prior art. The first sub-pixel offset of the main target is determined by the main image and the predetermined main target reference image when the main camera and the sub-camera are connected to each other, and the second sub-pixel offset of the sub-target is determined by the sub-image and the predetermined sub-target reference image. The first sub-pixel offset corresponding to the sub-camera is used to compensate the second sub-pixel offset corresponding to the main camera to obtain the target sub-pixel offset of the main target, thereby improving the accuracy of the offset determination, thereby improving the accuracy of the displacement determination of the monitored object, and effectively avoiding the misjudgment of the deformation of the monitored target.
[0102] Based on the above device, optionally, the first sub-pixel offset determination module 320 includes:
[0103] A first circle attribute determination unit, configured to perform circle fitting based on first pixel attributes of a plurality of pixel points in the main image to obtain a first circle attribute of a main target fitting circle;
[0104] The first sub-pixel offset determination unit is used to determine a first sub-pixel offset of the main target based on the first circle attribute and a second circle attribute corresponding to the main target in the main target reference image.
[0105] Based on the above device, optionally, the first circle attribute determination unit includes:
[0106] A grayscale image determination unit, configured to process a first pixel attribute of each pixel in the main image to obtain a grayscale image; wherein the first pixel attribute includes at least color;
[0107] A unit for determining an image to be edge detected, used for filtering the grayscale image to obtain an image to be edge detected;
[0108] A potential circular edge point determination unit, configured to perform edge detection on the image to be edge detected, and determine at least one potential circular edge point from a plurality of pixel points in the image to be edge detected;
[0109] The first circle attribute determination unit is used to perform circle fitting on the position information of at least one potential circular edge point based on the least square method to obtain a first circle attribute of the main target fitting circle.
[0110] Based on the above device, optionally, the potential circumferential edge point determination unit includes:
[0111] A gradient amplitude determination unit, configured to perform a convolution operation on the image to be edge detected and a preset operator matrix to obtain a gradient of each pixel in the image to be edge detected, and determine a gradient amplitude of the pixel based on the gradient of the pixel;
[0112] A gradient amplitude judgment unit, configured to determine that the pixel point is a strong edge point when the gradient amplitude of the pixel point meets a preset strong edge condition, and to determine that the pixel point is a weak edge point when the gradient amplitude of the pixel point meets a preset weak edge condition;
[0113] a candidate edge point determination unit, configured to use the weak edge point as a candidate edge point if a preset neighborhood corresponding to the weak edge point contains a strong edge point;
[0114] The potential circumferential edge point determination subunit is used to determine potential circumferential edge points from the strong edge points and the candidate edge points based on preset circle information.
[0115] On the basis of the above device, optionally, the device further includes:
[0116] A gradient angle determination unit, configured to determine a gradient angle of the pixel point based on the gradient of the pixel point;
[0117] A first pixel point determining unit, configured to determine, when the gradient angle of the pixel point is an angle in a preset angle, a first pixel point adjacent to the pixel point from the image to be edge detected based on the gradient angle and position information of the pixel point;
[0118] A gradient amplitude updating unit is used to update the gradient amplitude of the pixel point to a preset threshold value when the gradient amplitude of the pixel point is less than the gradient amplitude of the first pixel point adjacent to the pixel point, so as to determine whether the updated gradient amplitude of the pixel point satisfies a preset strong edge condition or a preset weak edge condition.
[0119] Based on the above device, optionally, the target sub-pixel offset determination module 330 includes:
[0120] An estimated sub-pixel motion offset determination unit, configured to input the second sub-pixel offset into a main-sub camera calibration model to obtain an estimated sub-pixel motion offset corresponding to the main camera;
[0121] A target sub-pixel offset determination unit is used to correct the first sub-pixel offset based on the estimated sub-pixel movement offset to obtain a target sub-pixel offset of the main target.
[0122] Based on the above device, optionally, the displacement determination module 340 includes:
[0123] A conversion parameter determination unit, configured to determine a conversion parameter based on a physical size of the main target and a second circle attribute corresponding to the main target in the main target reference image;
[0124] an actual offset determination unit, configured to determine an actual offset based on the conversion parameter and the target sub-pixel offset;
[0125] The displacement determination unit is used to determine the displacement size and direction of the object to be monitored based on the camera deployment attributes and the actual offset.
[0126] The binocular and multi-eye displacement measurement device provided in the embodiment of the present invention can execute the binocular and multi-eye displacement measurement method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0127] Embodiment 4
[0128] Fig.12 It is a schematic diagram of the structure of an electronic device based on binocular and multi-eye displacement measurement methods for implementing an embodiment of the present invention. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0129] like Fig.12As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0130] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0131] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as binocular and multi-eye displacement measurement methods.
[0132] In some embodiments, the binocular and multi-eye displacement measurement method can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the binocular and multi-eye displacement measurement method described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the binocular and multi-eye displacement measurement method by any other appropriate means (for example, by means of firmware).
[0133] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0134] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0135] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0136] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0137] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0138] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0139] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements a binocular and multi-camera displacement measurement method as provided in any embodiment of the present invention.
[0140] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).
[0141] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0142] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A binocular and multi-eye displacement measurement method, characterized in that: include: Acquire a main image corresponding to the object to be monitored shot by a main camera, and a sub-image corresponding to a first object shot by at least one sub-camera connected to the main camera; wherein the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; Based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target is determined, and based on the sub-image and a predetermined sub-target reference image, a second sub-pixel offset of the sub-target is determined; wherein the main target reference image is based on an initial frame taken by the main camera for the main target; and the sub-target reference image is based on an initial frame taken by the sub-camera for the sub-target; Correcting the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target; Based on the physical size of the main target, the main target reference image, camera deployment properties and the target sub-pixel offset, the displacement magnitude and direction of the object to be monitored are determined.
2. The method according to claim 1, characterized in that The determining, based on the main image and a predetermined main target reference image, a first sub-pixel offset of the main target comprises: Performing circle fitting based on first pixel attributes of a plurality of pixel points in the main image to obtain a first circle attribute of a main target fitting circle; A first sub-pixel offset of the main target is determined based on the first circle attribute and a second circle attribute corresponding to the main target in the main target reference image.
3. The method according to claim 2, characterized in that The performing circle fitting based on the first pixel attributes of the plurality of pixel points in the main image to obtain the first circle attribute of the main target fitting circle includes: Processing a first pixel attribute of each pixel in the main image to obtain a grayscale image; wherein the first pixel attribute includes at least color; Performing filtering processing on the grayscale image to obtain an image to be edge detected; Performing edge detection on the image to be edge detected, and determining at least one potential circular edge point from a plurality of pixel points in the image to be edge detected; Based on the least square method, circle fitting is performed on the position information of at least one potential circumferential edge point to obtain a first circle attribute of the main target fitting circle.
4. The method according to claim 3, characterized in that The step of performing edge detection on the image to be edge detected and determining at least one potential circular edge point from a plurality of pixel points in the image to be edge detected comprises: Performing a convolution operation on the image to be edge detected and a preset operator matrix to obtain a gradient of each pixel in the image to be edge detected, and determining a gradient amplitude of the pixel based on the gradient of the pixel; When the gradient amplitude of the pixel point meets a preset strong edge condition, the pixel point is determined to be a strong edge point, and when the gradient amplitude of the pixel point meets a preset weak edge condition, the pixel point is determined to be a weak edge point; If the preset neighborhood corresponding to the weak edge point contains a strong edge point, the weak edge point is used as a candidate edge point; Based on the preset circle information, potential circumferential edge points are determined from the strong edge points and the candidate edge points.
5. The method according to claim 4, characterized in that After performing a convolution operation on the image to be edge detected and a preset operator matrix to obtain the gradient of each pixel in the image to be edge detected, the method further includes: Based on the gradient of the pixel point, determining the gradient angle of the pixel point; When the gradient angle of the pixel point is an angle in the preset angles, determining a first pixel point adjacent to the pixel point from the image to be edge detected based on the gradient angle and position information of the pixel point; When the gradient amplitude of the pixel point is less than the gradient amplitude of the first pixel point adjacent to it, the gradient amplitude of the pixel point is updated to a preset threshold to determine whether the updated gradient amplitude of the pixel point meets a preset strong edge condition or a preset weak edge condition.
6. The method according to claim 1, characterized in that The correcting the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target includes: Inputting the second sub-pixel offset into the main-sub camera calibration model to obtain the estimated sub-pixel movement offset corresponding to the main camera; Based on the estimated sub-pixel movement offset, the first sub-pixel offset is corrected to obtain a target sub-pixel offset of the main target.
7. The method according to claim 1, characterized in that The determining of the displacement magnitude and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment attribute and the target sub-pixel offset includes: Determining a conversion parameter based on the physical size of the main target and a second circle attribute corresponding to the main target in the main target reference image; Determining an actual offset based on the conversion parameter and the target sub-pixel offset; Based on the camera deployment attributes and the actual offset, the displacement magnitude and direction of the object to be monitored are determined.
8. A binocular and multi-camera displacement measurement device, characterized in that: include: An image acquisition module, used to acquire a main image corresponding to the object to be monitored shot by a main camera, and a sub-image corresponding to a first object shot by at least one sub-camera connected to the main camera; wherein the object to be monitored includes a main target; the first object includes a sub-target; the first object is an object with a fixed position; the shooting field of view of the sub-camera changes with the shooting field of view of the main camera; a first sub-pixel offset determination module, configured to determine a first sub-pixel offset of the main target based on the main image and a predetermined main target reference image, and to determine a second sub-pixel offset of the sub-target based on the sub-image and a predetermined sub-target reference image; wherein the main target reference image is based on an initial frame shot by the main camera at the main target; and the sub-target reference image is based on an initial frame shot by the sub-camera at the sub-target; a target sub-pixel offset determination module, configured to correct the first sub-pixel offset based on the second sub-pixel offset to obtain a target sub-pixel offset of the main target; The displacement determination module is used to determine the displacement size and direction of the object to be monitored based on the physical size of the main target, the main target reference image, the camera deployment properties and the target sub-pixel offset.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory in communication with the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the binocular and multi-camera displacement measurement method described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the binocular and multi-camera displacement measurement method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Eliminating method and system for image virtual deformation errors caused by temperature
CN104050647A
Method for correcting influence of thermal current on related measuring precision of digital image
CN108955551A
A method for determining an optimal edge of a given region
CN109558908A
Temperature drift coefficient acquisition method, electronic equipment, storage medium and image correction method
CN113763485A
Steel rail longitudinal displacement monitoring method and system based on visual monitoring
CN116295040A
Cited By
Retaining wall displacement monitoring method and electronic equipment
CN120521506A
Retaining wall displacement monitoring method and electronic device
CN120521506B
Bridge displacement measurement method and device based on unmanned aerial vehicle vision
CN121576918A