Camera device control method, device, electronic equipment and storage medium
By detecting the image characteristics acquired by the imaging device and switching the imaging device with higher confidence, the problem of poor imaging effect of the shooting target is solved and a clearer image acquisition effect is achieved.
Patent Information
- Application Number
- CN202110246119.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-05
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-03-05
AI Technical Summary
In application scenarios such as security monitoring and traffic monitoring, due to factors such as low resolution of the camera device, interference with ambient light or shooting target movement, the imaging effect of the shooting target is poor.
By adopting an image capturing device control method, the confidence of the first image capturing device is determined by acquiring the image captured by the first image capturing device, detecting the target subject and extracting image features. If the confidence level is below the threshold, switch to the second imaging device for image acquisition to ensure higher confidence level.
It improves the imaging effect of the shooting system when collecting images on the shooting target, ensures that the imaging of the target subject is clear, and is suitable for a variety of monitoring application scenarios.
Smart Images

Figure CN115037870B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of imaging technology, and in particular to a camera control method, device, electronic device and storage medium. Background Art
[0002] At present, a shooting system including several cameras is widely used in security monitoring, traffic monitoring and other application scenarios. In the above application scenarios, it is often necessary to perform a series of data processing on a specific shooting target based on the images captured by the camera. For example, the police can use the images captured by the security monitoring system to find criminal suspects, and the traffic monitoring system can use the license plate recognition technology to automatically identify illegal vehicles from the captured images.
[0003] However, in practice, it is found that due to factors such as low resolution of the camera device, ambient light interference, or continuous movement of the target, the image of the target in the image captured by the camera device may not be clear enough, resulting in poor imaging effect of the target. Summary of the invention
[0004] The embodiments of the present application disclose a camera control method, a camera control device, an electronic device, and a storage medium, which can improve the imaging effect when a shooting system collects images of a shooting target.
[0005] An embodiment of the present application discloses a camera device control method, which is applied to a shooting system, wherein the shooting system includes at least a first camera device and a second camera device, and the method includes: acquiring a first image captured by the first camera device; detecting a target subject contained in the first image, and extracting image features of a subject image area corresponding to the target subject; determining a first confidence level corresponding to the first camera device based on the image features; and when the first confidence level is lower than a confidence level threshold, switching to the second camera device to capture an image of the target subject, and a second confidence level corresponding to the second camera device is higher than the first confidence level.
[0006] The embodiment of the present application discloses a control device, which is applied to a shooting system, wherein the shooting system includes at least a first camera device and a second camera device, and the control device is communicatively connected with the first camera device and the second camera device; the control device includes: an acquisition module, which is used to acquire a first image captured by the first camera device; a detection module, which is used to detect a target subject contained in the first image and extract image features of a subject image area corresponding to the target subject; a determination module, which is used to determine a first confidence level corresponding to the first camera device based on the image features; and a switching module, which is used to switch to the second camera device to capture an image of the target subject when the first confidence level is lower than a confidence level threshold, and a second confidence level corresponding to the second camera device is higher than the first confidence level.
[0007] An embodiment of the present application discloses an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor implements the camera device control method described in any one of the embodiments of the present application.
[0008] An embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the camera device control method described in any one of the embodiments of the present application is implemented.
[0009] Compared with the related art, the embodiments of the present application have the following beneficial effects:
[0010] When the first camera device performs image acquisition on the target subject to be photographed, the target subject is detected from the first image captured by the first camera device, and the image features of the subject image area corresponding to the target subject are extracted. Based on the extracted image features, the first confidence level corresponding to the first camera device can be determined. The first confidence level is compared with the confidence level threshold. If the first confidence level is lower than the confidence level threshold, it means that the imaging effect of the target subject in the first image is poor. Therefore, switching to the second camera device to perform image acquisition on the target subject is beneficial to improving the imaging effect when the shooting system performs image acquisition on the shooting target. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0012] Figure 1A is a schematic diagram of an application scenario of a shooting system disclosed in an embodiment of the present application;
[0013] Figure 1B is a schematic diagram of an application scenario of another shooting system disclosed in an embodiment of the present application;
[0014] Figure 2 It is a flowchart of a camera device control method disclosed in an embodiment of the present application;
[0015] Figure 3 A flowchart of another method for controlling a photographing device disclosed in an embodiment of the present application;
[0016] Figure 4 A flowchart of another method for controlling a photographing device disclosed in an embodiment of the present application;
[0017] Figure 5 is a flowchart of another method for controlling a photographing device disclosed in an embodiment of the present application;
[0018] Fig. 6A It is a schematic diagram of a moving trajectory of a target subject disclosed in an embodiment of the present application;
[0019] Figure 6B This is an example diagram of a target subject's movement trajectory not matching a normal behavior trajectory disclosed in an embodiment of the present application;
[0020] Figure 7 is a structural schematic diagram of a control device disclosed in an embodiment of the present application;
[0021] Figure 8 It is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application. DETAILED DESCRIPTION
[0022] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0023] It should be noted that the terms "including" and "having" and any variations thereof in the embodiments of the present application and the accompanying drawings are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products or devices.
[0024] The embodiments of the present application disclose a camera control method, a camera, an electronic device, and a storage medium, which can improve the imaging effect of a camera system when capturing images of a target. Detailed descriptions are given below.
[0025] See also Figure 1A , Figure 1A Schematic diagram of an application scenario of a shooting system disclosed in an embodiment of the present application. Figure 1A As shown, the shooting system may include a camera device 110, a camera device 120 and an electronic device 20. Among them:
[0026] The camera device 110, the camera device 120 and the electronic device 20 can all be independently packaged devices or equipment, and the camera device 110 and the camera device 120 can establish communication connections with the electronic device 20 respectively. Exemplarily, the camera device 110 and the camera device 120 may include a hemispherical surveillance camera, a gun-type camera, etc. commonly used in a closed-circuit television monitoring system, but are not limited thereto. The electronic device 20 may include a central control device, a central server, etc. in a closed-circuit television monitoring system, but are not limited thereto.
[0027] exist Figure 1A In the shooting system shown, the camera device 110 and the camera device 120 can be set at different geographical locations and face different shooting directions, so that the camera device 110 and the camera device 120 can shoot the target 30 from different angles. It should be noted that the embodiment of the present application does not limit the setting position and shooting direction of the camera device 110 and the camera device 120. The camera device 110 and the camera device 120 can capture images of the target 30 simultaneously or alternately. The images captured by the camera device 110 and the camera device 120 can be transmitted to the electronic device 20 through wireless or wired communication connections.
[0028] See also Figure 1B , Figure 1B is a schematic diagram of another application scenario of a shooting system disclosed in an embodiment of the present application. Figure 1B As shown, the shooting system may include at least a camera device 110 and a camera device 120 .
[0029] exist Figure 1B In the shooting system shown, the camera module of the electronic device 20 may include a camera device 110 and a camera device 120, and the camera device 110 and the camera device 120 may be packaged in the electronic device 20. The camera device 110 and the camera device 120 may be arranged on one side of the electronic device so that the camera device 110 and the camera device 120 face the same shooting direction. In addition, the viewing ranges of the camera device 110 and the camera device 120 may partially or completely overlap.
[0030] The electronic device 20 can shoot the target 30 through the camera device 110 and the camera device 120. The electronic device 20 may also include a control device such as a central processing unit (CPU) and a microcontroller (MCU). The camera device 110 and the camera device 120 may be respectively connected to the control device for communication, and the images captured by the camera device 110 and the camera device 120 may be respectively transmitted to the control device through a wireless or wired communication connection.
[0031] It should be noted that in the embodiment of the present application, the number of camera devices included in the shooting system may be greater than or equal to 2. Figure 1A and Figure 1B The shooting system is described by taking an example where the shooting system includes two shooting devices, which should not constitute a limitation on the number of shooting devices.
[0032] Based on the above-mentioned shooting system, the present application embodiment discloses a camera device control method. Figure 2 , Figure 2 1 is a flow chart of a camera device control method disclosed in an embodiment of the present application, and the method can be applied to the electronic device as described above. Figure 2 As shown, the camera device control method may include:
[0033] 210. Acquire a first image captured by a first camera device.
[0034] In an embodiment of the present application, the shooting system may include at least a first camera device and a second camera device. The first camera device may be a camera device that currently captures an image of a target subject of the shooting target. Exemplarily, in the aforementioned shooting system, if the camera device that currently captures an image of the target subject is the camera device 110, then the camera device 110 is the first camera device; if the camera device that currently captures an image of the target subject is the camera device 120, then the camera device 120 is the first camera device.
[0035] The electronic device can obtain the first image captured by the first camera device through the communication connection between the first camera device and the electronic device.
[0036] 220. Detect the target subject included in the first image, and extract image features of a subject image region corresponding to the target subject.
[0037] In the embodiment of the present application, the first image may include a target subject of the photographed object, and the electronic device may detect the target subject to determine the subject image area of the target subject in the first image. The electronic device may detect the target subject through user input, feature matching, or machine learning, but is not limited thereto.
[0038] In one embodiment, the electronic device may output the first image on a touch screen so that the user can search for a target subject in the first image. The user may input a touch operation such as clicking or drawing a circle on the touch screen for the target subject, and the electronic device may determine the image area of interest to the user based on the detected touch operation as the image area corresponding to the target subject.
[0039] In one embodiment, the electronic device may obtain a target image feature corresponding to the target subject, and the target image feature may be manually designed. The electronic device may search for an image feature matching the target image feature from the first image, so as to determine the subject image area corresponding to the target subject according to the image position of the matching image feature in the first image.
[0040] In one embodiment, the electronic device may also input the first image into a target recognition model, which may be obtained by training an artificial neural network model using a large number of sample images including the target subject. The above-mentioned artificial neural network model may include but is not limited to: Convolutional Neural Networks (CNN), Long Short-Term Memory (LSTM), etc. The target recognition model may identify the subject image area corresponding to the target subject from the first image based on the learned image features of the target subject.
[0041] In an embodiment of the present application, after the electronic device identifies the subject image area corresponding to the target subject from the first image through user input, feature matching or machine learning, it can extract image features of the subject image area. The extracted image features may include color, corner points, texture, light intensity, etc., but are not limited to this.
[0042] 230. Determine a first confidence level corresponding to the first camera device according to image features of the subject image area.
[0043] In the embodiment of the present application, the confidence level corresponding to a certain camera device can be used to characterize the imaging effect of the target subject in the image captured by the camera device, and the imaging effect of the target subject can be characterized by parameters such as the clarity, brightness or position of the target subject in the image. For example, the higher the clarity of the target subject in the image, the better the imaging effect; the darker the brightness of the target subject in the image, the worse the imaging effect; the closer the position of the target subject in the image is to the center of the image, the higher the imaging effect.
[0044] In the embodiment of the present application, after the electronic device obtains the image captured by the camera device and identifies the target subject from the image, it can focus, identify or track the target subject. The accuracy of the focus, identification or tracking process may be related to the imaging effect of the target subject in the image. Therefore, based on different application scenarios, the electronic device performs different processing operations on the image, and the above confidence may include but is not limited to: focus confidence, identification confidence or tracking confidence.
[0045] The focus confidence can be used to characterize the accuracy of the focus area determined by the camera device when the camera device currently performing image acquisition performs automatic focusing with the above-mentioned target subject as the focus. The better the effect of determining the pixel points in the subject image area based on the image features of the subject image area, the higher the accuracy of the focus area determined by the camera device, and the higher the focus confidence corresponding to the camera device can be determined by the electronic device.
[0046] The recognition confidence can be used to characterize the accuracy of identifying the photographed target based on the image captured by the camera device. The better the imaging effect of the target subject in the image, the higher the accuracy of the target recognition based on the image. Identifying the photographed target may refer to identifying whether the target subject matches a specific photographed target (such as a face or a license plate, etc.) based on the image features of the subject image area. Factors such as the angle of the target subject in the subject image area and the area occupied by the subject image area in the captured image may affect the accuracy of identifying the target subject. Therefore, the higher the accuracy of target recognition based on the image captured by the camera device, the higher the recognition confidence corresponding to the camera device can be determined by the electronic device.
[0047] Tracking confidence can be used to characterize the accuracy of tracking the target based on the image captured by the camera device. Tracking the target can refer to locating the same target subject in multiple frames of images. The better the imaging effect of the target subject in the current frame image, the higher the accuracy of the electronic device in predicting the image position of the target subject in the next frame image, the higher the success rate of tracking the target subject in the next frame image, and the less likely the target subject is to be lost. Therefore, if the probability of target loss is lower when tracking the target based on the image captured by the camera device, the electronic device can determine that the corresponding tracking confidence of the camera device is higher.
[0048] Accordingly, in the embodiment of the present application, the first confidence corresponding to the first camera device may include but is not limited to: a first focus confidence, a first recognition confidence or a first tracking confidence.
[0049] 240. When the first confidence level is lower than the confidence level threshold, switch to a second camera device to capture an image of the target subject, and a second confidence level corresponding to the second camera device is higher than the first confidence level.
[0050] In the embodiment of the present application, when the first confidence level corresponding to the first camera device is lower than the confidence level threshold, it can be considered that the imaging effect of the target subject in the image currently captured by the first camera device is low. The above confidence level threshold can be set according to actual business needs. If the imaging effect of the target is required to be high, the confidence level threshold can be set to a high value; if the imaging effect of the target is required to be low, the confidence level threshold can be set to a low value.
[0051] Since the shooting system includes other camera devices in addition to the first camera device, the electronic device can switch other camera devices in the shooting system to capture images of the target subject when the first confidence is lower than the confidence threshold. Among them, the second confidence corresponding to the switched second camera device can be higher than the first confidence corresponding to the first camera device, and the imaging effect of the target subject in the second image captured by the second camera device is higher than the imaging effect of the target subject in the first image. Switching to the second camera device to capture the image of the target subject can improve the imaging effect of the shooting system when capturing images of the shooting target. In addition, after the electronic device obtains the second image captured by the second camera device, due to the better imaging effect of the target subject in the second image, the accuracy of focusing, identifying and tracking the target subject based on the second image is higher. In the application scenario of focusing, the focus in the captured image can be always focused on the target subject by switching the camera device, and the target in the captured image is clear, which can enhance the sense of motion of the image. In the application scenario of recognition, the image with better imaging effect can be selected for target recognition by switching the camera device, which is conducive to improving the accuracy of recognition. In tracking application scenarios, switching of camera devices can reduce target loss, which is beneficial to maintaining the stability and accuracy of target tracking.
[0052] For example, assuming that the shooting system is Figure 1AAs shown, the first camera device is the camera device 110. When the camera device 110 captures an image of the target subject, the target subject may move to a position away from the light source relative to the camera device 110, resulting in the first confidence corresponding to the first camera device being lower than the confidence threshold, and the imaging effect of the target subject in the first image captured by the first camera device is poor. Since the camera devices 110 and 120 are set at different positions and shooting directions, the relative positional relationships between the camera devices 110 and 120 and the target subject and the light source are also different. When the target subject moves to a position away from the light source relative to the camera device 110, the target subject captured by the camera device 120 may be facing the light source. Therefore, the camera device 120 may be a second camera device whose corresponding second confidence is higher than the first confidence corresponding to the first camera device. The second camera device is switched to capture an image of the target subject, and the imaging effect of the target subject in the captured second image is improved compared with the first image.
[0053] For example, assuming that the shooting system is Figure 1B As shown, the first camera device is the camera device 110, and there is a partial overlapping area between the framing ranges of the camera device 110 and the camera device 120, and the framing ranges of the camera device 110 and the camera device 120 respectively include partial non-overlapping areas. When the camera device 110 captures the target subject, the target subject may move out of the framing range of the camera device 110 and enter the framing range of the camera device 120. Therefore, the camera device 120 can be used as a second camera device whose corresponding second confidence is higher than the first confidence corresponding to the first camera device, and the second camera device is switched to capture the image of the target subject. The target subject is within the framing range of the second camera device, so the imaging effect of the target subject in the second image captured by the second camera device can be higher than the imaging effect of the target subject in the first image captured by the first camera device.
[0054] It can be seen that based on the above-mentioned embodiments, the electronic device can monitor the first confidence level corresponding to the first camera device in real time when the first camera device is capturing images of the target subject. When the first confidence level decreases, the second camera device with a higher confidence level is switched to capture images of the target subject, thereby improving the imaging effect of the shooting system when capturing images of the target subject.
[0055] In an embodiment of the present application, the electronic device can select a first confidence from the focus confidence, recognition confidence or tracking confidence corresponding to the camera device according to the current application scenario of the shooting system, which are explained separately in the following contents.
[0056] See also Figure 3 , Figure 3FIG. 1 is a flow chart of another method for controlling a camera device disclosed in an embodiment of the present application, and the method can be applied to the electronic device as described above. Figure 3 As shown, the camera device control method may include:
[0057] 310. Acquire a first image captured by a first camera device.
[0058] 320. Detect the target subject included in the first image, and extract image features of a subject image region corresponding to the target subject.
[0059] 330. Determine a first focus confidence level corresponding to the first camera device according to image features of the subject image area.
[0060] In an embodiment of the present application, when the first camera device is capturing an image of the target subject, it can focus on the target subject through autofocus algorithms such as Phase Detection Auto Focus (PDAF), Time Of Flight (TOF), and Continuous Auto Focus (CAF). However, the focusing effect may change due to factors such as ambient light or sensor performance, and the focus confidence of the camera device can directly reflect the focusing effect. Therefore, in the process of tracking and shooting the target subject, the first focus confidence corresponding to the first camera device may change due to the movement of the target subject or changes in ambient light.
[0061] In an embodiment of the present application, the electronic device may determine the clarity of the main image area in the first image according to the image features of the main image area, and determine the first focus confidence corresponding to the first camera device according to the clarity of the main image area. Exemplarily, based on the image features such as grayscale and spectrum corresponding to the main image area, the electronic device may evaluate the main image area through a spatial grayscale change evaluation function, an image grayscale entropy function, a frequency domain function, a statistical evaluation function, etc. to determine the clarity of the main image area, and determine the first focus confidence according to the clarity of the main image area. Among them, there may be a positive correlation between the clarity of the main image area and the first focus confidence.
[0062] Optionally, the electronic device may define a search range according to the subject image area, and the search range may include the subject image area, but the area is slightly larger than the area of the subject image area, for example, the search range is from -X to X, -X and X are the values of the horizontal coordinates in the first image, which can be determined according to the sensor type in the first camera device and the horizontal coordinates of the subject image area in the first image. The electronic device may match the phase value of each pixel point within the search range, and calculate the similarity of each pixel point included in the search range based on the phase value. In the first image, the similarity between the pixels with clear imaging is high, and the similarity between the pixels with clear imaging and the pixels with unclear imaging is low. If the similarity of some of the pixels included in the search range is significantly higher than the similarity of other pixels, it can be considered that the subject image area includes more pixels with clear imaging, the clarity of the subject image area is high, and the first focus confidence corresponding to the first camera device is high. If the similarity between the pixels included in the search range is close, the number of pixels with clear imaging is too small, and the first focus confidence corresponding to the first camera device is low.
[0063] For example, the electronic device can use the value of the horizontal coordinate corresponding to the search range as the horizontal axis and the similarity of each pixel point included in the search range as the vertical axis to construct a two-dimensional confidence curve. If there is a peak or a trough with a large gradient value in the confidence curve, the first focus confidence corresponding to the first camera device is higher. The electronic device can determine the first focus confidence according to the difference between the maximum and minimum values of the similarity in the confidence curve; or, determine the first focus confidence according to the difference between the horizontal coordinate corresponding to the maximum similarity value and the horizontal coordinate corresponding to the minimum similarity value, but is not limited to this.
[0064] 340. When the first focus confidence is lower than the focus confidence threshold, select a second camera device having a focal length corresponding to the focus distance according to the current focus distance of the first camera device, and switch to the second camera device to capture an image of the target subject.
[0065] In the embodiment of the present application, when the first camera device captures an image of the target subject, it can identify the subject image area corresponding to the target subject and focus on the subject image area as the focus area. If the first camera device successfully focuses, the clarity of the pixels in the focus area can be higher than the clarity of the pixels outside the focus area.
[0066] The current focus distance of the first camera device mentioned above may refer to the sum of the distance between the target subject and the lens of the first camera device and the distance between the lens of the first camera device and the photosensitive element when the first camera device is focusing. The electronic device can detect the distance between the lens of the first camera device and the target subject by combining a time of flight (TOF) algorithm with a sensing device such as a laser sensor and an infrared sensor, and the distance between the lens of the first camera device and the photosensitive element can be obtained by reading the parameters transmitted by the first camera device.
[0067] In an embodiment of the present application, the focal lengths of the various cameras included in the shooting system may be the same or different, and a camera with a short focal length has a better light-gathering capability than a camera with a long focal length. Generally speaking, the focal length of a camera can be adjusted within a certain numerical range. For example, the focal length of a camera may be 8-24 mm. When the camera is shooting a target subject, the focal length of the camera may be within the range of 8-24 mm, and may change with the change in the distance between the target subject and the lens of the camera to obtain a clear image of the target subject. However, when the focal length adjustment amount of the camera exceeds the adjustable range of the focal length of the camera, the image of the target subject in the captured image is blurred, and the imaging effect is poor.
[0068] In an embodiment of the present application, when the first focus confidence corresponding to the first camera device is lower than the focus confidence threshold, it can be considered that the first camera device has failed to focus on the target subject. The focus failure may be limited by the adjustable range corresponding to the focal length of the first camera device, and the electronic device can switch to another camera device (i.e., the second camera device) to capture an image of the target subject. Since the second camera device is set at a different position from the first camera device, the distance between the target subject and the lens of the first camera device may be different from the distance between the target subject and the lens of the second camera device. When the second camera device shoots the target subject, the focal length adjustment amount corresponding to the second camera device may be different from the focal length adjustment amount corresponding to the first camera device.
[0069] Therefore, the electronic device may select a second camera device having a focal length corresponding to the current focus distance of the first camera device. The correspondence between the focal length and the focus distance may include: a correspondence between the focal length and the focus distance values, for example, a camera device with a larger focal length corresponds to a focus distance with a larger value, that is, a camera device with a long focal length is suitable for shooting distant scenes; or, the correspondence between the focal length and the focus distance may include: a correspondence between the focal length and the change trend of the focus distance, for example, when the change trend of the focus distance is that the distance increases, it corresponds to a camera device with a larger focal length.
[0070] When the focal length adjustment amount corresponding to the first camera device exceeds the adjustable range of the focal length of the first camera device, the focal length adjustment amount corresponding to the second camera device may be within the adjustable range of the focal length of the second camera device. The second camera device can successfully focus on the target subject, so that the image of the target subject in the second image captured by the second camera device is clear and the imaging effect is better.
[0071] In one embodiment, the shooting system may include at least three camera devices, that is, in addition to the first camera device currently capturing an image of the target subject, it also includes at least two other camera devices. Based on the shooting system including at least three camera devices, the electronic device may perform the above step 340 in the following manner:
[0072] The electronic device determines a change trend of the focus distance of the first camera device when tracking and photographing a target subject. The electronic device may record the focus distance corresponding to each frame of the first image collected to obtain the focus distance corresponding to multiple frames of the first image, thereby determining the change trend of the focus distance based on the focus distance corresponding to the multiple frames of the first image. For example, the change trend of the focus distance includes an increase in distance, indicating that the target subject gradually moves away from the first camera device during the process of tracking and photographing the target subject; or, the change trend of the focus distance includes a decrease in distance, indicating that the target subject gradually approaches the first camera device during the process of tracking and photographing the target subject.
[0073] The electronic device determines the second camera device from each other camera device according to the change trend of the focus distance and the focal lengths corresponding to each other camera device. The electronic device can select the second camera device whose focal length corresponds to the change trend of the focus distance from each other camera device according to the corresponding relationship between the focal length and the change trend of the focus distance. The focal length of the selected second camera device can be adjusted to adapt to the change of the focus distance, thereby improving the success rate of the second camera device focusing on the target subject and further improving the imaging effect of the target subject.
[0074] Optionally, the shooting system may include cameras with different focal lengths. For example, the shooting system may include a telephoto camera and a wide-angle camera. A telephoto camera may refer to a camera with a longer focal length, for example, the focal length of a telephoto camera may be 135-800 mm, which is suitable for shooting distant objects. A wide-angle camera may refer to a camera with a shorter focal length, for example, the focal length of a wide-angle camera may be 24-34 mm, or 13-20 mm, which is suitable for shooting larger objects within a shorter shooting distance.
[0075] Based on the camera devices with different focal lengths, the electronic device may determine the second camera device from each other camera device according to the change trend of the focus distance and the focal lengths corresponding to each other camera device, including:
[0076] When the shooting system includes a telephoto camera device, the electronic device may determine the telephoto camera device as the second camera device when the change trend of the focus distance of the first camera device is an increase in distance. The focal length of the telephoto camera device is greater than the focal length of the first camera device, and the first camera device may be a standard focal length camera device, a wide-angle camera device, etc., but is not limited thereto. In addition, since the change trend of the focus distance of the first camera device is an increase in distance, and the telephoto camera device is suitable for shooting distant objects, the focus confidence corresponding to the telephoto camera device is higher than the first focus confidence corresponding to the first camera device. That is, when the shooting system includes a telephoto camera device, the electronic device may switch the telephoto camera device to capture an image of the target subject when the first focus confidence corresponding to the first camera device is lower than the focus confidence threshold and the focus distance of the first camera device continues to increase. The telephoto camera device is suitable for shooting distant objects, and can adjust the focal length to adapt to the increase in the distance of the target subject, and can increase the success rate of focusing on the target subject when the target subject is far away from the camera device.
[0077] And / or, when the shooting system includes a wide-angle camera device, the electronic device may determine the wide-angle camera device as the second camera device when the focus distance of the first camera device changes in a trend of decreasing distance. The focal length of the wide-angle camera device is smaller than the focal length of the first camera device, and the first camera device may be a standard focal length camera device, a telephoto camera device, etc., but is not limited thereto. In addition, since the focus distance of the first camera device changes in a trend of decreasing distance, and the wide-angle camera device is suitable for capturing a larger area of scenery within a shorter shooting distance, the focus confidence corresponding to the wide-angle camera device is higher than the first focus confidence corresponding to the first camera device. That is to say, when the shooting system includes a wide-angle camera device, the electronic device may switch the wide-angle camera device to capture an image of the target subject when the first focus confidence corresponding to the first camera device is lower than the focus confidence threshold and the focus distance of the first camera device continues to decrease. The wide-angle camera device is suitable for photographing scenes at a shorter distance, and can adjust the focal length as the distance to the target subject decreases, thereby increasing the success rate of focusing on the target subject when the target subject approaches the camera device.
[0078] It can be seen that in the aforementioned embodiment, the electronic device can switch to a second camera device with a corresponding focal length and focal distance to perform image acquisition based on the focal distance of the first camera device currently performing image acquisition on the target subject, when the imaging effect of the target subject in the first image captured by the first camera device is low. The focal length of the second camera device corresponds to the focal distance, and the focus confidence of the second camera device is higher, which can increase the success rate of focusing on the target subject, and is conducive to improving the imaging effect of the target subject in the second image captured by the second camera device.
[0079] See also Figure 4 , Figure 4 FIG. 1 is a flow chart of another method for controlling a camera device disclosed in an embodiment of the present application, and the method can be applied to the electronic device as described above. Figure 4 As shown, the camera device control method may include:
[0080] 410. Acquire a first image captured by a first camera device.
[0081] 420. Detect the target subject included in the first image, and extract image features of a subject image region corresponding to the target subject.
[0082] 430. Determine a first recognition confidence and a first tracking confidence corresponding to the first camera device according to image features of the subject image area.
[0083] In the embodiment of the present application, the first recognition confidence can be determined based on the accuracy of target recognition based on the image features of the subject image area. The higher the accuracy of target recognition based on the first image, the higher the first recognition confidence, but not limited to this. The second tracking confidence can be determined based on the degree of matching between the image features of the subject image area corresponding to the target subject in the current frame first image and the image features of the subject image area corresponding to the target subject in the previous frame first image. The higher the matching degree, the higher the first tracking confidence, but not limited to this.
[0084] 440. When the current application scenario of the shooting system is a target recognition scenario and the first recognition confidence threshold is lower than the recognition confidence threshold, switch to the second camera device to capture an image of the target subject.
[0085] In the embodiment of the present application, the second recognition confidence corresponding to the second camera device is higher than the first recognition confidence.
[0086] 450. Identify the target subject according to the second image captured by the second camera device.
[0087] In an embodiment of the present application, the electronic device may perform the above-mentioned steps 440-450 in a target recognition scenario. Among them, the target recognition scenario may refer to a scenario where it is necessary to identify whether the target subject matches a specific shooting target (such as a face or a license plate, etc.), such as a face recognition scenario in an access control system. In a target recognition scenario, the importance of accurately identifying the target subject is higher than the importance of tracking the target subject, and the image captured by the camera device may need to include more details of the target subject. Therefore, once the electronic device detects that the first recognition confidence is lower than the recognition confidence threshold, it switches to a second camera device with a higher recognition confidence to capture an image of the target subject, thereby improving the accuracy of target recognition when the target subject is identified based on the above-mentioned second image. Among them, the above-mentioned recognition confidence threshold can be set according to actual business needs, and the embodiment of the present application does not limit it.
[0088] 460. When the current application scenario of the shooting system is a target tracking scenario and the first tracking confidence is lower than the tracking confidence threshold, switch to the second camera device to capture an image of the target subject.
[0089] In the embodiment of the present application, the second tracking confidence corresponding to the second camera device is higher than the first tracking confidence.
[0090] 470. Track the target subject according to the second image captured by the second camera device.
[0091] In an embodiment of the present application, the electronic device may perform the above-mentioned steps 460-470 in a target tracking scenario. Among them, the target tracking scenario may refer to a scenario where the same target subject needs to be located in multiple frames of images, such as a monitoring system of a building, which needs to track and shoot a certain target and ensure that the tracked target is not lost. In the target tracking scenario, the importance of not losing the target subject is higher than the accuracy of accurately identifying the target subject. The details of the target subject in the image captured by the camera device may be relatively blurred, but the target subject needs to be captured as continuously as possible. Therefore, once the electronic device detects that the first tracking confidence is lower than the tracking confidence threshold, it switches to a second camera device with a higher tracking confidence to capture the image of the target subject, so that when the target subject is tracked based on the above-mentioned second image, the target loss is reduced and the stability and accuracy of the target tracking are maintained. Among them, the above-mentioned tracking confidence threshold can be set according to actual business needs, and the embodiment of the present application does not limit it.
[0092] It can be seen that in the aforementioned embodiments, the electronic device can select a confidence level that is more suitable for the current application scenario between the recognition confidence level and the tracking confidence level as a condition for camera switching based on the different application scenarios of the shooting system, thereby reducing unnecessary calculations and taking into account both computing efficiency and the accuracy of target recognition or target tracking based on the characteristics of different application scenarios.
[0093] In one embodiment, see Figure 5 , Figure 5 FIG. 1 is a flow chart of another method for controlling a camera device disclosed in an embodiment of the present application, and the method can be applied to the electronic device as described above. Figure 5 As shown, the camera device control method may include:
[0094] 510. Acquire a first image captured by a first camera device.
[0095] 512. Detect the target subject included in the first image, and extract image features of the subject image area corresponding to the target subject.
[0096] 514. Determine a first confidence level corresponding to the first camera device according to image features of the subject image area.
[0097] In an embodiment of the present application, the electronic device may select one or more confidence levels as the first confidence level corresponding to the first camera device from the first focus confidence level, the first recognition confidence level, or the first tracking confidence level corresponding to the first camera device according to the current application scenario of the shooting system.
[0098] 516. When the first confidence level is lower than the confidence level threshold and there are at least two other camera devices whose corresponding confidence levels are higher than the first confidence level, select a second camera device from the at least two camera devices according to a comparison result of the confidence levels of the at least two other camera devices.
[0099] 518. The electronic device switches to the second camera device to capture an image of the target subject.
[0100] In an embodiment of the present application, the shooting system may include at least three cameras, that is, in addition to the first camera that is currently capturing images of the target subject, it also includes at least two other cameras. The electronic device can obtain the confidence corresponding to each of the at least two other cameras. It should be noted that the confidence type included in the confidence corresponding to each other camera is consistent with the confidence type included in the first confidence corresponding to the first camera. For example, when the first confidence includes a first focus confidence, the electronic device can obtain the focus confidence corresponding to each other camera; when the first confidence includes a first recognition confidence and a first tracking confidence, the electronic device can obtain the recognition confidence corresponding to each other camera and the tracking confidence corresponding to each other camera.
[0101] In an embodiment of the present application, the electronic device may compare the confidences corresponding to at least two other camera devices, and select a second camera device according to the comparison result. Optionally, the electronic device may select the camera device with the highest corresponding confidence from at least two other camera devices as the second camera device, that is, select the most credible camera device as the second camera device. Therefore, the electronic device may use the camera device with the highest credibility in the shooting system to capture the image of the target subject, which is conducive to improving the imaging effect of the target subject.
[0102] As an optional implementation manner, after executing step 540, the electronic device may further execute the following steps:
[0103] 520. Obtain a conversion relationship between a calibrated image coordinate system of the first camera device and an image coordinate system of the second camera device.
[0104] In the embodiment of the present application, since the first camera device and the second camera device are set at different positions, even if the first camera device and the second camera device simultaneously capture images of the target subject, the image coordinates P(x, y) of the target subject in the captured first image are different from the image coordinates P'(x', y') of the target subject in the second image. Therefore, the first camera device and the second camera device can be calibrated in advance to determine the corresponding relationship between the image coordinates.
[0105] The method for calibrating the first camera device and the second camera device may include but is not limited to the chessboard method, and the image coordinates P(x, y)=P'(x', y')*H in the first image may be calculated, where H is a transformation matrix, that is, a transformation relationship between the image coordinate system of the first camera device and the image coordinate system of the second camera device. The electronic device may obtain the transformation relationship from a local storage or a cloud server that is connected to the electronic device in communication, but is not limited thereto.
[0106] 522. Based on the above conversion relationship, convert the first focus area of the first camera device in the first image into an image coordinate system of the second camera device to obtain a second focus area.
[0107] 524. Control the second camera device to focus on a second focus area of the second image when capturing the second image.
[0108] In an embodiment of the present application, when the first camera device shoots the target subject, the area occupied by the focus determined by the first camera device in the image may be the first focus area in the first image. Based on the above-mentioned conversion relationship, the electronic device can convert any image coordinate in the first image to the image coordinate system of the second camera device for representation. Therefore, the electronic device can convert the first focus area to the image coordinate system of the second camera device for representation, and transmit the second focus area obtained after the conversion to the second camera device. The second camera device can use the second focus area as the initial focus target for focusing, without having to detect the target subject again in the second image, and without having to determine the focus area after identifying the main image area of the target subject in the second image, thereby improving the efficiency of focusing shooting.
[0109] As an optional implementation manner, after executing step 540, the electronic device may further execute the following steps:
[0110] 526. Obtain a subject image region of the target subject in multiple frames of target images, where the target image is an image captured by a camera currently performing image capture.
[0111] In the embodiment of the present application, the camera device currently performing image acquisition may include a first camera device or a second camera device, and is not specifically limited. The electronic device may detect the main image area of the target subject in the first image captured by the first camera device, and may also detect the main image area of the target subject in the second image captured by the second camera device.
[0112] 528. Generate a moving trajectory of the target subject according to the subject image area of the target subject in the multiple frames of target images.
[0113] In the embodiment of the present application, the electronic device can connect the subject image area in each frame of the target image to generate the movement trajectory of the target subject. Fig. 6A , Fig. 6A Schematic diagram of a moving trajectory of a target subject disclosed in an embodiment of the present application. Fig. 6A As shown, the electronic device can capture N (N is a positive integer greater than or equal to 1) frames of images through the first camera device or the second camera device. Among them, the first frame of image can be acquired by the first camera device, and the second and third frames of image can be acquired by switching to the second camera device when the first confidence level corresponding to the first camera device is lower than the confidence level threshold.
[0114] 530. When the movement trajectory of the target subject does not match the normal behavior trajectory, an abnormal warning message is generated.
[0115] In the embodiment of the present application, the normal behavior trajectory can be learned from the movement trajectory data of a large number of objects through machine learning and other technologies. If the movement trajectory of the target subject is significantly different from the normal behavior trajectory, the two do not match; if the movement trajectory of the target subject is slightly different from the normal behavior trajectory, the two match. The electronic device can match the movement trajectory of the target subject with the normal behavior trajectory through trajectory matching methods such as geometry-based matching or hidden Markov model-based matching, but is not limited to this. For example, please refer to Figure 6B , Figure 6B This is an example diagram of a target subject's movement trajectory not matching the normal behavior trajectory disclosed in the embodiment of the present application. Figure 6B As shown, the normal behavior trajectory is approximately a straight line, while the moving trajectory of the target subject has at least two corners, and the moving trajectory of the target subject is quite different from the normal behavior trajectory.
[0116] When the electronic device identifies that the target subject's movement trajectory does not match the normal behavior trajectory, it can generate abnormal warning information. The abnormal warning information can be used to notify and warn the abnormal movement behavior of the target subject, and can be set according to the application scenario of the shooting system, including but not limited to the geographical location of the target subject, the time when the target subject was photographed, etc., without specific limitation.
[0117] Exemplarily, the electronic device can monitor the movement trajectory of the vehicle through the shooting system in the application scenario of traffic intersection monitoring, that is, the vehicle is the target subject. In the application scenario of traffic intersections, the normal behavior trajectory may include: a straight trajectory, a left turn trajectory, or a right turn trajectory. After generating the movement trajectory of the vehicle, the electronic device can perform a trajectory classification task on the movement trajectory of the vehicle based on a machine learning algorithm. If the movement trajectory of the vehicle is classified as any one of a straight trajectory, a left turn trajectory, or a right turn trajectory, the movement trajectory of the vehicle matches the normal behavior trajectory; if the movement trajectory of the vehicle is classified into other categories, the movement trajectory of the vehicle does not match the normal behavior trajectory, and the electronic device can generate abnormal warning information to warn of the abnormal movement behavior of the vehicle.
[0118] It can be seen that in the aforementioned embodiments, when the first confidence level corresponding to the first camera device currently capturing images of the target subject is lower than the confidence level threshold, the electronic device can select a second camera device from other camera devices according to the confidence levels respectively corresponding to the other camera devices, which is beneficial to improving the imaging effect of the target subject. Furthermore, when the electronic device switches to the second camera device to capture images of the target subject, it can use the first focus area in the first image to determine the second focus area used by the second camera device when focusing on the target subject, thereby improving the efficiency of focusing shooting. Furthermore, the electronic device can also generate a moving trajectory of the target subject according to the main image area of the target subject in the multiple frames of images captured by the camera device included in the shooting system, so that when the moving trajectory of the target subject does not match the normal behavior trajectory, abnormal warning information is generated to notify and warn of the abnormal movement behavior of the target subject, thereby playing the monitoring role of the shooting system.
[0119] See also Figure 7 , Figure 7 is a schematic diagram of the structure of a control device disclosed in an embodiment of the present application. The control device can be applied to the aforementioned shooting system and is communicatively connected with at least the first camera device and the second camera device included in the shooting system. The aforementioned electronic device can also include the control device. Figure 7 As shown, the control device 700 may include: an acquisition module 710, a detection module 720, a determination module 730 and a switching module 740. Among them:
[0120] An acquisition module 710, which may be used to acquire a first image captured by a first camera device;
[0121] The detection module 720 may be used to detect the target subject contained in the first image and extract image features of the target subject corresponding to the subject image area;
[0122] A determination module 730, which may be used to determine a first confidence level corresponding to the first camera device according to the image feature;
[0123] The switching module 740 can be used to switch to the second camera device to capture images of the target subject when the first confidence level is lower than the confidence level threshold, and the second confidence level corresponding to the second camera device is higher than the first confidence level.
[0124] In one embodiment, the first confidence level may include: a first focus confidence level, the second confidence level may include: a second focus confidence level; and the confidence level threshold may include: a focus confidence level threshold.
[0125] The switching module 740 may include: a selection unit and a switching unit.
[0126] The selection unit can be used to select a second camera device with a focal length corresponding to the focus distance according to the current focus distance of the first camera device when the first focus confidence is lower than the focus confidence threshold; the second focus confidence corresponding to the second camera device is higher than the first focus confidence.
[0127] The switching unit can be used to switch to the second camera device to capture images of the target subject.
[0128] In one embodiment, the selection unit can also be used to determine the changing trend of the focus distance of the first camera device when tracking and photographing the target subject; and, based on the changing trend of the focus distance and the focal lengths corresponding to each other camera device, determine the second camera device from each other camera device.
[0129] Optionally, the selection unit can also be used to determine the telephoto camera as the second camera device when the other cameras include a telephoto camera and the focus distance of the first camera device changes with an increasing distance, the focal length of the telephoto camera device is greater than that of the first camera device, and the focus confidence corresponding to the telephoto camera device is higher than the first focus confidence.
[0130] Optionally, the selection unit can also be used to determine the wide-angle camera as the second camera when the other camera devices include a wide-angle camera and the focus distance of the first camera tends to change as the distance decreases, the focal length of the wide-angle camera is smaller than that of the first camera, and the focus confidence corresponding to the wide-angle camera is higher than the first focus confidence.
[0131] In one embodiment, the photographing system includes at least three photographing devices.
[0132] The selection unit may also be used to select a second camera from at least two camera devices according to a comparison result of the confidences corresponding to the at least two other camera devices when the first confidence is lower than the confidence threshold and there are at least two other camera devices with confidences higher than the first confidence. The first confidence may include one or more of a first focus confidence, a first recognition confidence, or a first tracking confidence.
[0133] Optionally, the selection unit may also be configured to select a corresponding camera device with the highest confidence level from at least two camera devices as the second camera device.
[0134] In one embodiment, the determination module 730 may include: a clarity determination unit and a confidence determination unit.
[0135] A clarity determination unit, which can be used to determine the clarity of the main image area in the first image according to the image features;
[0136] The confidence determination unit may be used to determine a first confidence corresponding to the first camera device according to the clarity of the main image area in the first image.
[0137] In one embodiment, the first confidence may include: a first recognition confidence and a first tracking confidence; the second confidence may include: a second recognition confidence and a second tracking confidence; the confidence threshold may include: a recognition confidence threshold and a tracking confidence threshold.
[0138] The control device 700 may further include: an identification module and a tracking module.
[0139] The switching module 740 may also be used to switch to the second camera device to capture an image of the target subject when the current application scenario of the shooting system is a target recognition scenario and the first recognition confidence threshold is lower than the recognition confidence threshold; the second recognition confidence corresponding to the second camera device is higher than the first recognition confidence;
[0140] The recognition module can be used to recognize the target subject according to the second image captured by the second camera device.
[0141] The switching module 740 may also be used to switch to the second camera device to capture an image of the target subject when the current application scenario of the shooting system is a target tracking scenario and the first tracking confidence is lower than the tracking confidence threshold, and the second tracking confidence corresponding to the second camera device is higher than the second tracking confidence;
[0142] The tracking module can be used to track the target subject according to the second image captured by the second camera device.
[0143] In one embodiment, the acquisition module 710 can also be used to obtain the conversion relationship between the calibrated image coordinate system of the first camera device and the image coordinate system of the second camera device after the switching module 740 switches to the second camera device to capture the image of the target subject.
[0144] The control device 700 may further include: a focusing module.
[0145] The focusing module can also be used to convert the first focus area of the first camera device in the first image into the image coordinate system of the second camera device based on the conversion relationship to obtain a second focus area; and to control the second camera device to focus on the second focus area of the second image when capturing the second image.
[0146] In one embodiment, the acquisition module 710 may also be used to acquire a subject image region of the target subject in multiple frames of target images after the switching module 740 switches to the second camera device to acquire images of the target subject, where the target image is an image acquired by the camera device currently performing image acquisition;
[0147] The control device 700 may further include: a generating module.
[0148] The generation module can be used to generate a moving trajectory of the target subject according to the subject image area of the target subject in multiple frames of target images; and generate abnormal warning information when the moving trajectory of the target subject does not match the normal behavior trajectory.
[0149] It can be seen that based on the control device disclosed in the above embodiment, when the first camera captures the image of the target subject, the first confidence level corresponding to the first camera device can be monitored in real time. When the first confidence level decreases, the second camera device with a higher confidence level can be switched to capture the image of the target subject, thereby improving the imaging effect when the shooting system captures the image of the shooting target.
[0150] See also Figure 8 , Figure 8 is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present application, and the electronic device may include any electronic device as described in the foregoing embodiments. Figure 8 As shown, the electronic device 800 may include:
[0151] A memory 810 storing executable program code;
[0152] a processor 820 coupled to the memory 810;
[0153] The processor 820 calls the executable program code stored in the memory 810 to execute any camera control method disclosed in the embodiments of the present application.
[0154] It should be noted that Figure 8 The electronic device shown may also include components not shown, such as a power supply, input buttons, a speaker, a screen, an RF circuit, a Wi-Fi module, a Bluetooth module, and a sensor, which are not described in detail in this embodiment. In addition, the first camera device and the second camera device included in the shooting system may be set independently of the electronic device 800, or may be packaged in the electronic device 800, which is not limited in this embodiment of the application.
[0155] An embodiment of the present application discloses a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements any camera control method disclosed in the embodiment of the present application.
[0156] An embodiment of the present application discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute any camera control method disclosed in the embodiment of the present application.
[0157] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. Those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required for the present application.
[0158] In the various embodiments of the present application, it should be understood that the size of the serial numbers of the above-mentioned processes does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0159] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0160] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0161] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-accessible memory. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for a computer device (which can be a personal computer, a server or a network device, etc., specifically a processor in a computer device) to perform some or all of the steps of the above-mentioned methods of various embodiments of the present application.
[0162] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium includes a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable rewritable read-only memory (EEPROM), a compact disc (CD-ROM) or other optical disc storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium that can be used to carry or store data.
[0163] The above is a detailed introduction to a control method, device, electronic device and storage medium of a camera device disclosed in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core idea of the present application. At the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A camera device control method, characterized in that: Applied to a shooting system, the shooting system at least includes a first camera device and a second camera device, the first camera device and the second camera device are arranged at different geographical locations, and the first camera device and the second camera device correspond to different shooting directions respectively; the method includes: Acquire a first image captured by the first camera device; Detecting a target subject contained in the first image, and extracting image features of a subject image area corresponding to the target subject; Determining a first confidence level corresponding to the first camera device according to the image feature; the first confidence level is used to characterize the imaging effect of the target subject in the first image; the first confidence level includes one or more of a first focus confidence level, a first recognition confidence level, and a first tracking confidence level; When the first confidence level is lower than a confidence level threshold, the second camera device is switched to capture an image of the target subject, and a second confidence level corresponding to the second camera device is higher than the first confidence level.
2. The method according to claim 1, characterized in that The first confidence level includes: a first focus confidence level, the second confidence level includes: a second focus confidence level; the confidence level threshold includes: a focus confidence level threshold; And, when the first confidence level is lower than a confidence level threshold, switching to the second camera device to capture an image of the target subject, and a second confidence level corresponding to the second camera device is higher than the first confidence level, comprising: When the first focus confidence is lower than the focus confidence threshold, a second camera device with a focal length corresponding to the focus distance is selected according to the current focus distance of the first camera device, and the second camera device is switched to capture an image of the target subject, and a second focus confidence corresponding to the second camera device is higher than the first focus confidence.
3. The method according to claim 2, characterized in that The shooting system includes at least three camera devices, and the selecting, according to the current focus distance of the first camera device, a second camera device having a focal length corresponding to the focus distance includes: Determining a change trend of a focus distance of the first camera device when tracking and photographing the target subject; According to the change trend of the focus distance and the focal lengths corresponding to the other camera devices, the second camera device is determined from the other camera devices, and the other camera devices are camera devices other than the first camera device.
4. The method according to claim 3, characterized in that The other camera devices include a telephoto camera device; and the determining the second camera device from the other camera devices according to the change trend of the focus distance and the focal lengths corresponding to the other camera devices respectively, comprises: When the focus distance of the first camera device has a changing trend of increasing distance, the telephoto camera device is determined as the second camera device, the focal length of the telephoto camera device is greater than the focal length of the first camera device, and the focus confidence corresponding to the telephoto camera device is higher than the first focus confidence; and / or, The other camera devices include a wide-angle camera device; and the second camera device is determined from the other camera devices according to the change trend of the focus distance and the focal lengths corresponding to the other camera devices, including: When the focus distance of the first camera device changes in a decreasing trend, the wide-angle camera device is determined as the second camera device, the focal length of the wide-angle camera device is smaller than the focal length of the first camera device, and the focus confidence corresponding to the wide-angle camera device is higher than the first focus confidence.
5. The method according to any one of claims 2 to 4, characterized in that: The determining, according to the image feature, a first confidence level corresponding to the first camera device includes: determining the clarity of a main image area in the first image according to the image feature; A first focus confidence corresponding to the first camera device is determined according to the clarity of the main image area in the first image.
6. The method according to claim 1, characterized in that The first confidence level includes: a first recognition confidence level and a first tracking confidence level; the second confidence level includes: a second recognition confidence level and a second tracking confidence level; the confidence level threshold includes: a recognition confidence level threshold and a tracking confidence level threshold; And, when the first confidence level is lower than a confidence level threshold, switching to the second camera device to capture an image of the target subject comprises: When the current application scenario of the shooting system is a target recognition scenario and the first recognition confidence is lower than the recognition confidence threshold, switching to the second camera device to capture an image of the target subject, and recognizing the target subject according to a second image captured by the second camera device; the second recognition confidence corresponding to the second camera device is higher than the first recognition confidence; When the current application scenario of the shooting system is a target tracking scenario and the first tracking confidence is lower than the tracking confidence threshold, switch to the second camera device to capture an image of the target subject, and track the target subject based on the second image captured by the second camera device; the second tracking confidence corresponding to the second camera device is higher than the first tracking confidence.
7. The method according to claim 1, characterized in that The shooting system includes at least three camera devices; And, when the first confidence level is lower than a confidence level threshold, switching to the second camera device to capture an image of the target subject comprises: When the first confidence level is lower than the confidence level threshold and there are at least two other camera devices whose corresponding confidence levels are higher than the first confidence level, the second camera device is selected from the at least two other camera devices based on the confidence level comparison results corresponding to the at least two other camera devices; the other camera devices are camera devices other than the first camera device.
8. The method according to claim 7, characterized in that The selecting the second camera device from the at least two other camera devices according to the confidence comparison results corresponding to the at least two other camera devices includes: A corresponding camera device with the highest confidence level is selected from the at least two other camera devices as the second camera device.
9. The method according to claim 1, characterized in that: When the first confidence level is lower than a confidence level threshold, after switching to the second camera device to capture an image of the target subject, the method further includes: Acquire a conversion relationship between the calibrated image coordinate system of the first camera device and the image coordinate system of the second camera device; Based on the conversion relationship, converting a first focus area of the first camera device in the first image into an image coordinate system of the second camera device to obtain a second focus area; The second camera device is controlled to focus on the second focus area of the second image when capturing the second image.
10. The method according to claim 1, characterized in that When the first confidence level is lower than a confidence level threshold, after switching to the second camera device to detect the target subject, the method further includes: Acquire a subject image region of the target subject in multiple frames of target images, wherein the target image is an image captured by a camera currently performing image capture; Generating a moving trajectory of the target subject according to a subject image region of the target subject in multiple frames of target images; When the movement trajectory of the target subject does not match the normal behavior trajectory, abnormal warning information is generated.
11. A control device, characterized in that: Applied to a shooting system, the shooting system at least includes a first camera device and a second camera device, the control device is in communication connection with the first camera device and the second camera device; the first camera device and the second camera device are arranged at different geographical locations, and the first camera device and the second camera device correspond to different shooting directions respectively; The control device comprises: An acquisition module, used to acquire a first image captured by the first camera device; A detection module, configured to detect a target subject contained in the first image and extract image features of a subject image area corresponding to the target subject; A determination module, configured to determine a first confidence level corresponding to the first camera device according to the image feature; the first confidence level is used to characterize an imaging effect of the target subject in the first image; the first confidence level includes one or more of a first focus confidence level, a first recognition confidence level, and a first tracking confidence level; A switching module is used to switch to the second camera device to capture images of the target subject when the first confidence level is lower than a confidence level threshold, and a second confidence level corresponding to the second camera device is higher than the first confidence level.
12. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the processor implements the method according to any one of claims 1 to 10.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Image monitoring method, main control device and system
CN102104768A
Camera switching method and device
CN110300268A
Camera switching method and device, storage medium and electronic equipment
CN110691193A