A gun-ball linkage calibration method and program product for a gun-ball integrated camera
By acquiring the current image and multiple position images from the bullet camera in the integrated bullet and PTZ camera, the target rotation angle of the PTZ camera is determined, and linkage calibration is performed. This solves the problem of low linkage accuracy between bullet and PTZ cameras and achieves more efficient linkage calibration.
Patent Information
- Application Number
- CN202411379085.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2044-09-29
AI Technical Summary
In existing technologies, the conversion relationship between the camera's image coordinates and the PTZ camera's pan-tilt coordinates is prone to deviation after manual adjustment by the user, resulting in low accuracy of the linkage between the camera and PTZ camera and making it impossible to directly detect the deviation angle of the camera lens.
By acquiring the current image from the bullet camera, controlling the PTZ camera to rotate to multiple positions according to its adjustable angle range, acquiring multiple position images, determining the target rotation angle of the PTZ camera, and performing linkage calibration of the bullet and PTZ cameras, using the fact that the target rotation angle of the PTZ camera is approximately equal to the rotation angle of the bullet camera for calibration.
It improves the accuracy of the linkage between the bullet camera and the PTZ camera, eliminating the need for sensors at the bullet camera to detect the rotation angle and enhancing the precision of the linkage.
Smart Images

Figure CN119277206B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the technical field of computers, and in particular, to a method and program product for gun-ball integrated camera linkage calibration. Background Art
[0002] A gun-ball integrated camera can be composed of a fixed camera and a PTZ camera. The fixed camera can be used for monitoring fixed scenes in a large range, covering a wide area, such as large-scale places like roads, squares, and industrial parks, to ensure an understanding of the overall environment. The PTZ camera can rotate flexibly and is used to achieve precise focusing on a specific area and multi-angle monitoring. Through the combination of the fixed camera and the PTZ camera, multiple linkage functions such as gun-ball linkage tracking and "look where you point" can be achieved.
[0003] For the gun-ball linkage tracking function, if a target object appears in the fixed camera's image, the gun-ball integrated camera can obtain the image coordinates corresponding to the target object in the fixed camera's image, and convert the image coordinates into the PTZ coordinates of the PTZ camera according to the preset angle relationship between the fixed camera and the PTZ camera. The PTZ camera rotates to the target position according to the PTZ coordinates to capture the target object, so as to achieve the tracking of the target object.
[0004] Currently, in order to better meet the actual shooting needs of users, the fixed camera is configured to be manually adjustable up and down within an adjustable angle range. After the user manually adjusts the angle of the fixed camera, there will be a certain deviation in the conversion relationship between the image coordinates of the fixed camera's image and the PTZ coordinates of the PTZ camera, which ultimately results in deviations in "look where you point" and the tracking position. Since there is no sensor to directly detect the deviation angle when the fixed camera lens is manually adjusted, it is impossible to directly know the position of the fixed camera after the user's adjustment, and thus impossible to directly know the deviation of the coordinate conversion, resulting in a low accuracy of the linkage between the fixed camera and the PTZ camera. Summary of the Invention
[0005] The embodiments of the present application provide a method and program product for gun-ball integrated camera linkage calibration, which are used to solve the defect that in the prior art, when the fixed camera is configured to be manually adjustable up and down within an adjustable angle range, after the user manually adjusts the angle of the fixed camera, there will be a certain deviation in the conversion relationship between the image coordinates of the fixed camera's image and the PTZ coordinates of the PTZ camera, which ultimately results in deviations in "look where you point" and the tracking position. Since there is no sensor to directly detect the deviation angle when the fixed camera lens is manually adjusted, it is impossible to directly know the position of the fixed camera after the user's adjustment, and thus impossible to directly know the deviation of the coordinate conversion, resulting in a low accuracy of the linkage between the fixed camera and the PTZ camera.
[0006] In a first aspect, the present application provides a method for gun-ball integrated camera linkage calibration. The gun-ball integrated camera includes a fixed camera and a PTZ camera, and the fixed camera is a camera with manually adjustable angle. The method includes:
[0007] Acquire the current image captured by the bullet camera;
[0008] Based on the adjustable angle range of the bullet camera, the PTZ camera is controlled to rotate to multiple positions, and corresponding position images captured by the PTZ camera at the multiple positions are obtained;
[0009] Based on the current image and multiple position images, determine the target rotation angle of the PTZ camera;
[0010] Based on the target rotation angle, perform linkage calibration of the bullet camera and the PTZ camera.
[0011] In one possible implementation, determining the target rotation angle of the PTZ camera based on the current image and multiple position images includes:
[0012] Determine the central region of the current image;
[0013] Determine multiple similarities between the central region and multiple location images;
[0014] The image with the highest similarity among the multiple similarity values is determined as the target image;
[0015] Among the plurality of locations, determine the target location corresponding to the target image;
[0016] Based on the target position, determine the target rotation angle of the PTZ camera.
[0017] In one possible implementation, determining the target rotation angle of the PTZ camera based on the target position includes:
[0018] Obtain the initial position of the PTZ camera;
[0019] Determine the angle difference between the target position and the initial position;
[0020] The angle difference is determined as the target rotation angle of the PTZ camera.
[0021] In one possible implementation, determining the similarity between the central region and the location image for any given location image includes:
[0022] Determine the regional characteristics corresponding to the central region;
[0023] Determine the image features corresponding to the location image;
[0024] The region features are matched with the image features to determine the matching result;
[0025] Based on the matching results, the similarity between the central region and the location image is determined.
[0026] In one possible implementation, the PTZ camera is controlled to rotate to multiple positions according to the adjustable angle range of the bullet camera, including:
[0027] Obtain the preset angle interval;
[0028] The plurality of adjustment angles are determined based on the preset angle interval and the adjustable angle range;
[0029] Control the PTZ camera to rotate to the position corresponding to each adjustment angle.
[0030] In one possible implementation, determining the plurality of adjustable angles based on the preset angle interval and the adjustable angle range includes:
[0031] Obtain the initial angle;
[0032] The plurality of adjustment angles are determined based on the preset angle interval, the adjustable angle range, and the initial angle, wherein the initial angle is the first adjustment angle, the adjustment angle is within the adjustable angle range, and the difference between any two adjacent adjustment angles is the preset angle interval.
[0033] In one possible implementation, the linkage calibration of the bullet camera and the PTZ camera is performed based on the target rotation angle, including:
[0034] Obtain the angular relationship between the bullet camera and the PTZ camera, wherein the angular relationship is a mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial gimbal angle coordinates of the PTZ camera;
[0035] Based on the target rotation angle, the multiple initial gimbal angle coordinates are calibrated to obtain multiple target gimbal angle coordinates;
[0036] Based on the multiple pixel coordinates and the multiple target PTZ angle coordinates, the angular relationship between the bullet camera and the PTZ camera is calibrated to achieve the linkage calibration of the bullet camera and the PTZ camera.
[0037] Secondly, this application provides a gun-ball linkage calibration device for a bullet-ball integrated camera, wherein the bullet-ball integrated camera includes a bullet camera and a PTZ camera, the bullet camera being a manually adjustable camera, and the device includes:
[0038] The acquisition module is used to acquire the current image captured by the bullet camera;
[0039] The control module is used to control the PTZ camera to rotate to multiple positions according to the adjustable angle range of the bullet camera, and to acquire the corresponding position images captured by the PTZ camera at the multiple positions;
[0040] The determination module is used to determine the target rotation angle of the PTZ camera based on the current image and multiple position images;
[0041] The calibration module is used to perform joint calibration of the bullet camera and the PTZ camera based on the target rotation angle.
[0042] In one possible implementation, the determining module is specifically used for:
[0043] Determine the central region of the current image;
[0044] Determine multiple similarities between the central region and multiple location images;
[0045] The image with the highest similarity among the multiple similarity values is determined as the target image;
[0046] Among the plurality of locations, determine the target location corresponding to the target image;
[0047] Based on the target position, determine the target rotation angle of the PTZ camera.
[0048] In one possible implementation, the determining module is specifically used for:
[0049] Obtain the initial position of the PTZ camera;
[0050] Determine the angle difference between the target position and the initial position;
[0051] The angle difference is determined as the target rotation angle of the PTZ camera.
[0052] In one possible implementation, for any given location image, the determining module is specifically used for:
[0053] Determine the regional characteristics corresponding to the central region;
[0054] Determine the image features corresponding to the location image;
[0055] The region features are matched with the image features to determine the matching result;
[0056] Based on the matching results, the similarity between the central region and the location image is determined.
[0057] In one possible implementation, the control module is specifically used for:
[0058] Obtain the preset angle interval;
[0059] The plurality of adjustment angles are determined based on the preset angle interval and the adjustable angle range;
[0060] Control the PTZ camera to rotate to the position corresponding to each adjustment angle.
[0061] In one possible implementation, the control module is specifically used for:
[0062] Obtain the initial angle;
[0063] The plurality of adjustment angles are determined based on the preset angle interval, the adjustable angle range, and the initial angle, wherein the initial angle is the first adjustment angle, the adjustment angle is within the adjustable angle range, and the difference between any two adjacent adjustment angles is the preset angle interval.
[0064] In one possible implementation, the calibration module is specifically used for:
[0065] Obtain the angular relationship between the bullet camera and the PTZ camera, wherein the angular relationship is a mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial gimbal angle coordinates of the PTZ camera;
[0066] Based on the target rotation angle, the multiple initial gimbal angle coordinates are calibrated to obtain multiple target gimbal angle coordinates;
[0067] Based on the multiple pixel coordinates and the multiple target PTZ angle coordinates, the angular relationship between the bullet camera and the PTZ camera is calibrated to achieve the linkage calibration of the bullet camera and the PTZ camera.
[0068] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0069] The memory stores computer-executed instructions;
[0070] The processor executes computer execution instructions stored in the memory to implement the method described in any of the first aspects.
[0071] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0072] Fifthly, this application provides a computer program product, including a computer program that, when executed by a computer, implements the method as described in any one of the first aspects.
[0073] This application provides a method and program product for PTZ camera linkage calibration. By acquiring the current image captured by the bullet camera, and controlling the PTZ camera to rotate to multiple positions according to the bullet camera's adjustable angle range, corresponding position images are acquired by the PTZ camera at each position. Based on the current image and multiple position images, the target rotation angle of the PTZ camera is determined. Based on the target rotation angle, linkage calibration of the bullet and PTZ cameras is performed. This eliminates the need for a sensor at the bullet camera to detect its rotation angle. The target rotation angle is determined by multiple position images captured by the PTZ camera rotating to various positions within its adjustable angle range, as well as the current image captured by the bullet camera. Since the target rotation angle of the PTZ camera is approximately the same as that of the bullet camera, calibration based on the target rotation angle improves the accuracy of the bullet and PTZ camera linkage. Attached Figure Description
[0074] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0075] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0076] Figure 2 This is a schematic diagram illustrating another application scenario provided by an embodiment of this application;
[0077] Figure 3 A schematic flowchart illustrating a gun-ball linkage calibration method provided in an embodiment of this application;
[0078] Figure 4 A schematic diagram of a PTZ camera provided in an embodiment of this application;
[0079] Figure 5 A schematic flowchart of another gun-ball linkage calibration method provided in an embodiment of this application;
[0080] Figure 6 A schematic diagram of a gun bolt image provided in an embodiment of this application;
[0081] Figure 7 A schematic diagram of multiple location images provided in an embodiment of this application;
[0082] Figure 8 A schematic flowchart illustrating another gun-ball linkage calibration method provided in this application embodiment;
[0083] Figure 9 A schematic diagram of a gun-ball linkage calibration device for a gun-ball integrated camera provided in this application embodiment;
[0084] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0085] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0086] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0087] It should be noted that although the terms "first," "second," etc., are used to describe various types of information in the embodiments of this application, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. Optionally, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information.
[0088] It should be understood that the terms "comprising" or "including" indicate the presence of the previously mentioned features, steps, or operations, but do not preclude the presence, occurrence, or addition of one or more other features, steps, or operations. The terms "and / or," etc., used in this application can be interpreted as inclusive, or mean any one or any combination thereof. Optionally, "A and / or B" means "any one of the following: A; B; A and B." Additionally, the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0089] The integrated bullet and dome camera can be composed of a bullet camera and a dome camera. The bullet camera can be used for monitoring fixed scenes in a large range, covering a wide area, such as large-scale places like roads, squares, and parks, to ensure an understanding of the overall environment. The dome camera can rotate flexibly and is used to achieve precise focusing on a specific area and multi-angle monitoring. Through the combination of the bullet camera and the dome camera, multiple linkage functions such as bullet-dome linkage tracking and "look where you point" can be achieved.
[0090] For the bullet-dome linkage tracking function, if a target object appears in the picture of the bullet camera, the integrated bullet and dome camera can obtain the image coordinates corresponding to the target object in the bullet camera picture, and convert the image coordinates into the pan-tilt coordinates of the dome camera according to the preset angle relationship between the bullet camera and the dome camera. The dome camera rotates to the target position according to the pan-tilt coordinates to photograph the target object, so as to achieve the tracking of the target object.
[0091] Next, in combination with Figure 1 , an example is given to illustrate the bullet-dome linkage tracking function.
[0092] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Please refer to Figure 1 , Figure 1 It may include an integrated bullet and dome camera 100. The integrated bullet and dome camera 100 may include a dome camera 101 and a bullet camera 102. The dome camera 101 may include a dome camera lens 1011, and the bullet camera 102 may include a bullet camera lens 1021. The dome camera lens 1011 can capture a dome camera picture 103, and the bullet camera lens 1021 can capture a bullet camera picture 104.
[0093] Suppose the dome camera picture 103 originally captured by the dome camera 101 is a table, and when a stranger is detected in the bullet camera picture 104 by the bullet camera 102.
[0094] The bullet camera 102 can determine the pixel coordinates of the stranger and send the pixel coordinates to the integrated bullet and dome camera 100. The integrated bullet and dome camera 100 converts the pixel coordinates into the pan-tilt angle coordinates of the dome camera lens 1011 according to the preset angle relationship and sends the pan-tilt angle coordinates to the dome camera 101. The dome camera 101 controls the dome camera lens 1011 to rotate to the target position according to the pan-tilt angle coordinates, so that the dome camera picture 103 captured by the dome camera lens 1011 is the stranger, so as to achieve the bullet-dome linkage tracking function.
[0095] Next, in combination with Figure 2 , an example is given to illustrate the bullet-dome linkage tracking function.
[0096] Figure 2 This is another schematic diagram of an application scenario provided by an embodiment of the present application. Please refer to Figure 2 , Figure 2It may include a PTZ camera 100, which may include a PTZ camera 101 and a bullet camera 102. The PTZ camera 101 may include a PTZ camera 1011, and the bullet camera 102 may include a bullet camera 1021. The PTZ camera 1011 may capture PTZ camera footage 103, and the bullet camera 1021 may capture bullet camera footage 104.
[0097] Assume that the camera image 104 captured by the bullet camera 102 includes object A and object B, and the central area corresponding to the camera image 104 originally captured by the PTZ camera 101 is object B.
[0098] When a user selects object A on the touchscreen corresponding to the bullet camera's view 104, the bullet camera 102 can determine the pixel coordinates of object A and send the pixel coordinates to the bullet-and-ball integrated camera 100. The bullet-and-ball integrated camera 100 can convert the pixel coordinates into the pan-tilt angle coordinates of the PTZ camera 1011 according to the preset angle relationship, and send the pan-tilt angle coordinates to the PTZ camera 101. The PTZ camera 101 controls the PTZ camera 1011 to rotate to the target position according to the pan-tilt angle coordinates, so that the center area corresponding to the PTZ view 103 captured by the PTZ camera 1011 is object A, so as to realize the "point and see" function.
[0099] In related technologies, to better meet users' actual shooting needs, the camera lens is configured to be manually adjustable up and down within an adjustable angle range. After the user manually adjusts the camera lens angle, a certain deviation will occur in the conversion relationship between the camera lens image coordinates and the PTZ camera's pan-tilt coordinates, ultimately resulting in "point-and-shoot" and tracking position deviations. Since there is no sensor to directly detect the deviation angle when the camera lens is manually adjusted, the position of the camera after the user's adjustment cannot be directly known, and therefore the coordinate conversion deviation cannot be directly known, leading to low accuracy in the linkage between the camera lens and the PTZ camera.
[0100] To address the aforementioned technical problems, this application provides a method for calibrating the linkage between the bullet and PTZ cameras. This method involves acquiring the current image captured by the bullet camera, controlling the PTZ camera to rotate to multiple positions based on its adjustable angle range, and acquiring corresponding position images captured by the PTZ camera at each position. Based on the current image and the multiple position images, the target rotation angle of the PTZ camera is determined. Then, based on the target rotation angle, the linkage calibration of the bullet and PTZ cameras is performed. This eliminates the need for a sensor at the bullet camera to detect its rotation angle. The target rotation angle is determined by combining the corresponding position images captured by the PTZ camera at its adjustable angle range with the current image captured by the bullet camera. Since the target rotation angle of the PTZ camera is approximately the same as that of the bullet camera, calibration based on the target rotation angle improves the accuracy of the linkage between the bullet and PTZ cameras.
[0101] The technical solutions shown in this application will now be described in detail through specific embodiments. It should be noted that the following embodiments may exist independently or in combination with each other; for the same or similar content, the description will not be repeated in different embodiments.
[0102] Figure 3 This is a flowchart illustrating a camera-tilt-zoom (PTZ) linkage calibration method provided in an embodiment of this application. The executing entity in this embodiment can be a combined camera and a PTZ camera, which includes a bullet camera and a PTZ camera. See also... Figure 3 The method includes:
[0103] S301. Acquire the current image captured by the bullet camera.
[0104] The current image can be an image captured by the bullet camera after the user has manually adjusted the bullet camera.
[0105] An angle calibration control can be displayed on the terminal device. In response to the user's click on the angle calibration control, the terminal device can send an angle calibration command to the bullet camera. In response to the angle calibration command sent by the terminal device, the bullet camera can be controlled to shoot and acquire the current image captured by the bullet camera.
[0106] Among them, the terminal device can be a device that is bound to the PTZ camera, and the PTZ camera can be controlled through the terminal device.
[0107] Angle calibration commands can be used to instruct PTZ cameras to perform angle calibration.
[0108] Angle calibration commands can be generated by the user clicking the angle calibration control displayed on the corresponding interactive interface of the terminal device after manually adjusting the bullet camera. The terminal device responds to the click operation of the angle calibration control and generates a command to instruct the integrated bullet and PTZ camera to perform angle calibration.
[0109] S302. Based on the adjustable angle range of the bullet camera, control the PTZ camera to rotate to multiple positions and acquire the corresponding position images captured by the PTZ camera at multiple positions.
[0110] The adjustable angle range can be a preset angle range.
[0111] For example, the adjustable angle range is within 10° in the vertical direction.
[0112] Multiple positions can be the positions to which the PTZ camera rotates according to multiple adjustment angles. Each of the multiple positions corresponds to a different adjustment angle, and all of the multiple adjustment angles are within the adjustable angle range.
[0113] Position images can be images captured by a PTZ camera from multiple positions and corresponding viewpoints.
[0114] Multiple adjustment angles can be determined based on the adjustable angle range. Based on these multiple adjustment angles, the PTZ camera can be controlled to rotate to multiple positions, and images of the corresponding positions captured by the PTZ camera at these multiple positions can be obtained.
[0115] S303. Based on the current image and multiple position images, determine the target rotation angle of the PTZ camera.
[0116] The rotation angle can be used to represent the angle by which the PTZ camera has rotated compared to its initial position.
[0117] The target rotation angle of a PTZ camera can be approximately the same as that of a bullet camera.
[0118] Below, in conjunction with Figure 4 The principle that the target rotation angle of a PTZ camera is approximately the same as that of a bullet camera will be further explained.
[0119] Figure 4 This is a schematic diagram of a PTZ camera provided as an embodiment of this application. Please refer to [link / reference]. Figure 4 , Figure 4 This can include a combined camera and a ball camera.
[0120] In a bullet camera system, when the bullet camera is in its initial position, the center point of the image it captures is point A1. When the PTZ camera is in its initial position, the center point of the image it captures is point A2. Since the distance between the two cameras is very small (within 10cm), at greater distances (above 3m), A1 and A2 can be approximated as the same point.
[0121] When the bullet camera rotates X°, the center point of the captured image is point B1. When the PTZ camera rotates X°, the center point of the captured image is point B2. Since the distance between the two cameras is very small (within 10cm), at a greater distance (above 3m), B1 and B2 can be approximated as the same point.
[0122] In this way, by controlling the PTZ camera to rotate to multiple positions and capture multiple positional images, and knowing the adjustment angle of the PTZ camera when capturing multiple positional images, the target image with the highest similarity is determined by comparing the multiple positional images with the current image (i.e., determining point B2, which is the same as point B1 in the current image, among the multiple positional images). Based on the target image, the target rotation angle of the PTZ camera can be determined. Since the target rotation angle of the PTZ camera is approximately the same as the rotation angle of the bullet camera, the rotation angle of the bullet camera can be determined, thus improving the accuracy of the linkage between the bullet camera and the PTZ camera.
[0123] The target image with the highest similarity to the current image can be identified from multiple position images. Based on the adjustment and scheduling corresponding to the target image, the target rotation angle of the PTZ camera can be determined.
[0124] S304. Based on the target rotation angle, perform linkage calibration of the bullet camera and the PTZ camera.
[0125] Linkage calibration can be used to calibrate the angular relationship between bullet cameras and PTZ cameras. The angular relationship can be the mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial PTZ angle coordinates of the PTZ camera, with multiple pixel coordinates corresponding one-to-one with multiple initial PTZ angle coordinates.
[0126] It can obtain the angular relationship between the bullet camera and the PTZ camera, and calibrate the angular relationship between the bullet camera and the PTZ camera according to the target rotation angle.
[0127] Optionally, the linkage calibration of the bullet camera and the PTZ camera can be performed as follows: obtain the angular relationship between the bullet camera and the PTZ camera, where the angular relationship is the mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial gimbal angle coordinates of the PTZ camera; calibrate the multiple initial gimbal angle coordinates according to the target rotation angle to obtain multiple target gimbal angle coordinates; calibrate the angular relationship between the bullet camera and the PTZ camera according to the multiple pixel coordinates and the multiple target gimbal angle coordinates, so as to achieve the linkage calibration of the bullet camera and the PTZ camera.
[0128] For example, suppose the angle relationship is: initial gimbal angle coordinates = f (pixel coordinates).
[0129] Where f (pixel coordinates) is a preset conversion algorithm.
[0130] The calibrated angular relationship is: target gimbal angle coordinates = f (pixel coordinates) + X°.
[0131] Where X is the target rotation angle.
[0132] The PTZ camera linkage calibration method provided in this embodiment acquires the current image captured by the bullet camera; controls the PTZ camera to rotate to multiple positions according to the adjustable angle range of the bullet camera, and acquires corresponding position images captured by the PTZ camera at each position; determines the target rotation angle of the PTZ camera based on the current image and multiple position images; and performs linkage calibration of the bullet camera and PTZ camera based on the target rotation angle. This eliminates the need for a sensor at the bullet camera to detect its rotation angle. The target rotation angle is determined based on multiple position images captured by the PTZ camera rotating to multiple positions within its adjustable angle range, as well as the current image captured by the bullet camera. Since the target rotation angle of the PTZ camera is approximately the same as the rotation angle of the bullet camera, calibration based on the target rotation angle improves the accuracy of the bullet camera and PTZ camera linkage.
[0133] Below, in conjunction with Figure 5 The process of determining the target rotation angle of the PTZ camera based on the current image and multiple position images (S303) is explained.
[0134] Figure 5 This is a flowchart illustrating another gun-ball linkage calibration method provided in an embodiment of this application. Based on the above embodiments, see [link to relevant documentation]. Figure 5 The method is described in detail below. The method includes:
[0135] S501. Determine the central region of the current image.
[0136] The central region can be the image area corresponding to a pre-defined pixel range.
[0137] The pixel range of the central area is the same as the pixel range of the image captured by the bullet camera.
[0138] It can obtain a preset pixel range and determine the center region of the current image based on the pixel range.
[0139] Below, in conjunction with Figure 6 An example is given of the central region of the current image.
[0140] Figure 6 This is a schematic diagram of a gun bolt camera provided as an embodiment of this application. Please refer to... Figure 6 , Figure 6 It can include a first screen and a second screen.
[0141] Suppose a scene includes multiple objects such as A, B, C, D, E, and F.
[0142] Please refer to the first screen, which may be the current image captured by the bullet camera.
[0143] Please refer to the second screen, which is based on the first screen and determines the central region of the current image. The central region can be indicated by the dotted line area in the second screen.
[0144] S502. Determine the multiple similarities between the central region and multiple location images respectively.
[0145] Similarity can be used to represent the degree of similarity between a location image and its central region.
[0146] Below, in conjunction with Figure 7 Examples of multiple location images are provided for illustration.
[0147] Figure 7 This is a schematic diagram illustrating multiple location images provided in an embodiment of this application. Please refer to [link / reference]. Figure 7 , Figure 7 It can include a central region and multiple location images.
[0148] Multiple similarities between multiple location images and the central region can be determined sequentially.
[0149] A preset algorithm can be used to determine multiple similarities between the central region and multiple location images.
[0150] Optionally, for any location image, the similarity between the central region and the location image can be determined as follows: determine the regional features corresponding to the central region; determine the image features corresponding to the location image; perform feature matching between the regional features and the image features to determine the matching result; and determine the similarity between the central region and the location image based on the matching result.
[0151] Among them, region features can be used to describe the features corresponding to the central region, image features can be used to describe the features corresponding to the location image, and the matching result is used to represent the degree of similarity between region features and image features.
[0152] S503. The image with the highest similarity among multiple similarity values is identified as the target image.
[0153] The target image is the image at the location with the highest similarity.
[0154] For example, assuming the second location image is the image with the highest similarity, the second location image is identified as the target image.
[0155] S504. Among multiple locations, determine the target location corresponding to the target image.
[0156] The target location can be the location where the PTZ camera captures the target image.
[0157] It can acquire image information of the target image and determine the target location corresponding to the target image from multiple locations based on the image information.
[0158] S505: Obtain the initial position of the PTZ camera.
[0159] The initial position of the PTZ camera can be either the position when the PTZ camera is not rotating, or a preset position to which the PTZ camera has rotated.
[0160] The center point of the image captured by the PTZ camera at its initial position is the same as the center point of the image captured by the bullet camera at its initial position.
[0161] The initial position of the PTZ camera can be obtained from the storage space.
[0162] S506. Determine the angle difference between the target position and the initial position.
[0163] The first angle corresponding to the target position can be determined, the initial angle corresponding to the initial position can be determined, and the difference between the first angle and the second angle can be determined as the angle difference.
[0164] S507. Determine the angle difference as the target rotation angle of the PTZ camera.
[0165] For example, if the angle difference is 2°, then the rotation angle of the PTZ camera is determined to be 2°.
[0166] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0167] This embodiment provides a camera-to-body camera linkage calibration method. By determining the central region of the current image, and then determining multiple similarity scores between the central region and multiple position images, the position image with the highest similarity score is identified as the target image. Among these multiple positions, the target position corresponding to the target image is determined, the initial position of the PTZ camera is obtained, and the angle difference between the target position and the initial position is determined. This angle difference is then used as the target rotation angle of the bullet camera. This eliminates the need for a sensor at the bullet camera to detect its rotation angle. By comparing multiple position images with the current image, the target rotation angle can be determined, and calibration can be performed based on this angle, improving the accuracy of bullet and PTZ camera linkage.
[0168] Below, in conjunction with Figure 8 The process of controlling the PTZ camera to rotate to multiple positions according to the adjustable angle range of the bullet camera (S302) will be explained.
[0169] Figure 8This is a flowchart illustrating another gun-ball linkage calibration method provided in this application embodiment. Based on the above embodiments, see [link to relevant documentation]. Figure 8 The method is described in detail below. The method includes:
[0170] S801, Obtain the preset angle interval.
[0171] The preset angle interval can be a pre-set angle interval.
[0172] For example, the preset angle interval is 2°.
[0173] The preset angle interval can be obtained from the storage space.
[0174] S802, Obtain the initial angle.
[0175] The initial angle can be the initial angle corresponding to the initial position of the bullet camera.
[0176] The initial angle can be obtained from the storage space.
[0177] S803. Determine multiple adjustment angles based on preset angle intervals, adjustable angle ranges, and initial angles.
[0178] The initial angle is the first adjustment angle, which is within the adjustable angle range. The difference between any two adjacent adjustment angles is the preset angle interval.
[0179] The ratio of the adjustable angle range to the preset angle interval can be used to determine the number of adjustments, obtain the first initial angle, determine the first initial angle as the first adjustment angle, and determine the sum of the i-th adjustment angle and the preset angle interval as the (i+1)-th adjustment angle; where i takes the values 1, 2, ..., n in sequence, n is the number of adjustments, and the multiple adjustment angles include i+1 adjustment angles.
[0180] S804 controls the PTZ camera to rotate to the position corresponding to each adjustment angle.
[0181] For example, multiple adjustment angles are available: 0°, 2°, 4°, 6°, 8°, and 10°.
[0182] Then, control the PTZ camera to rotate to the corresponding positions of 0°, 2°, 4°, 6°, 8°, and 10° respectively.
[0183] The implementation details of each step in this application embodiment can be found in the description of the corresponding steps or operations in the above method embodiments; repeated content will not be repeated.
[0184] The PTZ camera linkage calibration method provided in this embodiment obtains an initial angle by acquiring a preset angle interval. Based on the preset angle interval, the adjustable angle range, and the initial angle, multiple adjustment angles are determined. The initial angle is the first adjustment angle, and the adjustment angles are within the adjustable angle range. The difference between any two adjacent adjustment angles is the preset angle interval. The PTZ camera is then controlled to rotate to the position corresponding to each adjustment angle. This eliminates the need for a sensor at the PTZ camera to detect its rotation angle. By controlling the PTZ camera to rotate to multiple positions corresponding to multiple adjustment angles and capturing multiple position images, the target rotation angle is determined, and calibration is performed based on the target rotation angle, thus improving the accuracy of the PTZ camera linkage.
[0185] Figure 9 This is a schematic diagram of a camera-tilt-zoom (PTZ) linkage calibration device for an integrated PDSLR camera, provided as an embodiment of this application. Please refer to... Figure 9 The integrated bullet and PTZ camera includes a bullet camera and a PTZ camera. The device 900 includes an acquisition module 901, a control module 902, a determination module 903, and a calibration module 904.
[0186] The acquisition module 901 is used to acquire the current image captured by the bullet camera;
[0187] The control module 902 is used to control the PTZ camera to rotate to multiple positions according to the adjustable angle range of the bullet camera, and to acquire the corresponding position images captured by the PTZ camera at the multiple positions.
[0188] The determining module 903 is used to determine the target rotation angle of the PTZ camera based on the current image and multiple position images;
[0189] The calibration module 904 is used to perform linkage calibration of the bullet camera and the PTZ camera according to the target rotation angle.
[0190] In one possible implementation, the determining module 903 is specifically used for:
[0191] Determine the central region of the current image;
[0192] Determine multiple similarities between the central region and multiple location images;
[0193] The image with the highest similarity among the multiple similarity values is determined as the target image;
[0194] Among the plurality of locations, determine the target location corresponding to the target image;
[0195] Based on the target position, determine the target rotation angle of the PTZ camera.
[0196] In one possible implementation, the determining module 903 is specifically used for:
[0197] Obtain the initial position of the PTZ camera;
[0198] Determine the angle difference between the target position and the initial position;
[0199] The angle difference is determined as the target rotation angle of the PTZ camera.
[0200] In one possible implementation, for any given location image, the determining module 903 is specifically used for:
[0201] Determine the regional characteristics corresponding to the central region;
[0202] Determine the image features corresponding to the location image;
[0203] The region features are matched with the image features to determine the matching result;
[0204] Based on the matching results, the similarity between the central region and the location image is determined.
[0205] In one possible implementation, the control module 902 is specifically used for:
[0206] Obtain the preset angle interval;
[0207] The plurality of adjustment angles are determined based on the preset angle interval and the adjustable angle range;
[0208] Control the PTZ camera to rotate to the position corresponding to each adjustment angle.
[0209] In one possible implementation, the control module 902 is specifically used for:
[0210] Obtain the initial angle;
[0211] The plurality of adjustment angles are determined based on the preset angle interval, the adjustable angle range, and the initial angle, wherein the initial angle is the first adjustment angle, the adjustment angle is within the adjustable angle range, and the difference between any two adjacent adjustment angles is the preset angle interval.
[0212] In one possible implementation, the calibration module 904 is specifically used for:
[0213] Obtain the angular relationship between the bullet camera and the PTZ camera, wherein the angular relationship is a mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial gimbal angle coordinates of the PTZ camera;
[0214] Based on the target rotation angle, the multiple initial gimbal angle coordinates are calibrated to obtain multiple target gimbal angle coordinates;
[0215] Based on the multiple pixel coordinates and the multiple target PTZ angle coordinates, the angular relationship between the bullet camera and the PTZ camera is calibrated to achieve the linkage calibration of the bullet camera and the PTZ camera.
[0216] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Please refer to... Figure 10 The electronic device 1000 may include: a memory 1001, a processor 1002, and a transceiver 1003.
[0217] Memory 1001 is used to store program instructions;
[0218] The processor 1002 is used to execute the program instructions stored in the memory so that the electronic device 1000 performs the above-described method.
[0219] Transceiver 1003 may include a transmitter and / or a receiver. The transmitter may also be referred to as a transmitter, transmitter, transmitting port, or transmitting interface, and the receiver may also be referred to as a receiver, receiving port, or receiving interface, etc. Exemplarily, memory 1001, processor 1002, and transceiver 1003 are interconnected via bus 1004.
[0220] This application also provides a computer program product that can be executed by a processor, and when the computer program product is executed, the above-described method can be implemented.
[0221] The angle calibration device, electronic device, computer-readable storage medium, and computer program product of the embodiments of this application can execute the technical solution shown in the above-described gun-ball linkage calibration method embodiments. Their implementation principles and beneficial effects are similar, and will not be described again here.
[0222] All or part of the steps in the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a readable memory. When the program is executed, it performs the steps of the above-described method embodiments; and the aforementioned memory (storage medium) includes: read-only memory (ROM), random access memory (RAM), flash memory, hard disk, solid-state drive, magnetic tape, floppy disk, optical disc, and any combination thereof.
[0223] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-executable instructions. These computer-executable instructions can be provided to a processing unit of a general-purpose computer, special-purpose computer, embedded processor, or other programmable angle calibration device to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable angle calibration device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0224] These computer-executable instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable angle calibration device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0225] These computer-executed instructions can also be loaded onto a computer or other programmable angle calibration device, causing a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable device for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0226] Obviously, those skilled in the art can make various modifications and variations to the embodiments of this application without departing from the spirit and scope of this application. Therefore, if these modifications and variations to the embodiments of this application fall within the scope of the claims of this application and their equivalents, this application also intends to include these modifications and variations.
Claims
1. A method for calibrating the linkage between a bullet camera and a PTZ camera, characterized in that, The integrated bullet and PTZ camera includes a bullet camera and a PTZ camera, wherein the bullet camera is a manually adjustable camera, and the method includes: Acquire the current image captured by the bullet camera; Based on the adjustable angle range of the bullet camera, the PTZ camera is controlled to rotate to multiple positions, and corresponding position images captured by the PTZ camera at the multiple positions are obtained; Based on the current image and multiple position images, the target rotation angle of the PTZ camera is determined, wherein the target rotation angle is determined according to the target position corresponding to the position image with the highest similarity among the multiple position images; Based on the target rotation angle, perform linkage calibration of the bullet camera and the PTZ camera.
2. The method according to claim 1, characterized in that, Determining the target rotation angle of the PTZ camera based on the current image and multiple position images includes: Determine the central region of the current image; Determine multiple similarities between the central region and multiple location images; The image with the highest similarity among the multiple similarity values is determined as the target image; Among the plurality of locations, determine the target location corresponding to the target image; Based on the target position, determine the target rotation angle of the PTZ camera.
3. The method according to claim 2, characterized in that, Determining the target rotation angle of the PTZ camera based on the target position includes: Obtain the initial position of the PTZ camera; Determine the angle difference between the target position and the initial position; The angle difference is determined as the target rotation angle of the PTZ camera.
4. The method according to claim 2 or 3, characterized in that, For any given location image, determining the similarity between the central region and the location image includes: Determine the regional characteristics corresponding to the central region; Determine the image features corresponding to the location image; The region features are matched with the image features to determine the matching result; Based on the matching results, the similarity between the central region and the location image is determined.
5. The method according to any one of claims 1-3, characterized in that, Based on the adjustable angle range of the bullet camera, the PTZ camera is controlled to rotate to multiple positions, including: Obtain the preset angle interval; Based on the preset angle interval and the adjustable angle range, multiple adjustment angles are determined; Control the PTZ camera to rotate to the position corresponding to each adjustment angle.
6. The method according to claim 5, characterized in that, The plurality of adjustable angles are determined based on the preset angle interval and the adjustable angle range, including: Obtain the initial angle; The plurality of adjustment angles are determined based on the preset angle interval, the adjustable angle range, and the initial angle, wherein the initial angle is the first adjustment angle, the adjustment angle is within the adjustable angle range, and the difference between any two adjacent adjustment angles is the preset angle interval.
7. The method according to any one of claims 1-3, characterized in that, Based on the target rotation angle, perform coordinated calibration of the bullet camera and the PTZ camera, including: Obtain the angular relationship between the bullet camera and the PTZ camera, wherein the angular relationship is a mapping relationship between multiple pixel coordinates of the bullet camera and multiple initial gimbal angle coordinates of the PTZ camera; Based on the target rotation angle, the multiple initial gimbal angle coordinates are calibrated to obtain multiple target gimbal angle coordinates; Based on the multiple pixel coordinates and the multiple target PTZ angle coordinates, the angular relationship between the bullet camera and the PTZ camera is calibrated to achieve the linkage calibration of the bullet camera and the PTZ camera.
8. A camera-ball linkage calibration device for a PTZ camera, characterized in that, The integrated bullet and PTZ camera includes a bullet camera and a PTZ camera, wherein the bullet camera is a manually adjustable camera. The device includes: The acquisition module is used to acquire the current image captured by the bullet camera; The control module is used to control the PTZ camera to rotate to multiple positions according to the adjustable angle range of the bullet camera, and to acquire the corresponding position images captured by the PTZ camera at the multiple positions; The determination module is used to determine the target rotation angle of the PTZ camera based on the current image and multiple position images. The target rotation angle is determined based on the target position corresponding to the position image with the highest similarity among the multiple position images. The calibration module is used to perform joint calibration of the bullet camera and the PTZ camera based on the target rotation angle.
9. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 7.
11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Gun-ball linkage tracking method and device, computer equipment and storage medium
CN111885301A
Method and apparatus for controlling linkage between ball camera and gun camera, and medium
WO2020182176A1