Camera preset position adjusting method and device, equipment and storage medium
By calculating the image similarity of the video conferencing terminal equipment under different PTZ coordinates, the camera preset position is automatically adjusted, which solves the problem of manually adjusting the lens steering and focus after the camera position changes, and improves the user experience.
Patent Information
- Application Number
- CN202311585423.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-24
- Publication Date
- 2024-10-18
AI Technical Summary
Existing video conferencing terminal equipment requires users to manually adjust the lens rotation and focus after the camera position is changed, resulting in inconvenience.
By acquiring images at the initial preset position and different PTZ coordinates, the similarity of each image is calculated, and the camera's preset position is automatically adjusted to match the PTZ coordinates and shooting parameters of the image with the highest similarity.
The camera position is automatically set when the camera position changes, reducing the number of manual adjustments by the user and improving ease of use.
Smart Images

Figure CN118803423A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of camera control technology, and in particular, relates to a camera preset position adjustment method, device, equipment and storage medium. Background Art
[0002] With the development of the Internet, video conferencing has good network support and its functions are gradually improved. Due to the needs of remote office and online courses, video conferencing terminal equipment is becoming more and more popular among the public. The main peripherals of video conferencing terminal equipment are: microphone, speaker, camera, etc. Many cameras are equipped with electronic pan-tilt, which can control the steering and focal length of the lens to meet different usage scenarios.
[0003] When users change cameras or move cameras in a small range, current video conferencing terminal devices usually require users to re-control the electronic pan / tilt to set the camera lens's rotation and focal length so that the captured images meet the needs of the conference. As a result, users experience inconvenience when using cameras and conference terminals, and they need to manually adjust the camera every time a small change occurs. Summary of the invention
[0004] In view of one or more of the above problems, the present invention provides a camera preset position adjustment method, device, equipment and storage medium, which can automatically complete the setting of the camera position when the camera changes, and can be convenient for users to use.
[0005] In a first aspect, an embodiment of the present application provides a camera preset position adjustment method, comprising:
[0006] Acquire a first image captured by the camera at an initial preset position, and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates;
[0007] Calculate the similarity between each second image and the first image respectively;
[0008] According to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera, the preset position of the camera is adjusted to obtain the target preset position of the camera.
[0009] In some possible implementations, respectively calculating the similarity between each second image and the first image includes:
[0010] Compare the pixels at corresponding positions in the second image and the first image to obtain the number of similar pixels whose similarity meets a preset condition;
[0011] Based on the number of similar pixels and the total number of pixels of the first image, a similarity is determined.
[0012] In some possible implementations, the same preset position includes preset position images under multiple scene information; and obtaining a first image captured by a camera at an initial preset position includes:
[0013] Get current scene information;
[0014] Searching for a preset position image corresponding to target scene information corresponding to the current scene information from an image set corresponding to the initial preset position;
[0015] The preset position image corresponding to the target scene information is determined as the first image.
[0016] In some possible implementations, the current scene information includes lighting information.
[0017] In some possible implementations, adjusting the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera includes:
[0018] Determine the target key value corresponding to the second image with the highest similarity;
[0019] According to the target key value, the target gimbal coordinates and the target shooting parameters corresponding to the target key value are searched from the key-value pair mapping relationship, where the key-value pair mapping relationship is a mapping relationship between each key value and the corresponding gimbal coordinates and shooting parameters;
[0020] The target preset position of the camera is determined based on the target pan / tilt coordinates and target shooting parameters.
[0021] In some possible implementations, determining the target key value corresponding to the second image with the highest similarity includes:
[0022] Obtaining a target key value according to the first key-value pair corresponding to the second image;
[0023] According to the target key value, the target gimbal coordinates and target shooting parameters corresponding to the target key value are found from the key-value pair mapping relationship, including:
[0024] According to the target key value, find and obtain the corresponding second key-value pair;
[0025] The corresponding target gimbal coordinates and target shooting parameters are obtained according to the second key-value pair.
[0026] In some possible implementations, obtaining a first image captured by a camera at an initial preset position and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates includes:
[0027] Acquire a first image captured by the camera at an initial preset position and the pan / tilt coordinates and shooting parameters corresponding to the first image;
[0028] Sending a rotation command to the camera according to the PTZ coordinates and shooting parameters, the rotation command is used to rotate based on the PTZ coordinates and shooting parameters and continuously shoot during the rotation process;
[0029] A plurality of second images captured by the camera at a plurality of different pan / tilt coordinates are received.
[0030] In a second aspect, an embodiment of the present application provides a camera preset position adjustment device, characterized in that the device comprises:
[0031] An acquisition module, used to acquire a first image captured by the camera at an initial preset position, and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates;
[0032] A processing module, used for respectively calculating the similarity between each second image and the first image;
[0033] The adjustment module is used to adjust the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera.
[0034] In a third aspect, an embodiment of the present application provides a camera preset position adjustment device, characterized in that the device includes: a processor, and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the camera preset position adjustment method as described above.
[0035] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that computer program instructions are stored on the computer storage medium, and when the computer program instructions are executed by a processor, the camera preset position adjustment method as described above is implemented.
[0036] The camera preset position adjustment method, device, equipment and storage medium of the embodiment of the present application obtains a first image captured by the camera at the initial preset position, and multiple second images captured by the camera at multiple different pan-tilt coordinates; respectively calculates the similarity between each second image and the first image; adjusts the camera preset position according to the pan-tilt coordinates corresponding to the second image with the highest similarity and the camera shooting parameters, and obtains the target preset position of the camera. The pictures taken after the user manually completes the camera settings are saved in advance. When the situation of the camera changes, such as the camera position changes or the camera is replaced, resulting in the need to readjust the camera, the camera pan-tilt coordinates and focal length parameters are changed in a preset order and the pictures are taken. According to the similarity between each captured picture and the pre-saved picture, it is determined what pan-tilt coordinates and focal length parameters are most similar to the previous situation, and the camera preset position is determined by the pan-tilt coordinates and focal length parameters. Therefore, the camera position setting can be automatically completed when the camera changes, which is convenient for users. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention can be better understood from the following description of specific embodiments of the present invention in conjunction with the accompanying drawings, in which:
[0038] Other features, objects and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings, in which the same or similar reference numerals represent the same or similar features.
[0039] Figure 1 It is a flowchart of a camera preset position adjustment method provided by an embodiment of the present application;
[0040] Figure 2 is a flowchart of a camera preset position adjustment method provided by another embodiment of the present application;
[0041] Figure 3 It is a structural schematic diagram of a camera preset position adjustment device provided by an embodiment of the present application;
[0042] Figure 4 It is a schematic diagram of the hardware structure of the camera preset position adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] The features and exemplary embodiments of various aspects of the present invention will be described in detail below. In the detailed description below, many specific details are proposed to provide a comprehensive understanding of the present invention. However, it is obvious to those skilled in the art that the present invention can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present invention by illustrating examples of the present invention. The present invention is by no means limited to any specific configuration and algorithm proposed below, but covers any modification, replacement and improvement of elements, parts and algorithms without departing from the spirit of the present invention. In the accompanying drawings and the following description, known structures and technologies are not shown to avoid unnecessary ambiguity to the present invention.
[0044] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0045] USB Video Class (UVC): A protocol standard defined for USB video capture devices.
[0046] Video Control Interface (VC): A descriptor used in UVC to represent functions that control the behavior of video devices. It is divided into standard VC interfaces and special class interfaces.
[0047] Video Stream Interface (VS): The interface in UVC that is responsible for transmitting video stream data.
[0048] With the development of the Internet, video conferencing has good network support and its functions are gradually improved. Due to the needs of remote office and online courses, video conferencing terminal equipment is becoming more and more popular among the public. The main peripherals of video conferencing terminal equipment are: microphone, speaker, camera, etc. Many cameras are equipped with electronic pan-tilt, which can control the steering and focal length of the lens to meet different usage scenarios.
[0049] In the prior art, each time a user powers on a video conferencing terminal, they must manually set the camera lens's steering and focal length to meet the needs of different users each time. Moreover, after a user changes a camera or moves the camera in a small range, the current video conferencing terminal device usually requires the user to re-control the electronic pan / tilt to set the camera lens's steering and focal length so that the captured image meets the needs of the conference. As a result, users experience inconveniences when using cameras and conference terminals, and they need to manually adjust the camera every time a slight change occurs to the camera.
[0050] The inventor has studied the above problem and found that after the camera is changed, it is usually only necessary to make some fine adjustments to the position and parameters of the camera to capture a picture that is basically similar to the previous one. However, if the user manually makes such fine adjustments, the user experience will be greatly affected. If the camera is allowed to automatically adjust and capture corresponding images within a certain range, by comparing the currently captured images with the images captured before the camera was changed and calculating the similarity, the image with the highest similarity can be selected. The shooting condition of the camera position corresponding to this image is closest to that before the camera was changed. The camera can automatically shoot based on this position, eliminating the need for manual adjustments by the user, making it convenient for users to use.
[0051] Based on the above research findings, the present application provides a specific implementation of a camera preset position adjustment method.
[0052] Figure 1 FIG. 1 is a flow chart of a method for adjusting a camera preset position provided by an embodiment of the present application. Figure 1 As shown, the camera preset position adjustment method provided in the embodiment of the present application includes the following steps S101 to S103.
[0053] Step S101: acquiring a first image captured by a camera at an initial preset position and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates.
[0054] The preset position function usually refers to the preset monitoring position and camera status. The monitoring probe with the preset position function is generally equipped with a pan / tilt and a zoom lens. When the pan / tilt moves to the place where the focus needs to be shot, a command to set the preset point is sent to the camera, and the camera records the pan / tilt position and the camera status at this time, and associates it with the preset point number. When the preset position call command is sent to the camera, the pan / tilt immediately moves to the point at the fastest speed, and the camera also returns to the state remembered at that time, so that the user can quickly view the filmed area. The initial preset position can be the preset position set by the user before the camera changes.
[0055] The first image may be an image captured by a camera at an initial preset position.
[0056] The second image may be an image captured by the camera at different pan / tilt coordinates during the process of automatically adjusting the position of the camera.
[0057] In a specific implementation, after receiving an instruction to move the pan / tilt to a specified position, the pan / tilt coordinates in the instruction will be parsed first, and then the pan / tilt motor will be driven to move the pan / tilt to the specified position. When the pan / tilt moves to the specified position, the camera will automatically shoot at the current position and save the captured image as the second image. In addition, the first image that has been stored in advance can also be obtained.
[0058] Step S102: Calculate the similarity between each second image and the first image respectively.
[0059] In a specific implementation, the first image and each second image can be converted into a suitable feature representation. This can be achieved by using algorithms such as histogram matching or matrix decomposition. For histogram matching, the histograms of the first image and each second image can be calculated respectively. Then, the similarity between the two histograms is measured by calculating the normalized correlation coefficient of the two histograms, such as the Bhattacharyya distance or the histogram intersection distance. For matrix decomposition, each image can be regarded as a matrix, and a mathematical matrix decomposition method, such as singular value decomposition or non-negative matrix decomposition, can be used to obtain some representative features in the matrix. Then, these features can be used to calculate the similarity between the images. Next, for each second image, the above steps can be repeated to calculate its similarity with the first image. Finally, the similarity between the image contents can be judged based on the calculated similarity scores.
[0060] Step S103: adjusting the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain a target preset position of the camera.
[0061] Shooting parameters can be various settings of the camera that affect the image when shooting, such as focal length, aperture, and shutter speed.
[0062] The target preset position may be a preset position determined after adjustment or after the camera is moved.
[0063] In a specific implementation, after calculating the similarity between each second image and the first image, the second image with the highest similarity is selected. This second image will be used to determine the target preset position of the camera. From the selected second image, the position coordinates of the camera pan / tilt at that time and the camera shooting parameters, such as focal length, zoom ratio, rotation angle, etc., can be extracted. According to the acquired pan / tilt coordinates and shooting parameters, the preset position of the camera can be automatically adjusted. The adjustment here may include moving the pan / tilt to the corresponding position and adjusting the camera shooting parameters. After the adjustment is completed, the state of the camera can be confirmed again to confirm whether the target preset position has been reached. Usually, this step can be completed by observing the picture taken by the camera or by system detection. If the preset position of the camera has reached the target state, the whole process is completed. If the target state is not reached, the above steps may need to be repeated until the preset position of the camera reaches the target state.
[0064] The camera preset position adjustment method of the embodiment of the present application obtains a first image captured by the camera at the initial preset position, and a plurality of second images captured by the camera at a plurality of different pan-tilt coordinates; respectively calculates the similarity between each second image and the first image; and adjusts the camera preset position according to the pan-tilt coordinates corresponding to the second image with the highest similarity and the camera shooting parameters to obtain the target preset position of the camera. The pictures taken after the user manually completes the camera settings are saved in advance. When the situation of the camera changes, such as the position of the camera changes or the camera is replaced, resulting in the need to readjust the camera, the pan-tilt coordinates and focal length parameters of the camera are changed in a preset order and the pictures are taken. According to the similarity between each captured picture and the pre-saved picture, it is determined what pan-tilt coordinates and focal length parameters are most similar to the previous situation for shooting, and the camera preset position is determined by using the pan-tilt coordinates and focal length parameters. Therefore, the camera position setting can be automatically completed when the camera changes, which is convenient for users.
[0065] In some implementations, respectively calculating the similarity between each second image and the first image includes:
[0066] The pixels at corresponding positions in the second image and the first image are compared to obtain the number of similar pixels whose similarity meets a preset condition.
[0067] It is understandable that when the camera position moves, the resolution of the photo taken by the camera is still the same as before, that is, the pixels in the second image and the first image can correspond one to one, and the pixels at the corresponding positions can be the pixels at the same position in the picture. When the camera is replaced, the resolution of the photo taken by the replaced camera may be different from the previous one. In this case, the resolution of the second image taken by the replaced camera can be converted to the same as the first image through a preset mapping algorithm, and the pixels at the corresponding positions are determined after the conversion.
[0068] In a specific implementation, because the second image may have a different resolution from the first image, first, the second image needs to be registered with the first image. This usually involves steps such as feature point matching and transformation model fitting to align the two images. The accuracy of the registration will affect the accuracy of subsequent similarity calculations. After the images are registered, the pixels at corresponding positions of the two images can be compared. Usually, some metrics, such as the grayscale value, color, texture, etc. of the pixel, are selected to calculate the similarity. For example, the difference in the RGB color value or grayscale value of the pixel can be used to calculate the similarity. According to actual needs, a preset condition can be set to determine the number of similar pixels. For example, a threshold can be set, and when the difference between two pixels is less than the threshold, they are considered to be similar. According to the preset conditions, the number of similar pixels in the two images can be counted.
[0069] Based on the number of similar pixels and the total number of pixels of the first image, a similarity is determined.
[0070] In a specific implementation, after obtaining the number of similar pixels, the ratio of the number of similar pixels to the total number of pixels of the first image can be directly calculated, and this value can be used as the similarity. For example, if the resolution of the first image is 1080P, there are a total of 1920×1080=2073600 pixels, and if 1451520 pixels are similar pixels, then according to the ratio of the number of similar pixels to the total number of pixels of the first image, the similarity can be obtained as 0.7.
[0071] The above method of this embodiment compares the pixels at the corresponding positions in the second image and the first image to obtain the number of similar pixels whose similarity meets the preset conditions; and determines the similarity based on the number of similar pixels and the total number of pixels in the first image. Calculating the image similarity based on the number of similar pixels can obtain a more accurate image similarity.
[0072] In some implementations, the same preset position includes preset position images under multiple scene information; acquiring a first image captured by a camera at an initial preset position includes:
[0073] Get the current scene information.
[0074] The current scene information may be information about various factors that may affect shooting in the scene where the camera is currently located.
[0075] In a specific implementation, the camera may determine the current scene information according to the captured image, or, for example, may obtain the current time information as the scene information through a clock in the camera.
[0076] The preset position image corresponding to the target scene information corresponding to the current scene information is searched from the image set corresponding to the initial preset position.
[0077] There are multiple pictures in the image set corresponding to the initial preset position, including pictures taken in different scenes. Then, the images in the image set corresponding to the initial preset position and the corresponding scene information can be saved. After obtaining the current scene information, the initial preset position image similar to the current scene information can be obtained by searching according to the current scene information.
[0078] The preset position image corresponding to the target scene information is determined as the first image.
[0079] In a specific implementation, after the preset position image corresponding to the target scene information is found, the image can be used as the first image.
[0080] It is understandable that even if other conditions are the same, pictures taken at different times or in different weather conditions will be different. The above method of this embodiment obtains the current scene information; searches for the preset position image corresponding to the target scene information corresponding to the current scene information from the image set corresponding to the initial preset position; and determines the preset position image corresponding to the target scene information as the first image. Different preset position images can be used in different environments to prevent problems in similarity comparison caused by different environments.
[0081] In some implementations, the current scene information includes lighting information.
[0082] It is understandable that most cameras are equipped with a brightness sensor, so the light intensity can be sensed through the built-in brightness sensor. The brightness sensor is usually located on the front of the camera, and it can measure the intensity of light reaching the lens surface. The sensor converts the light intensity into an electrical signal, which is used as the lighting information in the current scene information.
[0083] Taking light intensity as an environmental parameter is easier to implement because cameras, as light-sensing devices, generally have the function of detecting light intensity. And light intensity has a direct impact on the captured pictures, so it is more reasonable.
[0084] In some implementations, adjusting the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera includes the following steps S201 to S203.
[0085] Step S201: Determine the target key value corresponding to the second image with the highest similarity.
[0086] The target key value may be a unique identifier of an image, and the unique identifier is saved as a key value and the image in a key-value pair.
[0087] In a specific implementation, after calculating the similarity scores of each second image with the first image, the second image with the highest similarity is selected. This second image will be used to determine the target preset position of the camera. Then, the corresponding memory or database is searched to retrieve the corresponding target key value.
[0088] Step S202: according to the target key value, searching for the target gimbal coordinates and target shooting parameters corresponding to the target key value from the key-value pair mapping relationship, where the key-value pair mapping relationship is a mapping relationship between each key value and the corresponding gimbal coordinates and shooting parameters.
[0089] When shooting the second picture, the gimbal coordinates and shooting parameters when shooting the second picture can be obtained at the same time, and then the gimbal coordinates and shooting parameters are saved with the target key value in the form of a key-value pair.
[0090] In a specific implementation, once the target key value is obtained, the target gimbal coordinates and target shooting parameters corresponding to the target key value can be retrieved through the key-value pair mapping relationship. This search operation can be implemented by database query.
[0091] Step S203: determining the target preset position of the camera based on the target pan / tilt coordinates and the target shooting parameters.
[0092] In a specific implementation, once the target pan / tilt coordinates and target shooting parameters corresponding to the target key value are found, the position of the camera can be adjusted according to the target pan / tilt coordinates and target shooting parameters to determine the target preset position of the camera.
[0093] The above method of this embodiment determines the target key value corresponding to the second image with the highest similarity; according to the target key value, searches for the target pan-tilt coordinates and target shooting parameters corresponding to the target key value from the key-value pair mapping relationship, and the key-value pair mapping relationship is the mapping relationship between each key value and the corresponding pan-tilt coordinates and shooting parameters; determines the target preset position of the camera based on the target pan-tilt coordinates and target shooting parameters. After determining the second image, the corresponding pan-tilt coordinates and shooting parameters can be quickly found according to the key-value pair relationship, so as to determine the target preset position of the camera.
[0094] In some implementations, determining the target key value corresponding to the second image with the highest similarity includes:
[0095] A target key value is obtained according to the first key-value pair corresponding to the second image.
[0096] The first key-value pair may be a key-value pair formed by binding an image and a key value.
[0097] In a specific implementation, the corresponding target key value may be retrieved according to the first key-value pair corresponding to the second image.
[0098] According to the target key value, the target gimbal coordinates and target shooting parameters corresponding to the target key value are found from the key-value pair mapping relationship, including:
[0099] According to the target key value, find and obtain the corresponding second key-value pair.
[0100] The second key-value pair may be a key-value pair formed by binding the gimbal coordinates and the shooting parameters to the key value.
[0101] The corresponding target gimbal coordinates and target shooting parameters are obtained according to the second key-value pair.
[0102] In a specific implementation, according to the second key-value pair, the corresponding target pan-tilt coordinates and target shooting parameters can be retrieved. The target pan-tilt coordinates and target shooting parameters can be one of the key-value pair mapping relationships established previously. In addition, the mark number related to the camera position can be used as a key value to form a first key-value pair with the corresponding image. The electronic pan-tilt coordinates and focal length parameters of the camera are encapsulated into two parts in the form of a key-value pair, and then the camera mark number is used as the key value, and the key-value pair of the camera electronic pan-tilt coordinates and focal length is used as the value to encapsulate a new key-value pair, which is the second key-value pair.
[0103] The above method of this embodiment obtains the target key value according to the first key value pair corresponding to the second image; according to the target key value, finds the corresponding second key value pair; and obtains the corresponding target gimbal coordinates and target shooting parameters according to the second key value pair. The preset position storage uses key value pair binding to improve the efficiency of matching images with coordinates.
[0104] In some implementations, obtaining a first image captured by a camera at an initial preset position and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates includes:
[0105] A first image captured by the camera at an initial preset position and the pan / tilt coordinates and shooting parameters corresponding to the first image are obtained.
[0106] Prior to this, when the camera is in the initial preset position, the first image is captured using the preset shooting parameters. This first image can be in color or black and white, and can be processed according to a preset image processing algorithm, such as denoising, enhancement, segmentation, etc., to improve the image quality. Once the first image is obtained, it needs to be stored together with the pan / tilt coordinates and shooting parameters used at the time of shooting.
[0107] In a specific implementation, a corresponding memory or database may be read to obtain the first image and the gimbal coordinates and shooting parameters corresponding to the first image.
[0108] A rotation command is sent to the camera according to the pan-tilt coordinates and shooting parameters, and the rotation command is used to rotate based on the pan-tilt coordinates and shooting parameters and continuously shoot during the rotation process.
[0109] In the specific implementation, the camera controls the pan / tilt motor to rotate according to the received rotation command. During the rotation process, the camera will continuously shoot according to the specified shooting parameters and record each frame. The continuous images captured will be saved in the memory or hard disk for subsequent processing or analysis. These data can also be transmitted to other devices or servers through the network for further processing.
[0110] A plurality of second images captured by the camera at a plurality of different pan / tilt coordinates are received.
[0111] The above method of this embodiment obtains the first image captured by the camera at the initial preset position and the PTZ coordinates and shooting parameters corresponding to the first image; sends a rotation command to the camera according to the PTZ coordinates and shooting parameters, and the rotation command is used to rotate based on the PTZ coordinates and shooting parameters and continuously shoot during the rotation process; receives multiple second images captured by the camera at multiple different PTZ coordinates. Compared with the method of traversing to obtain the second image, it is faster and can complete the camera preset position adjustment faster.
[0112] In some embodiments, after the user completes the camera settings, the electronic pan-tilt coordinates and focal length parameters of the camera, as well as the preset position pictures taken by the camera are saved. In the case of changes in the camera, the electronic pan-tilt coordinates and focal length parameters of the camera are traversed. At the same time, the camera is allowed to shoot, and the captured pictures are compared with the preset position pictures to obtain similarity. After the traversal is completed, the preset position is updated according to the electronic pan-tilt coordinates and focal length parameters of the picture with the highest similarity. It can also be updated according to the picture after detecting that the similarity of the picture reaches a preset threshold.
[0113] Specifically, after the user controls the electronic pan-tilt to rotate to the desired position and adjusts the focal length, the conference terminal sends the preset position mark number to the camera through the UVC video control interface. For example, after the user controls the electronic pan-tilt to adjust the camera, he sends a confirmation message to the conference terminal. After receiving the confirmation message, the conference terminal sends the preset position mark number to the camera. It can also be that after the conference terminal detects that the user has not controlled the pan-tilt for more than a preset time, it is determined that the user has completed the setting and sends the preset position mark number. After that, after the camera obtains the preset position mark number sent by the conference terminal through the UVC VideoContri Interface instruction, the current electronic pan-tilt coordinates of the camera and the focal length parameters corresponding to the camera are saved to the local camera. Specifically, the electronic pan-tilt coordinates and focal length parameters of the camera are encapsulated in the form of a key-value pair, and then the above-mentioned preset position mark number is used as the key value, and the key-value pair of the camera electronic pan-tilt coordinates and focal length is used as the value, and it is encapsulated into a new key-value pair again. The binding of the camera preset position mark number with the camera electronic pan-tilt coordinates and focal length is completed.
[0114] After the binding is completed, the bound data is sent to the conference terminal through the VC of UVC. Specifically, after the camera receives the camera preset position mark number sent by the conference terminal through VC and has completed the binding of the electronic pan / tilt coordinates and focal length with the camera preset position mark number, it immediately captures a frame of video data and sends it to the conference terminal through the UVC video stream interface.
[0115] After the conference terminal obtains the electronic pan / tilt coordinates and focal length sent by the camera and binds them to the mark number of the camera preset position through VC, the binding data is saved locally in the conference terminal in the form of a key-value pair, where the key value of the key-value pair is named with the mark number of the camera preset position, and the obtained frame of video data is saved locally as a JPG format image file, which is named with the mark number of the camera preset position.
[0116] The image file named with the camera preset position mark serial number and the key-value pair are bound again and saved locally in the video conferencing terminal. The user can find the corresponding camera preset position mark serial number through the image. Specifically, a display can be connected to the video conferencing terminal. The user can clearly see the preset position images of various scenes set before on the display, and select the corresponding image according to the current required scene.
[0117] In this way, after the user selects the corresponding picture of the required scene on the video conferencing terminal, the conference terminal finds the key-value pair corresponding to the camera preset position according to the binding relationship between the picture and the key-value pair. If the preset position mark serial number and the key values of the camera's electronic pan-tilt coordinates and focal length have been saved in the camera, the video conferencing terminal can also only send the preset position mark serial number, and the camera will adjust according to the pan-tilt coordinates and focal length key values corresponding to the serial number. Then the corresponding key-value pair is sent to the camera through VC. After receiving the preset position key-value pair sent by the video conferencing terminal, the camera parses the focal length of the camera and the coordinates of the electronic pan-tilt. Then, the pan-tilt is rotated and the focal length is adjusted according to the parsed focal length and coordinates of the electronic pan-tilt.
[0118] If the camera environment changes, the camera can be controlled to rotate for one circle and the focal length can be controlled to traverse. During the rotation process, each frame of data is compared with the preset position picture, and the corresponding coordinates, focal length and picture overlap rate are recorded in the form of key-value pairs. After one circle of rotation, the corresponding serial number with the highest picture overlap rate is found. In addition, at different time points, the pictures at the same position will be different due to different ambient lighting. The camera can be allowed to shoot and save pictures at different time points, and then the pictures closest to the time point are compared when the preset position is updated. Furthermore, in different seasons and different weather conditions, the lighting conditions at the same time point will also be different. The camera can be allowed to shoot and save pictures under different light intensities, and then the pictures with the closest light intensity are used for comparison when the preset position is updated. The conference terminal parses the coordinates and focal length information of the camera through the serial number to obtain the new preset position information.
[0119] When the user is in use, the preset position images that have been set to be activated can be displayed. After selecting a preset position to be activated, the coordinates and focal length parameters of the pan / tilt will be issued. When the camera pan / tilt rotates to the specified coordinates and focal length position, the real-time image will be compared with the preset position image. When the image with the highest similarity is matched, it will be considered that the position is the actual position of the preset position that needs to be activated.
[0120] In addition, presets can be stored on the control terminal side and the camera side. The terminal side is the master device, and the camera side is the slave device. When the master device initiates the activation of presets to the slave device, the slave device first determines whether the parameters of the local and master devices are consistent. If they are inconsistent, a pop-up window prompt is displayed on the master device to inform the user that the master and slave devices do not match the presets activated this time. If the user continues to choose to activate, the presets are activated according to the parameters of the master device. In this way, the preset data can be stored in two places to avoid direct access to other devices and improve security.
[0121] Based on the camera preset position adjustment method provided in the above embodiment, the present application also provides a specific implementation of a camera preset position adjustment device. Please refer to the following embodiment.
[0122] See first Figure 3 The camera preset position adjustment device 300 provided in the embodiment of the present application includes the following modules:
[0123] An acquisition module 301 is used to acquire a first image captured by the camera at an initial preset position, and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates;
[0124] The processing module 302 is used to calculate the similarity between each second image and the first image respectively;
[0125] The adjustment module 303 is used to adjust the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera.
[0126] The above method of this embodiment obtains the first image captured by the camera at the initial preset position, and multiple second images captured by the camera at multiple different pan-tilt coordinates; respectively calculates the similarity between each second image and the first image; and adjusts the preset position of the camera according to the pan-tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera. The pictures taken after the user manually completes the camera settings are saved in advance. When the situation of the camera changes, such as the position of the camera changes or the camera is replaced, resulting in the need to readjust the camera, the pan-tilt coordinates and focal length parameters of the camera are changed in a preset order and the pictures are taken. According to the similarity between each captured picture and the pre-saved picture, it is determined what pan-tilt coordinates and focal length parameters are most similar to the previous situation, and the camera preset position is determined by the pan-tilt coordinates and focal length parameters. Therefore, the setting of the camera position can be automatically completed when the camera changes, which is convenient for users.
[0127] As an implementation of the present application, the processing module 302 is further configured to determine the similarity based on the number of similar pixels and the total number of pixels of the first image. In this implementation, the camera preset position adjustment device 300 may also include:
[0128] The comparison module is used to compare the pixels at corresponding positions in the second image and the first image to obtain the number of similar pixels whose similarity meets a preset condition.
[0129] The above method of this embodiment obtains the similarity of images by comparing the pixels in the images, and can obtain a more accurate second image.
[0130] As an implementation of the present application, the acquisition module 301 is also used to acquire current scene information. In this implementation, the camera preset position adjustment device 300 may also include:
[0131] A search module, used to search for a preset position image corresponding to target scene information corresponding to current scene information from an image set corresponding to an initial preset position;
[0132] The determination module is used to determine the preset position image corresponding to the target scene information as the first image.
[0133] The above method of this embodiment uses different preset position pictures in different environments to prevent problems in similarity comparison caused by different environments.
[0134] As an implementation manner of the present application, the current scene information includes lighting information.
[0135] The above method of this embodiment uses light intensity as an environmental parameter, because cameras as light-sensing devices generally have the function of detecting light intensity, so it is easier to implement. And light intensity has a direct impact on the captured picture, so it is more reasonable.
[0136] As an implementation method of the present application, the determination module is also used to determine the target key value corresponding to the second image with the highest similarity; the search module is also used to search for the target gimbal coordinates and target shooting parameters corresponding to the target key value from the key-value pair mapping relationship according to the target key value, and the key-value pair mapping relationship is a mapping relationship between each key value and the corresponding gimbal coordinates and shooting parameters; the determination module is also used to determine the target preset position of the camera based on the target gimbal coordinates and the target shooting parameters.
[0137] The above method of this embodiment obtains the corresponding pan / tilt coordinates and shooting parameters by searching the key value corresponding to the second image, and can accurately determine the position of the camera preset position adjustment.
[0138] As an implementation method of the present application, the processing module 302 is also used to obtain the target key value according to the first key-value pair corresponding to the second image; the search module is also used to search and obtain the corresponding second key-value pair according to the target key value; the processing module 302 is also used to obtain the corresponding target gimbal coordinates and target shooting parameters according to the second key-value pair.
[0139] The above method of this embodiment uses key-value pair binding in the preset position storage, which improves the adaptation efficiency of the image and the coordinates.
[0140] As an implementation of the present application, the acquisition module 301 is also used to acquire the first image captured by the camera at the initial preset position and the pan / tilt coordinates and shooting parameters corresponding to the first image. In this implementation, the camera preset position adjustment device 300 may also include:
[0141] A sending module, used for sending a rotation command to the camera according to the PTZ coordinates and shooting parameters, wherein the rotation command is used for rotating the camera based on the PTZ coordinates and shooting parameters and continuously shooting during the rotation process;
[0142] The receiving module is used to receive a plurality of second images shot by the camera at a plurality of different pan / tilt coordinates.
[0143] The above method of this embodiment is faster than the method of traversing to acquire the second image, and the camera preset position adjustment can be performed faster.
[0144] Figure 4 A schematic diagram of the hardware structure of a camera preset position adjustment device provided in an embodiment of the present application is shown.
[0145] The camera preset position adjustment device may include a processor 401 and a memory 402 storing computer program instructions.
[0146] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0147] Memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, memory 402 may be inside or outside of an integrated gateway disaster recovery device. In a specific embodiment, memory 402 is a non-volatile solid-state memory.
[0148] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Therefore, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the data processing method according to any one embodiment of the present disclosure.
[0149] The processor 401 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 402 .
[0150] In one example, the data processing device may further include a communication interface 403 and a bus 410. Figure 4 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.
[0151] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.
[0152] Bus 410 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.
[0153] In addition, in combination with the data processing method in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data processing methods in the above embodiments is implemented.
[0154] However, it should be clear that the present invention is not limited to the specific configurations and processing methods described above and shown in the figures. Moreover, for the sake of simplicity, a detailed description of known methods and techniques is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present invention is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present invention.
[0155] The functional blocks shown in the above block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments that are used to perform the required tasks. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. Code segments can be downloaded via computer networks such as the Internet, intranets, etc.
[0156] The present invention can be implemented in other specific forms without departing from its spirit and essential features. For example, the algorithms described in the specific embodiments can be modified, and the system architecture does not depart from the basic spirit of the present invention. Therefore, the current embodiments are regarded as exemplary and non-restrictive in all aspects, and the scope of the present invention is defined by the appended claims rather than the above description, and all changes falling within the meaning and equivalent scope of the claims are thus included in the scope of the present invention.
[0157] Those skilled in the art should understand that the above embodiments are exemplary rather than restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on the study of the drawings, the specification and the claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other devices or steps; the indefinite article "a" does not exclude a plurality; the terms "first" and "second" are used to indicate names rather than to indicate any specific order. Any figure marks in the claims should not be understood as limiting the scope of protection. The functions of multiple parts appearing in the claims can be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.
Claims
1. A camera preset position adjustment method, characterized in that: include: Acquire a first image captured by the camera at an initial preset position, and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates; Calculate the similarity between each second image and the first image respectively; According to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera, the preset position of the camera is adjusted to obtain the target preset position of the camera.
2. The camera preset position adjustment method according to claim 1, characterized in that: The respectively calculating the similarity between each second image and the first image comprises: Compare pixels at corresponding positions in the second image and the first image to obtain the number of similar pixels whose similarity meets a preset condition; A similarity is determined based on the number of similar pixels and the total number of pixels of the first image.
3. The camera preset position adjustment method according to claim 1, characterized in that: The same preset position includes preset position images under multiple scene information; the first image captured by the camera at the initial preset position is obtained, including: Get current scene information; Searching for a preset position image corresponding to the target scene information corresponding to the current scene information from the image set corresponding to the initial preset position; The preset position image corresponding to the target scene information is determined as the first image.
4. The camera preset position adjustment method according to claim 3, characterized in that: The current scene information includes lighting information.
5. The camera preset position adjustment method according to claim 1, characterized in that: The step of adjusting the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera includes: Determine the target key value corresponding to the second image with the highest similarity; According to the target key value, searching for the target gimbal coordinates and the target shooting parameters corresponding to the target key value from the key-value pair mapping relationship, wherein the key-value pair mapping relationship is a mapping relationship between each key value and the corresponding gimbal coordinates and shooting parameters; The target preset position of the camera is determined based on the target pan / tilt coordinates and the target shooting parameters.
6. The camera preset position adjustment method according to claim 5, characterized in that: The step of determining the target key value corresponding to the second image with the highest similarity comprises: Obtaining a target key value according to the first key-value pair corresponding to the second image; The step of searching, according to the target key value, the target gimbal coordinates and the target shooting parameters corresponding to the target key value from the key-value pair mapping relationship includes: According to the target key value, searching for a corresponding second key-value pair; The corresponding target gimbal coordinates and target shooting parameters are obtained according to the second key-value pair.
7. The camera preset position adjustment method according to any one of claims 1 to 6, characterized in that: The step of acquiring a first image captured by the camera at an initial preset position and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates includes: Acquire a first image captured by the camera at an initial preset position and the pan / tilt coordinates and shooting parameters corresponding to the first image; Sending a rotation command to the camera according to the pan-tilt coordinates and the shooting parameters, wherein the rotation command is used to rotate the camera based on the pan-tilt coordinates and the shooting parameters and continuously shoot during the rotation process; A plurality of second images captured by the camera at a plurality of different pan / tilt coordinates are received.
8. A camera preset position adjustment device, characterized in that: The device comprises: An acquisition module, used to acquire a first image captured by the camera at an initial preset position, and a plurality of second images captured by the camera at a plurality of different pan / tilt coordinates; A processing module, used for respectively calculating the similarity between each second image and the first image; The adjustment module is used to adjust the preset position of the camera according to the pan / tilt coordinates corresponding to the second image with the highest similarity and the shooting parameters of the camera to obtain the target preset position of the camera.
9. A camera preset position adjustment device, characterized in that: The device comprises: a processor and a memory storing computer program instructions; the processor reads and executes the computer program instructions to implement the camera preset position adjustment method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer storage medium stores computer program instructions, and when the computer program instructions are executed by the processor, the camera preset position adjustment method according to any one of claims 1 to 7 is implemented.
