A method, device, equipment and storage medium for visual camera calibration

By capturing the feature point images of the visual camera in a set coordinate system and calculating the pixel distance, the automatic calibration of the visual camera is achieved, which solves the problem of the complexity and low precision of the existing calibration method and improves the calibration accuracy and adaptability.

CN117115270BActive Publication Date: 2025-09-26SHENZHEN YITU VISION AUTOMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311114379.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-31
Publication Date
2025-09-26
Estimated Expiration
2043-08-31

AI Technical Summary

Technical Problem

Existing visual camera calibration methods are complex and have low accuracy, making it difficult to meet the needs of high-precision alignment and assembly.

Method used

By obtaining the X-axis and Y-axis of the set coordinate system, capturing multiple images of the feature points of the object and their displacement, and calculating the adjacent distances of single pixels of the visual camera, automatic calibration is achieved.

Benefits of technology

It simplifies the calibration process, improves calibration accuracy, adapts to different shooting objects, has repeated calibration verification function, and is highly adaptable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117115270B_ABST
    Figure CN117115270B_ABST
Patent Text Reader

Abstract

The present invention discloses a calibration method, apparatus, device and storage medium for a visual camera, including: S100, obtaining the X-axis and Y-axis of a set coordinate system, the first image, second image, third image, fourth image and fifth image of the feature points of the photographed object, and the displacement between the shooting positions corresponding to the first image, the second image, the third image and the fourth image and the shooting position corresponding to the fifth image; S200, obtaining the first pixel distance, the second pixel distance, the third pixel distance and the fourth pixel distance respectively based on the first image, the second image, the third image, the fourth image and the fifth image and the first displacement, the second displacement, the third displacement and the fourth displacement; S300, obtaining the adjacent distance of a single pixel of the visual camera based on the first pixel distance, the second pixel distance, the third pixel distance and the fourth pixel distance. The present invention is an automated calibration method with a convenient operation process and high calibration accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of camera calibration technology, and in particular to a calibration method, device, equipment and storage medium for a visual camera. Background Art

[0002] The machine vision system, also known as the industrial vision system, works as follows: the product or area is photographed and imaged, and then processed using dedicated image processing software based on the image information. Based on the processing results, the software can automatically determine the product's position, size, and appearance information, and make a qualified or unqualified judgment based on pre-set standards, and output its judgment information to the actuator.

[0003] In the field of automated inspection and high-precision positioning equipment, especially when high-precision alignment assembly or high-precision positioning is required, high-magnification visual cameras are often used to assist in determining whether the assembly position between the object to be assembled and the carrier object meets the accuracy requirements in the form of images. When different machines inspect different products, the installation position of the visual camera will result in inconsistent visual magnification, installation distance, image focal length, etc. Due to differences in resolution between different visual cameras, there are subtle differences in the image content captured by different visual cameras, and the quality of the captured images varies, resulting in errors in the assembly position of the object to be assembled. Therefore, before assembling the object and performing retrograde positioning, the visual camera needs to be calibrated.

[0004] The existing calibration methods for visual cameras are to calibrate according to a fixed visual magnification or to manually adjust the parameters of the visual camera for calibration. The calibration process of the above two calibration methods is relatively complicated and prone to errors, resulting in low calibration accuracy. Summary of the Invention

[0005] The purpose of the present invention is to provide a method, device, equipment and storage medium for calibrating a visual camera to solve the technical problem that in the prior art, visual cameras are calibrated according to a fixed visual multiple or by manually modulating the parameters of the visual camera. The calibration process of the above two calibration methods is relatively complex and prone to errors, resulting in low calibration accuracy.

[0006] The various technical effects that can be produced by the preferred technical solutions among the various technical solutions provided by the present invention are described in detail below.

[0007] To achieve the above objectives, the present invention provides the following technical solutions:

[0008] The present invention provides a method for calibrating a visual camera, which specifically includes the following steps:

[0009] S100: Acquire an X-axis and a Y-axis of a set coordinate system, a first image, a second image, a third image, a fourth image, and a fifth image of a feature point of a photographed object, and displacements between photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, and a photographing position corresponding to the fifth image, wherein the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, all surround the photographing position corresponding to the fifth image, and the displacements include a first displacement, a second displacement, a third displacement, and a fourth displacement;

[0010] S200: Obtain a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement; obtain a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement; obtain a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement; and obtain a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement;

[0011] S300: Obtain an adjacent distance of a single pixel of a visual camera according to the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance.

[0012] Preferably, the step of obtaining a fifth image of feature points of the photographed object includes:

[0013] The shooting position corresponding to the fifth image is the intersection position of the X axis and the Y axis, and the feature points of the object are shot at the shooting position corresponding to the fifth image to obtain the fifth image.

[0014] Preferably, the step of acquiring the first image, the second image, the third image, and the fourth image of the feature points of the photographed object includes:

[0015] Taking the shooting position corresponding to the fifth image as a starting point, move in the +X axis direction to the shooting position corresponding to the first image of the feature point of the object to obtain the first image;

[0016] Starting from the shooting position corresponding to the fifth image, moving in the -X axis direction to the shooting position corresponding to the second image of the feature point of the object, to obtain a second image;

[0017] Taking the shooting position corresponding to the fifth image as a starting point, move in the +Y axis direction to the shooting position corresponding to the third image of the feature point of the object to obtain a third image;

[0018] Starting from the shooting position corresponding to the fifth image, the fourth image is obtained by moving in the −Y axis direction to the shooting position corresponding to the fourth image of the feature point of the object.

[0019] Preferably, the obtaining of the displacements between the shooting positions corresponding to the first image, the second image, the third image, and the fourth image and the shooting position corresponding to the fifth image includes:

[0020] Obtaining a first displacement according to a shooting position corresponding to the first image and a shooting position corresponding to the fifth image;

[0021] obtaining a second displacement according to a shooting position corresponding to the second image and a shooting position corresponding to the fifth image;

[0022] Obtaining a third displacement according to a shooting position corresponding to the third image and a shooting position corresponding to the fifth image;

[0023] A fourth displacement is obtained according to the shooting position corresponding to the fourth image and the shooting position corresponding to the fifth image.

[0024] Preferably, obtaining a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement, obtaining a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement, obtaining a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement, and obtaining a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement, includes:

[0025] Obtaining a first pixel distance based on the number of pixels between the feature point of the first image and the feature point of the fifth image and the first displacement;

[0026] Obtaining a second pixel distance based on the number of pixels between the feature point of the second image and the feature point of the fifth image and the second displacement;

[0027] Obtaining a third pixel distance based on the number of pixels between the feature point of the third image and the feature point of the fifth image and the third displacement;

[0028] A fourth pixel distance is obtained according to the number of pixels between the feature point of the fourth image and the feature point of the fifth image and the fourth displacement.

[0029] Preferably, obtaining the adjacent distance of a single pixel of the visual camera according to the first pixel distance, the second pixel distance, the third pixel distance and the fourth pixel distance includes:

[0030] Performing an average operation on the first pixel distance and the second pixel distance to obtain a first average value, and using the first average value as the horizontal adjacent distance of a single pixel;

[0031] An average operation is performed on the third pixel distance and the fourth pixel distance to obtain a second average value, and the second average value is used as the longitudinal adjacent distance of a single pixel.

[0032] Preferably, the feature points of the photographed object are boundary points of the photographed object or obvious cross points on the photographed object.

[0033] A calibration device for a visual camera, comprising:

[0034] an acquisition module, configured to acquire an X-axis and a Y-axis of a set coordinate system, a first image, a second image, a third image, a fourth image, and a fifth image of a feature point of a photographed object, and displacements between photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, and a photographing position corresponding to the fifth image, wherein the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, all surround the photographing position corresponding to the fifth image, and the displacements include a first displacement, a second displacement, a third displacement, and a fourth displacement;

[0035] a processing module, configured to obtain, based on the first image, the fifth image, and the first displacement, a first pixel distance between feature points in the first image and the fifth image; obtain, based on the second image, the fifth image, and the second displacement, a second pixel distance between feature points in the second image and the fifth image; obtain, based on the third image, the fifth image, and the third displacement, a third pixel distance between feature points in the third image and the fifth image; and obtain, based on the fourth image, the fifth image, and the fourth displacement, a fourth pixel distance between feature points of objects in the fourth image and the fifth image;

[0036] The calculation module is used to obtain the adjacent distance of a single pixel of the visual camera according to the first pixel distance, the second pixel distance, the third pixel distance and the fourth pixel distance.

[0037] A visual camera calibration device, comprising:

[0038] one or more processors and memory;

[0039] The memory is used to store one or more computer programs, and the one or more processors are used to execute the one or more computer programs stored in the memory, so that the processor performs the visual camera calibration method as described above.

[0040] A computer-readable storage medium stores a computer program, which, when executed, implements the visual camera calibration method described above.

[0041] Implementing one of the above technical solutions of the present invention has the following advantages or beneficial effects:

[0042] The present invention is an automated calibration with a convenient operation process, avoiding manual calibration and having high calibration accuracy; it can calibrate different shooting objects and has strong adaptability; at the same time, it can also repeatedly calibrate the same shooting object to verify its calibration consistency. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. Those skilled in the art can also derive other drawings based on these drawings without inventive work. In the drawings:

[0044] Figure 1 1 is a schematic flow chart of the steps of a calibration method for a visual camera according to an embodiment of the present invention;

[0045] Figure 2 1 is a schematic diagram of shooting positions corresponding to the first image, the second image, the third image, the fourth image, and the fifth image in the calibration method of the visual camera in an embodiment of the present invention;

[0046] Figure 3 1 is a schematic diagram of a module of a calibration device for a visual camera according to an embodiment of the present invention;

[0047] Figure 4 Schematic diagram of a module of a calibration device for a visual camera in an embodiment of the present invention. DETAILED DESCRIPTION

[0048] In order to make the objects, technical solutions and advantages of the present invention clearer, the various exemplary embodiments to be described below will refer to the corresponding drawings, which constitute a part of the exemplary embodiments, in which various exemplary embodiments that may be used to implement the present invention are described. Unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation methods described in the following exemplary embodiments do not represent all implementation methods consistent with the present disclosure. It should be understood that they are only examples of processes, methods and devices that are consistent with some aspects of the present disclosure as detailed in the appended claims, and other embodiments may also be used, or structural and functional modifications may be made to the embodiments listed herein without departing from the scope and essence of the present invention.

[0049] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "transverse", etc. indicate the orientation or position relationship based on the drawings, and are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the elements referred to must have a specific orientation, be constructed and operate in a specific orientation. The terms "first", "second", etc. are only used for descriptive purposes and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. The term "plurality" means two or more. The terms "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, an integral connection, a mechanical connection, an electrical connection, a communication connection, a direct connection, an indirect connection through an intermediate medium, and can be the internal connection of two elements or the interaction relationship between two elements. The term "and / or" includes any and all combinations of one or more related listed items. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances.

[0050] In order to illustrate the technical solution of the present invention, a specific embodiment is provided below, in which only the parts related to the embodiment of the present invention are shown.

[0051] Example 1:

[0052] like Figure 1 As shown, the present invention provides a calibration method for a visual camera, which specifically includes the following steps:

[0053] S100, obtaining the X-axis and Y-axis of a set coordinate system, the first image, the second image, the third image, the fourth image, and the fifth image of feature points of the photographed object, and the displacements between the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, and the photographing position corresponding to the fifth image, wherein the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, all surround the photographing position corresponding to the fifth image, and the displacements include a first displacement, a second displacement, a third displacement, and a fourth displacement;

[0054] S200, obtaining a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement; obtaining a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement; obtaining a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement; and obtaining a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement;

[0055] S300 : Obtaining an adjacent distance of a single pixel of a visual camera according to the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance.

[0056] In this embodiment, a visual camera calibration method is applied to a visual control system. The visual control system includes an axis control system, a visual system, and a visual camera. The axis control system is in communication with the visual system; the visual system is in communication with the visual camera. The visual system can send a signal to the visual camera to photograph the object and send the photographed images to the visual system for processing. The visual camera is connected to the axis control system. The visual camera can move its position under the action of the axis control system and capture a first image, a second image, a third image, a fourth image, and a fifth image at different shooting positions. By calibrating the object through the axis control system, the visual system, and the visual camera, automated control is achieved, which can save the calibration process, avoid manual calibration, and improve calibration accuracy.

[0057] In step S100, the X-axis and Y-axis of the set coordinate system, the first image, second image, third image, fourth image and fifth image of the feature points of the shooting object, and the displacement between the shooting positions corresponding to the first image, the second image, the third image and the fourth image respectively and the shooting position corresponding to the fifth image are obtained. The shooting positions corresponding to the first image, the second image, the third image and the fourth image respectively surround the shooting position corresponding to the fifth image, and the displacement includes a first displacement, a second displacement, a third displacement and a fourth displacement.

[0058] In this embodiment, the X-axis and Y-axis of the set coordinate system are obtained, and the first, second, third, fourth, and fifth images are all captured within the set coordinate system, ensuring that the images of the feature points of the captured object are all in the same coordinate system, thereby ensuring calibration accuracy. In this embodiment, the X-axis and Y-axis of the coordinate system are jointly defined by the axis control system and the visual system, which saves manual operation and facilitates the visual camera to capture the object.

[0059] In this embodiment, the visual system takes the shooting position of the fifth image as the origin, and the visual camera moves to the origin position under the action of the axis control system. The axis control system sends a calibration preparation signal to the visual system, so that the visual system calibrates the shooting positions corresponding to the first image, the second image, the third image, and the fourth image on the X-axis and Y-axis of the coordinate system, respectively, and the displacement between the shooting positions corresponding to the fifth image, and feeds back the displacement to the axis control system. The axis control system drives the visual camera to move according to the displacement set by the visual system.

[0060] As an optional implementation, Figure 2 As shown, obtaining a fifth image of feature points of the photographed object includes:

[0061] The shooting position corresponding to the fifth image is the intersection of the X-axis and the Y-axis, and the feature points of the object are captured at the shooting position corresponding to the fifth image to obtain the fifth image. Specifically, the shooting position corresponding to the fifth image is the origin of the coordinate system, and the object captured at the shooting position corresponding to the fifth image should be in the center of the fifth image. This facilitates the subsequent acquisition of the first image, second image, third image, and fourth image of the feature points of the object, thereby reducing the calibration process and improving its calibration accuracy.

[0062] As an optional implementation manner, obtaining a first image, a second image, a third image, and a fourth image of feature points of a photographed object includes:

[0063] Starting from the shooting position corresponding to the fifth image, move in the +X axis direction to the shooting position corresponding to the first image of the feature point of the object to obtain the first image;

[0064] Starting from the shooting position corresponding to the fifth image, move in the -X axis direction to the shooting position corresponding to the second image of the feature point of the object to obtain the second image;

[0065] Starting from the shooting position corresponding to the fifth image, move in the +Y-axis direction to the shooting position corresponding to the third image of the feature point of the object to obtain a third image;

[0066] Starting from the shooting position corresponding to the fifth image, the fourth image is obtained by moving in the -Y axis direction to the shooting position corresponding to the fourth image of the feature point of the object.

[0067] Specifically, since the shooting position corresponding to the fifth image is the origin of the X-axis and Y-axis of the coordinate system, the shooting positions corresponding to the first image, the second image, the third image, and the fourth image are respectively moved in different directions by the displacement amount set by the calibration system with the shooting position corresponding to the fifth image as the starting point, thereby obtaining the first image, the second image, the third image, and the fourth image of the feature point of the photographed object. It should be noted that the first image is obtained by moving in the +X-axis direction to the shooting position corresponding to the first image of the feature point of the object, the second image is obtained by moving in the -X-axis direction to the shooting position corresponding to the second image of the feature point of the object, the third image is obtained by moving in the +Y-axis direction to the shooting position corresponding to the third image of the feature point of the object, and the fourth image is obtained by moving in the -Y-axis direction to the shooting position corresponding to the fourth image of the feature point of the object.

[0068] like Figure 2As shown, the first image, the second image, the third image and the fourth image are all centered on the fifth image, and are moved on the positive and negative axes of the X-axis and the Y-axis by the displacement calibrated by the visual system, respectively. The first image, the second image, the third image, the fourth image and the fifth image of the feature points of the photographed object can be obtained through the visual camera, which facilitates the visual system to process the first image, the second image, the third image, the fourth image and the fifth image, calibrate the calibration camera, and improve its calibration accuracy.

[0069] As an optional implementation manner, obtaining the displacement between the shooting positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, and the shooting position corresponding to the fifth image, respectively, includes:

[0070] like Figure 2 As shown, the first displacement amount is obtained according to the shooting position corresponding to the first image and the shooting position corresponding to the fifth image; the second displacement amount is obtained according to the shooting position corresponding to the second image and the shooting position corresponding to the fifth image; the third displacement amount is obtained according to the shooting position corresponding to the third image and the shooting position corresponding to the fifth image; and the fourth displacement amount is obtained according to the shooting position corresponding to the fourth image and the shooting position corresponding to the fifth image.

[0071] In this embodiment, if Figure 2 As shown, the shooting positions corresponding to the first, second, third, and fourth images are obtained by moving the first, second, third, and fourth displacements, respectively, with the shooting position corresponding to the fifth image as the origin. Starting from the shooting position corresponding to the fifth image, the first displacement is moved in the +X-axis direction to the shooting position corresponding to the first image of the object's feature point to obtain the first image. The second displacement is moved in the -X-axis direction to the shooting position corresponding to the second image of the object's feature point to obtain the second image. The third displacement is moved in the +Y-axis direction to the shooting position corresponding to the third image of the object's feature point to obtain the third image. The fourth image is moved in the -Y-axis direction to the shooting position corresponding to the fourth image of the object's feature point to obtain the fourth image.

[0072] Specifically, the first displacement, the second displacement, the third displacement, and the fourth displacement may be the same or different. To facilitate calibration and obtain accurate calibration results, in this embodiment, it is preferred that the first displacement and the second displacement are the same, and the third displacement and the fourth displacement are the same.

[0073] It should be noted that the first, second, third, and fourth images of the subject's feature points form a rectangle, and the fifth image of the subject's feature points is the center point of the rectangle. The line connecting the first, second, and fifth images of the subject's feature points is a line of symmetry on the Y axis, and the line connecting the third, fourth, and fifth images of the subject's feature points is a line of symmetry on the X axis. Finally, the first, second, third, and fourth images of the subject's feature points are all aligned on the X and Y axes, facilitating subsequent operations and improving calibration accuracy.

[0074] The visual camera can move to the photographing positions corresponding to the first image, the second image, the third image and the fourth image according to the first displacement, the second displacement, the third displacement and the fourth displacement to take pictures, thereby realizing automatic control, saving the calibration process, avoiding manual calibration and improving the calibration accuracy.

[0075] In step S200, a first pixel distance between feature points in the first image and the fifth image is obtained based on the first image, the fifth image and the first displacement amount; a second pixel distance between feature points in the second image and the fifth image is obtained based on the second image, the fifth image and the second displacement amount; a third pixel distance between feature points in the third image and the fifth image is obtained based on the third image, the fifth image and the third displacement amount; and a fourth pixel distance between feature points of objects in the fourth image and the fifth image is obtained based on the fourth image, the fifth image and the fourth displacement amount.

[0076] As an optional implementation manner, obtaining a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement, obtaining a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement, obtaining a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement, and obtaining a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement, including:

[0077] A first pixel distance is obtained based on the number of pixels between the feature point of the first image and the feature point of the fifth image and the first displacement amount; a second pixel distance is obtained based on the number of pixels between the feature point of the second image and the feature point of the fifth image and the second displacement amount; a third pixel distance is obtained based on the number of pixels between the feature point of the third image and the feature point of the fifth image and the third displacement amount; a fourth pixel distance is obtained based on the number of pixels between the feature point of the fourth image and the feature point of the fifth image and the fourth displacement amount.

[0078] In this embodiment, since the first image, second image, third image and fourth image of the feature points of the photographed object are respectively on the X axis and Y axis of the coordinate system, it is convenient to calculate the pixel quantity between the feature points of the photographed object.

[0079] Specifically, the first image, second image, third image, fourth image and fifth image of the feature points of the photographed object are all taken by a visual camera. After the visual camera takes the photos, they will be sent to the visual system for processing, and processed in the order of the first image, the second image, the third image, the fourth image and the fifth image. The visual system can compare the first image, the second image, the third image, the fourth image and the fifth image of the feature points of the photographed object with the fifth image of the feature points of the photographed object to obtain four pixel distances.

[0080] In this embodiment, the first pixel distance is obtained based on the pixel quantity between the feature point of the first image and the feature point of the fifth image and the first displacement; the second pixel distance is obtained based on the pixel quantity between the feature point of the second image and the feature point of the fifth image and the second displacement; the third pixel distance is obtained based on the pixel quantity between the feature point of the third image and the feature point of the fifth image and the third displacement; the fourth pixel distance is obtained based on the pixel quantity between the feature point of the fourth image and the feature point of the fifth image and the fourth displacement.

[0081] Taking the example of obtaining the first pixel distance between feature points in the first and fifth images based on the first and fifth images and the first displacement, assuming the number of pixels between the feature points in the first and fifth images is 5000 and the first displacement is 5 mm, 5 mm / 5000 = 1 μm, the first pixel distance is obtained to be 1 μm.

[0082] The visual system can automatically calculate the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance, which can save the calibration process, ensure the accuracy of position calibration, and improve calibration precision. The displacement in this embodiment is first calibrated by the visual system. The axis control system can drive the visual camera to move and take pictures according to the displacement given by the visual system, and obtain feature points of the photographed object at different shooting positions according to different displacements. Manual input of the displacement is not required, which can avoid the problem of inconsistency between the manually calibrated displacement and the displacement calibrated by the visual system, and can improve calibration precision.

[0083] In step S300 , the adjacent distance of a single pixel of the visual camera is obtained according to the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance.

[0084] The adjacent distances of individual pixels of the visual camera are obtained based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance. Specifically, the adjacent distances of individual pixels of the visual camera on the X-axis and the Y-axis can be obtained based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance. After the adjacent distances of individual pixels are obtained, subsequent assembly of the photographed object can be facilitated.

[0085] As an optional implementation manner, obtaining the adjacent distance of a single pixel of the visual camera according to the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance includes:

[0086] An average operation is performed on the first pixel distance and the second pixel distance to obtain a first mean value, and the first mean value is used as the horizontal adjacent distance of a single pixel; an average operation is performed on the third pixel distance and the fourth pixel distance to obtain a second mean value, and the second mean value is used as the vertical adjacent distance of a single pixel.

[0087] In this embodiment, the first and second images are on the X-axis, and the third and fourth images are on the Y-axis. It can be seen that the first and second pixel distances are the horizontal distances, while the third and fourth pixel distances are the vertical distances. Averaging the first and second pixel distances in the horizontal direction yields a first mean value, which serves as the horizontal distance between adjacent pixels. Averaging the third and fourth pixel distances in the vertical direction yields a second mean value, which serves as the vertical distance between adjacent pixels.

[0088] After completing the above steps, the visual camera is calibrated. Based on the displacement and the pixel distance of the feature points of the photographed object, the horizontal and vertical distances of the adjacent pixels are calculated. This gives the corresponding relationship between the horizontal and vertical distances of the adjacent pixels and the displacement. After the visual camera is calibrated, the subsequent assembly of the photographed object can be facilitated.

[0089] As an optional implementation, the feature points of the photographed object are boundary points of the photographed object or obvious cross points on the photographed object. Specifically, the feature points of the photographed object can be set on the visual system according to the actual photographed object, and no specific requirements are made in this embodiment.

[0090] The calibration method in this embodiment is fast, convenient, and accurate. It can calibrate different shooting objects and has strong adaptability. It can also use different displacement amounts to repeatedly calibrate the same shooting object to verify its consistency. The calibration method in this embodiment can also automatically select the axis to be calibrated according to actual conditions and can be applied to all visual calibration systems.

[0091] The embodiment is only a special example and does not represent only one way of implementing the present invention.

[0092] Example 2:

[0093] The present invention also provides a visual camera calibration device, such as Figure 3 Shown, including:

[0094] An acquisition module 201 is configured to acquire the X-axis and Y-axis of a set coordinate system, the first image, the second image, the third image, the fourth image, and the fifth image of the feature point of the photographed object, and the displacements between the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, and the photographing position corresponding to the fifth image, where the photographing positions corresponding to the first image, the second image, the third image, and the fourth image, respectively, all surround the photographing position corresponding to the fifth image, and the displacements include the first displacement, the second displacement, the third displacement, and the fourth displacement.

[0095] a processing module 202 configured to obtain, based on the first image, the fifth image, and the first displacement, a first pixel distance between feature points in the first image and the fifth image; obtain, based on the second image, the fifth image, and the second displacement, a second pixel distance between feature points in the second image and the fifth image; obtain, based on the third image, the fifth image, and the third displacement, a third pixel distance between feature points in the third image and the fifth image; and obtain, based on the fourth image, the fifth image, and the fourth displacement, a fourth pixel distance between feature points of objects in the fourth image and the fifth image.

[0096] The calculation module 203 is configured to obtain an adjacent distance of a single pixel of the visual camera according to the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance.

[0097] Example 3:

[0098] The present invention also provides an embodiment of a calibration device for a visual camera, such as Figure 4 As shown, it includes one or more processors 301 and a memory 302; wherein, the memory is used to store one or more computer programs, and the one or more processors are used to execute the one or more computer programs stored in the memory, so that the processor performs the features / steps of the embodiment of the visual camera calibration method as described in Example 1.

[0099] Example 4:

[0100] The present invention also provides a computer-readable storage medium, on which one or more computer programs are stored. When the one or more computer programs are executed, the visual camera calibration method as described in Example 1 is implemented.

[0101] The foregoing is merely a preferred embodiment of the present invention. Those skilled in the art will appreciate that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. Furthermore, under the guidance of the present invention, these features and embodiments may be modified to suit specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are intended to be within the scope of the present invention.

Claims

1. A method for calibrating a visual camera, characterized in that: The specific steps include: S100, obtaining the X-axis and Y-axis of the set coordinate system, the first image, the second image, the third image, the fourth image, and the fifth image of the feature point of the photographed object, and the displacement between the photographing positions corresponding to the first image, the second image, the third image, and the fourth image and the photographing position corresponding to the fifth image, respectively, wherein the photographing positions corresponding to the first image, the second image, the third image, and the fourth image are all around the photographing position corresponding to the fifth image, and the displacement includes the first displacement, the second displacement, the third displacement, and the fourth displacement; the first image, the second image, the third image, and the fourth image of the feature point of the photographed object are obtained, including : Starting from the shooting position corresponding to the fifth image, move in the +X axis direction to the shooting position corresponding to the first image of the feature point of the object, to obtain a first image; starting from the shooting position corresponding to the fifth image, move in the -X axis direction to the shooting position corresponding to the second image of the feature point of the object, to obtain a second image; starting from the shooting position corresponding to the fifth image, move in the +Y axis direction to the shooting position corresponding to the third image of the feature point of the object, to obtain a third image; starting from the shooting position corresponding to the fifth image, move in the -Y axis direction to the shooting position corresponding to the fourth image of the feature point of the object, to obtain a fourth image; S200: Obtain a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement; obtain a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement; obtain a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement; and obtain a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement; S300. Obtaining an adjacent distance of a single pixel of a visual camera based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance; obtaining an adjacent distance of a single pixel of a visual camera based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance, including: averaging the first pixel distance and the second pixel distance to obtain a first mean, and using the first mean as the horizontal adjacent distance of the single pixel; averaging the third pixel distance and the fourth pixel distance to obtain a second mean, and using the second mean as the vertical adjacent distance of the single pixel.

2. The method for calibrating a visual camera according to claim 1, wherein: The step of obtaining a fifth image of feature points of the photographed object includes: The shooting position corresponding to the fifth image is the intersection of the X axis and the Y axis, and the feature points of the object are shot at the shooting position corresponding to the fifth image to obtain the fifth image.

3. The method for calibrating a visual camera according to claim 1, wherein: The obtaining of displacements between shooting positions corresponding to the first image, the second image, the third image, and the fourth image and a shooting position corresponding to the fifth image includes: Obtaining a first displacement according to a shooting position corresponding to the first image and a shooting position corresponding to the fifth image; obtaining a second displacement according to a shooting position corresponding to the second image and a shooting position corresponding to the fifth image; Obtaining a third displacement according to a shooting position corresponding to the third image and a shooting position corresponding to the fifth image; A fourth displacement is obtained according to the shooting position corresponding to the fourth image and the shooting position corresponding to the fifth image.

4. The method for calibrating a visual camera according to claim 1, wherein: The method of obtaining a first pixel distance between feature points in the first image and the fifth image based on the first image, the fifth image, and the first displacement, obtaining a second pixel distance between feature points in the second image and the fifth image based on the second image, the fifth image, and the second displacement, obtaining a third pixel distance between feature points in the third image and the fifth image based on the third image, the fifth image, and the third displacement, and obtaining a fourth pixel distance between feature points of objects in the fourth image and the fifth image based on the fourth image, the fifth image, and the fourth displacement, includes: Obtaining a first pixel distance based on the number of pixels between the feature point of the first image and the feature point of the fifth image and the first displacement; Obtaining a second pixel distance based on the number of pixels between the feature point of the second image and the feature point of the fifth image and the second displacement; Obtaining a third pixel distance based on the number of pixels between the feature point of the third image and the feature point of the fifth image and the third displacement; A fourth pixel distance is obtained according to the number of pixels between the feature point of the fourth image and the feature point of the fifth image and the fourth displacement.

5. The method for calibrating a visual camera according to claim 1, wherein: The feature points of the photographed object are boundary points of the photographed object or obvious cross points on the photographed object.

6. A calibration device for a visual camera, characterized in that: include: An acquisition module is configured to acquire the X-axis and Y-axis of a set coordinate system, the first image, the second image, the third image, the fourth image, and the fifth image of the feature point of the photographed object, and the displacement between the photographing positions corresponding to the first image, the second image, the third image, and the fourth image and the photographing position corresponding to the fifth image, wherein the photographing positions corresponding to the first image, the second image, the third image, and the fourth image are all around the photographing position corresponding to the fifth image, and the displacement includes the first displacement, the second displacement, the third displacement, and the fourth displacement; the first image, the second image, the third image, and the fourth image of the feature point of the photographed object are acquired, including: In summary: starting from the shooting position corresponding to the fifth image, moving in the +X axis direction to the shooting position corresponding to the first image of the feature point of the object, to obtain a first image; starting from the shooting position corresponding to the fifth image, moving in the -X axis direction to the shooting position corresponding to the second image of the feature point of the object, to obtain a second image; starting from the shooting position corresponding to the fifth image, moving in the +Y axis direction to the shooting position corresponding to the third image of the feature point of the object, to obtain a third image; starting from the shooting position corresponding to the fifth image, moving in the -Y axis direction to the shooting position corresponding to the fourth image of the feature point of the object, to obtain a fourth image; a processing module, configured to obtain, based on the first image, the fifth image, and the first displacement, a first pixel distance between feature points in the first image and the fifth image; obtain, based on the second image, the fifth image, and the second displacement, a second pixel distance between feature points in the second image and the fifth image; obtain, based on the third image, the fifth image, and the third displacement, a third pixel distance between feature points in the third image and the fifth image; and obtain, based on the fourth image, the fifth image, and the fourth displacement, a fourth pixel distance between feature points of objects in the fourth image and the fifth image; A calculation module is configured to obtain an adjacent distance of a single pixel of a visual camera based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance; and obtain an adjacent distance of a single pixel of the visual camera based on the first pixel distance, the second pixel distance, the third pixel distance, and the fourth pixel distance, including: averaging the first pixel distance and the second pixel distance to obtain a first mean value, and using the first mean value as the horizontal adjacent distance of the single pixel; averaging the third pixel distance and the fourth pixel distance to obtain a second mean value, and using the second mean value as the vertical adjacent distance of the single pixel.

7. A visual camera calibration device, characterized in that: include: one or more processors and memory; The memory is used to store one or more computer programs, and the one or more processors are used to execute the one or more computer programs stored in the memory, so that the processor performs the visual camera calibration method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that The storage medium stores a computer program, which, when executed, implements the visual camera calibration method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Long-distance three-dimensional displacement measurement method and system based on binocular vision

    CN113048888A

  • Adaptive projection method based on highlight boundary three-dimensional remapping

    CN115359175A