CN115250329A - Camera control method and device, computer equipment and storage medium - Google Patents
Camera control method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN115250329A CN115250329A CN202110467593.2A CN202110467593A CN115250329A CN 115250329 A CN115250329 A CN 115250329A CN 202110467593 A CN202110467593 A CN 202110467593A CN 115250329 A CN115250329 A CN 115250329A
- Authority
- CN
- China
- Prior art keywords
- target object
- camera
- offset distance
- adjustment
- image
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 47
- 238000006073 displacement reaction Methods 0.000 claims abstract description 17
- 238000001514 detection method Methods 0.000 claims description 19
- 238000013459 approach Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 claims description 4
- 238000013473 artificial intelligence Methods 0.000 abstract description 2
- 230000033001 locomotion Effects 0.000 description 8
- 230000009286 beneficial effect Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000005265 energy consumption Methods 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 230000001815 facial effect Effects 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 230000010365 information processing Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000000056 organ Anatomy 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Landscapes
- Studio Devices (AREA)
Abstract
The embodiment of the application belongs to the field of artificial intelligence, and relates to a control method of a camera, which is used for solving the technical problem of how to avoid the influence caused by different heights and different positions of a collected object so as to accurately shoot the collected object as far as possible, and comprises the following steps: acquiring an image acquired by a camera; detecting whether a target object exists in the image, and determining a central point of the target object when the target object exists; detecting the offset distance between the central point of the target object and the central point of a preset identification area; and performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the detected offset distance after adjustment is minimum is determined, stopping adjustment, and shooting the target object. The application also provides a control device of the camera, computer equipment and a storage medium.
Description
Technical Field
The present application relates to the field of image processing technologies, and in particular, to a method and an apparatus for controlling a camera, a computer device, and a computer-readable storage medium.
Background
With the development of artificial intelligence technology, face recognition technology is more and more applied to the field of financial payment. The face recognition technology is based on the face features of people, firstly, whether a face exists in an input image is judged, if the face exists, the position and the size of the face and the position information of each main facial organ are further given, and the identity features contained in the face are further extracted and compared with the known face, so that the identity corresponding to the face is recognized.
Based on the two considerations, the acquisition angle of the camera of the face recognition terminal needs to be aligned to the face direction as much as possible. When the face image is collected, the quality of the collected image is influenced by the different heights and the different positions of the collected object. More solutions at present are to increase the field of view (FOV) of the camera, expand the field of view in the horizontal and vertical directions, and then extract the required face elements in the image through software. However, the FOV is increased by the lens, so that the acquired image is distorted, which may cause a hidden danger to the safety of face recognition.
In view of the above-described circumstances, the inventors found that: under a specific shooting scene, how to avoid the influence caused by different heights and different positions of a collected object so as to shoot the collected object as accurately as possible is an urgent technical problem to be solved.
Disclosure of Invention
An object of an embodiment of the present application is to provide a method and an apparatus for controlling a camera, a computer device, and a computer-readable storage medium, so as to solve a technical problem of how to avoid influences caused by different heights and different positions of a captured object in a specific shooting scene, so as to accurately shoot the captured object as much as possible.
In order to solve the above technical problem, an embodiment of the present application provides a method for controlling a camera, which adopts the following technical solutions:
acquiring an image acquired by a camera;
detecting whether a target object exists in the image, and determining a central point of the target object when the target object exists;
detecting the offset distance between the central point of the target object and the central point of a preset identification area;
and performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the detected offset distance after adjustment is minimum is determined, stopping adjustment, and shooting the target object.
In order to solve the above technical problem, an embodiment of the present application further provides a control device for a camera, which adopts the following technical solutions:
the acquisition module is used for acquiring images acquired by the camera;
the target detection module is used for detecting whether a target object exists in the image and determining a central point of the target object when the target object exists;
the calculation module is used for detecting the offset distance between the central point of the target object and the central point of a preset identification area;
and the adjusting module is used for performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the detected offset distance after adjustment is minimum is determined, stopping adjustment, and shooting the target object.
In order to solve the above technical problem, an embodiment of the present application further provides a computer device, which adopts the following technical solutions:
a computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of a method of controlling a camera as described above.
In order to solve the foregoing technical problem, an embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solutions:
a computer-readable storage medium, having computer-readable instructions stored thereon, which, when executed by a processor, implement the steps of the control method of the camera head as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method and the device, after the image collected by the camera is obtained, whether the target object exists in the image can be further detected, and if the target object exists, the central point of the target object can be further determined. Then, the offset distance between the center point of the determined target object and the center point of the preset identification area can be detected, and the camera is moved and/or rotated according to the offset distance to reduce the offset distance in the subsequently taken image so as to continue to take the target object. According to the scheme, the camera is moved and/or rotated, so that the shot target object can be located in the center of the preset identification area as far as possible. Therefore, the influence on shooting caused by different heights and different positions of the collected object in the prior art can be effectively avoided, and the collected object can be shot as accurately as possible.
Drawings
In order to more clearly illustrate the solution of the present application, the drawings needed for describing the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present application, and that other drawings can be obtained by those skilled in the art without inventive effort.
Fig. 1 is a flowchart of one embodiment of a control method of a camera according to the present application;
fig. 2 is a schematic structural diagram of an embodiment of a control device of a camera according to the present application;
FIG. 3 is a schematic block diagram of one embodiment of a computer device according to the present application.
Detailed Description
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application; the terms "including" and "having," and any variations thereof, in the description and claims of this application and the description of the above figures are intended to cover non-exclusive inclusions. The terms "first," "second," and the like in the description and claims of this application or in the above-described drawings are used for distinguishing between different objects and not for describing a particular order.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings.
Referring specifically to fig. 1, a flow chart of one embodiment of a method for controlling a camera according to the present application is shown. The control method of the camera comprises the following steps:
and step S110, acquiring an image collected by the camera.
In this embodiment, the electronic device on which the control method of the camera operates may be a server or a terminal device, and if the electronic device is equipped with a camera, the electronic device may acquire an image acquired by the camera, and the electronic device may also receive images acquired by cameras of other electronic devices in a wired connection manner or a wireless connection manner. The collected images may be pictures collected at intervals, or may be video image frames collected at a certain frame rate.
It is noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a UWB (ultra wideband) connection, and other wireless connection means now known or developed in the future.
Step S120, detecting whether a target object exists in the image, and determining a central point of the target object when the target object exists.
In this embodiment, after the image is acquired, the image may be automatically detected by using a preset image recognition algorithm, and whether the target object exists in the image is recognized according to the color feature, the texture feature, the shape feature and/or the local feature point of the image. Further, when the target object exists, the central point of the target object is determined. For different application scenes, the target object can be divided into multiple situations: the target object may be a feature object of a certain type, such as a human face, a car, or a pedestrian; the target object may also be a specific thing, such as a specific face, a specific vehicle or a specific pedestrian in the controlled scene; alternatively, the object may be any moving object in the monitored scene.
In some possible implementations, the step of detecting whether a target object exists in the image, and determining a central point of the target object when the target object exists may specifically include:
detecting whether the target object exists in the image or not by using a preset target detection model; and if the target object exists, generating a surrounding frame of the target object, and taking the central point of the surrounding frame as the central point of the target object.
In addition to detecting whether a target object exists in an image, the present embodiment also needs to determine a center point of the target object, that is, determine a position of the target object when determining that the target object exists. Therefore, object detection (object detection) techniques may be employed. Target detection, also called target extraction, is an image segmentation technique based on geometric and statistical characteristics of an object to be detected. The target detection task can be divided into two key subtasks: object classification and object localization. The target classification task is responsible for judging whether an object to be detected appears in the input image or the selected image area, and outputting a series of labels with scores to indicate the possibility that the object to be detected appears in the input image or the selected image area. The target positioning task is responsible for determining the position and the range of the object to be detected in the input image or the selected image area, and outputting a bounding box of the object containing the object to be detected, or the center of the object, or the closed boundary of the object.
Specifically, in this embodiment, a preset trained target detection model may be used to detect whether a target object exists in the image, and when it is determined that the target object exists, a bounding box of the target object is generated by using a bounding box regression (bounding box regression) technique, and a central point of the bounding box is used as a central point of the target object. The preset target detection model may adopt any one of common target detection models such as a fast R-CNN model, an SSD (solid multi box detector) model, and a YOLO model, and the generated bounding box may be a square bounding box, which is not specifically limited herein.
In some possible implementation manners, if a plurality of target objects are detected when detecting whether a target object exists in an image, the target object occupying the largest area may be selected according to a maximum area principle, a bounding box of the target object occupying the largest area is generated, and a central point of the bounding box is used as a central point of the target object.
Specifically, in some cases, after detection, an image acquired by a camera for the first time may include a plurality of target objects, but since only one target object needs to be processed each time, in order to avoid the influence of other target objects, a target object occupying the largest area in the image may be selected according to the maximum area principle, and the target object is used as a detection target, so as to generate a corresponding bounding box and determine a central point of the bounding box.
Step S130, detecting an offset distance between the center point of the target object and a center point of a preset identification area.
In this embodiment, the preset identification area may be an identification area set on a display interface of the electronic device, and the electronic device detects and identifies the image information in the area. After determining the center point of the target center, an offset distance between the center point of the target object and the center point of the preset identification area may be further determined.
Specifically, the preset identification area may be a circle or a square. Assuming that the preset recognition area is a rectangular area, and the lower left corner of the preset recognition area is used as the origin and can be expressed as a rectangle of [0, width ] [0, height ], the center point of the preset recognition area is [ Width/2, height/2]. Detecting the acquired bounding box area of the target object as [ X1, X2] [ Y1, Y2], then the center point of the target object is [ Xcenter, ycenter ], where Xcenter = X1+ (X2-X1)/2, ycenter = Y1+ (Y2-Y1)/2. Further, the offset distance Xoffset = Xcenter-Width/2 in the lateral direction and the offset distance Yoffset = Ycenter-Height/2 in the vertical direction between the center point of the target object and the center point of the preset recognition area can be calculated. The positive and negative of the offset distance indicates the offset direction.
And S140, performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the offset distance detected after adjustment is minimum is determined, stopping adjustment, and shooting the target object.
In this embodiment, the camera for collecting the image may be fixed on a motion platform, for example, a pan/tilt head, so that the moving and steering functions of multiple degrees of freedom of the camera may be realized by controlling the motion platform. The motion platform can be in wired or wireless communication connection with the electronic equipment, and then can control the movement and/or rotation motion of the camera according to a control instruction issued by the electronic equipment.
When the position of the camera is controlled and adjusted, a gradient adjustment and feedback adjustment method can be adopted, namely: namely, a section of fixed angle and/or fixed displacement is adjusted each time, then detection is carried out, and adjustment is carried out again according to a detection result, so that the adjustment effect is finally achieved. If not, and the absolute value of the Xoffset is larger than the absolute value of the offset value calculated last time, the camera returns to the last horizontal axial angle, and the adjustment of the marking horizontal axial direction is finished; otherwise, according to the condition that the Xoffset is less than 0, the horizontal axial angle of the camera is adjusted to the left by a preset angle or displacement, if the Xoffset is greater than 0, the horizontal axial angle is adjusted to the right by the preset angle or displacement, and if the Xoffset =0, the marking is that the adjustment of the horizontal axial direction is completed. If the calculation is not the first time and the absolute value of the Yoffset is larger than the absolute value of the offset value calculated last time, the camera returns to the last vertical axial angle, and the adjustment of the marking vertical axial direction is completed; otherwise, according to the condition that the Yoffset is less than 0, the vertical axial angle of the camera is adjusted by 1 degree to the left, the vertical axial angle is adjusted by 1 degree to the right when the Yoffset is greater than 0, and the Yoffset =0, and the adjustment of the vertical axial direction is marked to be completed. And finally, if the adjustment of the horizontal axis is finished and the adjustment of the vertical axis is finished, the camera framing angle adjustment cycle is quitted.
In some possible implementations, a preset value of offset displacement may be preset in the system, and the preset value may include a preset value in a lateral direction and a preset value in a vertical direction. After determining the offset distance between the center point of the target object and the center point of the preset identification area, judging the size, and if the offset distance is within a preset value, namely both the Xoffset and the Yoffset are smaller than preset values in respective directions, continuing to shoot; if the offset distance is greater than the preset value, that is, if any one of the Xoffset and the Yoffset has a preset value greater than the corresponding direction, a control instruction is issued to the motion platform according to the corresponding offset distance, so that the motion platform drives the camera to perform the movement and/or rotation adjustment as described above.
In some possible implementations, after the step of controlling and adjusting the camera is completed, the control method may further include:
judging whether the area of the surrounding frame is smaller than a preset minimum identification area or not; if the minimum identification area is smaller than the area of the surrounding frame, the focal length of the camera is adjusted according to the size comparison result between the minimum identification area and the area of the surrounding frame, and the target object is continuously shot.
Specifically, the minimum recognition area may be set as a minimum recognition area required when performing subsequent processing on the target object, and the minimum recognition area may be measured by using a size of the image. If the area of the bounding box of the target object is smaller than the preset minimum identification area, the focal length of the camera can be adjusted according to the size comparison result between the minimum identification area and the area of the bounding box, so that the target object meeting the required size can be acquired, and the target object can be shot continuously. For example, in a face recognition scene, if a face is a target object, it is assumed that the size of a face position image to be selected in subsequent face recognition is 128 × 128 or more, that is, the area of the minimum recognition region is 128 × 128, and since the face shot by the camera is farther from the camera, the size of a bounding box of the face image in the initially captured image is 64 × 64. Therefore, the focal length of the camera can be adjusted according to the comparison result of 128 × 128 and 64 × 64, for example, the shooting can be continued by 2 times of zooming, so that a face image with the size of 128 × 128 is acquired.
In some possible implementation manners, if a camera is installed on the electronic device, before the step of acquiring an image acquired by the camera in S110, the method for controlling the camera may further include:
and detecting whether an object approaches, and starting the camera to take a picture when determining that the object approaches.
Specifically, a position sensor can be installed on the electronic device, the camera is in a closed state at ordinary times, and when the position sensor detects that an object is close to the position sensor, the camera is triggered and started to shoot. The power consumption required by the position sensor is low, the power consumption of the camera is high, and therefore the camera is controlled to be switched on and off through the position sensor, the power consumption problem caused by the fact that the camera is started directly is avoided, and the energy consumption of the whole equipment can be reduced.
In some possible implementations, after the step of acquiring the image captured by the camera at S110, the method for controlling the camera may further include:
and saving the image/video data of the target object, and clearing the image/video data of the target object.
Specifically, if the camera is in a shooting state all the time, only the image/video data of the target object can be stored, and the image/video data of the target object can be cleared, so that the storage occupation of the device can be reduced.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method and the device, after the image collected by the camera is obtained, whether the target object exists in the image can be further detected, and if the target object exists, the central point of the target object can be further determined. Then, the offset distance between the center point of the determined target object and the center point of the preset identification area can be detected, and the camera is moved and/or rotated according to the offset distance to reduce the offset distance in the subsequently taken image so as to continue to take the target object. According to the scheme, the camera is moved and/or rotated, so that the shot target object can be located in the center position of the preset identification area as far as possible. Therefore, the influence on shooting caused by different heights and different positions of the collected object in the prior art can be effectively avoided, and the collected object can be shot as accurately as possible.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware associated with computer readable instructions, which can be stored in a computer readable storage medium, and when executed, the processes of the embodiments of the methods described above can be included. The storage medium may be a non-volatile storage medium such as a magnetic disk, an optical disk, a Read-Only Memory (ROM), or a Random Access Memory (RAM).
It should be understood that, although the steps in the flowcharts of the figures are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least a portion of the steps in the flow chart of the figure may include multiple sub-steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
With further reference to fig. 2, as an implementation of the method shown in fig. 1, the present application provides an embodiment of a control device for a camera, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 1, and the device may be applied to various electronic devices.
As shown in fig. 1, the control device of the camera according to the present embodiment includes:
an obtaining module 210, configured to obtain an image acquired by a camera;
a target detection module 220, configured to detect whether a target object exists in the image, and when the target object exists, determine a central point of the target object;
a calculating module 230, configured to detect an offset distance between a center point of the target object and a center point of a preset identification area;
and the control module 240 is configured to perform gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the adjustment is stopped when it is determined that the offset distance detected after the adjustment is minimum, and shoot the target object.
In some possible implementations, the object detection module 220 specifically includes
The target classification submodule is used for detecting whether the target object exists in the image or not by using a preset target detection model;
and the target positioning sub-module is used for generating a surrounding frame of the target object if the target object exists, and taking the central point of the surrounding frame as the central point of the target object.
In some possible implementations, the target positioning sub-module specifically includes:
and the target positioning unit is used for selecting the target object with the largest occupied area according to a maximum area principle if the target objects exist and at least two target objects exist, generating a surrounding frame of the target object with the largest occupied area, and taking the central point of the surrounding frame as the central point of the target object.
In some possible implementations, the control device further includes:
the first judgment module is used for judging whether the area of the surrounding frame is smaller than a preset minimum identification area or not;
and the adjusting module is used for adjusting the focal length of the camera according to the size comparison result between the minimum identification area and the area of the surrounding frame if the minimum identification area is smaller than the area of the surrounding frame, and continuously shooting the target object.
In some possible implementations, the control device further includes:
and the object detection module is used for detecting whether an object approaches and starting the camera to take a picture when determining that the object approaches.
In some possible implementations, the control device further includes:
and the storage module is used for storing the image/video data of the target object and clearing the image/video data of the target object.
In some possible implementations, the control device further includes:
the second judgment module is used for determining whether the offset distance is greater than a preset value;
the control module 240 specifically includes:
the control submodule is used for adjusting the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance if the offset distance is larger than the preset value, re-shooting an image after adjustment to detect the offset distance, and re-adjusting the camera according to the fixed displacement and/or the fixed angle when the re-detected offset distance is larger than the preset value until the fact that the offset distance detected after adjustment is smaller than or equal to the preset value is determined; and if the offset distance is smaller than or equal to the preset value, shooting the target object.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
in the application, after the control device of the camera acquires the image acquired by the camera, whether the target object exists in the image can be further detected, and if the target object exists, the central point of the target object can be further determined. Then, the offset distance between the center point of the determined target object and the center point of the preset identification area can be detected, and the camera is moved and/or rotated according to the offset distance to reduce the offset distance in the subsequently taken image so as to continue to take the target object. According to the scheme, the camera is moved and/or rotated, so that the shot target object can be located in the center position of the preset identification area as far as possible. Therefore, the influence on shooting caused by different heights and different positions of the collected object in the prior art can be effectively avoided, and the collected object can be shot as accurately as possible.
In order to solve the technical problem, the embodiment of the application further provides computer equipment. Referring to fig. 3, fig. 3 is a block diagram of a basic structure of a computer device according to the present embodiment.
The computer device 3 comprises a memory 310, a processor 320, a network interface 330 communicatively connected to each other via a system bus. It is noted that only the computer device 3 having the components 310-330 is shown, but it is understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead. As will be understood by those skilled in the art, the computer device is a device capable of automatically performing numerical calculation and/or information processing according to a preset or stored instruction, and the hardware includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, and the like.
The computer device can be a desktop computer, a notebook, a palm computer, a cloud server and other computing devices. The computer equipment can carry out man-machine interaction with a user in a keyboard mode, a mouse mode, a remote controller mode, a touch panel mode or a voice control equipment mode.
The memory 310 includes at least one type of readable storage medium including a flash memory, a hard disk, a multimedia card, a card type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a Read Only Memory (ROM), an Electrically Erasable Programmable Read Only Memory (EEPROM), a Programmable Read Only Memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the storage 310 may be an internal storage unit of the computer device 3, such as a hard disk or a memory of the computer device 3. In other embodiments, the memory 310 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device 3. Of course, the memory 310 may also comprise both an internal storage unit of the computer device 3 and an external storage device thereof. In this embodiment, the memory 310 is generally used for storing an operating system installed in the computer device 3 and various types of application software, such as computer readable instructions of a control method of a camera. In addition, the memory 310 may also be used to temporarily store various types of data that have been output or are to be output.
The processor 320 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 320 is typically used to control the overall operation of the computer device 3. In this embodiment, the processor 320 is configured to execute computer-readable instructions stored in the memory 310 or process data, for example, execute computer-readable instructions of the control method of the camera.
The network interface 330 may include a wireless network interface or a wired network interface, and the network interface 330 is generally used for establishing a communication connection between the computer device 3 and other electronic devices.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method and the device, after the image acquired by the camera is acquired, whether the target object exists in the image can be further detected, and if the target object exists, the central point of the target object can be further determined. Then, the offset distance between the center point of the determined target object and the center point of the preset identification area can be detected, and the camera is moved and/or rotated according to the offset distance to reduce the offset distance in the subsequently taken image so as to continue to take the target object. According to the scheme, the camera is moved and/or rotated, so that the shot target object can be located in the center position of the preset identification area as far as possible. Therefore, the influence on shooting caused by different heights and different positions of the collected object in the prior art can be effectively avoided, and the collected object can be shot as accurately as possible.
The present application provides yet another embodiment, which is to provide a computer-readable storage medium storing computer-readable instructions executable by at least one processor to cause the at least one processor to perform the steps of the control method of the camera as described above.
Compared with the prior art, the embodiment of the application mainly has the following beneficial effects:
according to the method and the device, after the image collected by the camera is obtained, whether the target object exists in the image can be further detected, and if the target object exists, the central point of the target object can be further determined. Then, the offset distance between the center point of the determined target object and the center point of the preset identification area can be detected, and the camera is moved and/or rotated according to the offset distance to reduce the offset distance in the subsequently taken image so as to continue to take the target object. According to the scheme, the camera is moved and/or rotated, so that the shot target object can be located in the center position of the preset identification area as far as possible. Therefore, the influence on shooting caused by different heights and different positions of the collected object in the prior art can be effectively avoided, and the collected object can be shot as accurately as possible.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present application.
It is to be understood that the above-described embodiments are merely illustrative of some, but not restrictive, of the broad invention, and that the appended drawings illustrate preferred embodiments of the invention and do not limit the scope of the invention. This application is capable of embodiments in many different forms and is provided for the purpose of enabling a thorough understanding of the disclosure of the application. Although the present application has been described in detail with reference to the foregoing embodiments, it will be apparent to one skilled in the art that the present application may be practiced without modification or with equivalents of some of the features described in the foregoing embodiments. All equivalent structures made by using the contents of the specification and the drawings of the present application are directly or indirectly applied to other related technical fields and are within the protection scope of the present application.
Claims (10)
1. A control method of a camera is characterized by comprising the following steps:
acquiring an image acquired by a camera;
detecting whether a target object exists in the image, and determining a central point of the target object when the target object exists;
detecting the offset distance between the central point of the target object and the central point of a preset identification area;
and performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the detected offset distance after adjustment is minimum is determined, stopping adjustment, and shooting the target object.
2. The control method according to claim 1, wherein the step of detecting whether a target object exists in the image and determining a center point of the target object when the target object exists specifically comprises:
detecting whether the target object exists in the image or not by using a preset target detection model;
and if the target object exists, generating a surrounding frame of the target object, and taking the central point of the surrounding frame as the central point of the target object.
3. The control method according to claim 2, wherein the step of generating a bounding box of the target object if the target object exists, and taking a center point of the bounding box as a center point of the target object specifically includes:
if the target objects exist, and at least two target objects exist, selecting the target object with the largest occupied area according to a maximum area principle, generating a surrounding frame of the target object with the largest occupied area, and taking the central point of the surrounding frame as the central point of the target object.
4. The control method according to claim 2, wherein after the step of performing gradient adjustment of the camera according to a preset fixed displacement and/or a fixed angle according to the offset distance until stopping the adjustment when it is determined that the offset distance detected after the adjustment is minimum, and photographing the target object, the control method further comprises:
judging whether the area of the surrounding frame is smaller than a preset minimum identification area or not;
if the minimum identification area is smaller than the area of the surrounding frame, the focal length of the camera is adjusted according to the size comparison result between the minimum identification area and the area of the surrounding frame, and the target object is continuously shot.
5. The control method according to any one of claims 1 to 4, wherein, prior to the step of acquiring an image captured by a camera, the control method further comprises:
and detecting whether an object approaches, and starting the camera to take a picture when determining that the object approaches.
6. The control method according to any one of claims 1 to 4, wherein after the step of acquiring an image captured by a camera, the control method further comprises:
and saving the image/video data of the target object, and clearing the image/video data of the target object.
7. The control method according to any one of claims 1 to 4,
the step of performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the offset distance detected after adjustment is minimum is determined, stopping adjustment, and shooting the target object specifically comprises:
determining whether the offset distance is greater than a preset value;
if the offset distance is larger than the preset value, adjusting the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance, re-shooting an image after adjustment to detect the offset distance, and when the re-detected offset distance is larger than the preset value, re-adjusting the camera according to the fixed displacement and/or the fixed angle again until the offset distance detected after adjustment is determined to be smaller than or equal to the preset value;
and if the offset distance is smaller than or equal to the preset value, shooting the target object.
8. A control device for a camera, comprising:
the acquisition module is used for acquiring images acquired by the camera;
the target detection module is used for detecting whether a target object exists in the image and determining a central point of the target object when the target object exists;
the calculation module is used for detecting the offset distance between the central point of the target object and the central point of a preset identification area;
and the adjusting module is used for performing gradient adjustment on the camera according to a preset fixed displacement and/or a preset fixed angle according to the offset distance until the fact that the detected offset distance after adjustment is minimum is determined, stopping adjustment, and shooting the target object.
9. A computer device comprising a memory having computer readable instructions stored therein and a processor which when executed implements the steps of a method of controlling a camera head as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, having computer-readable instructions stored thereon, which, when executed by a processor, implement the steps of a method of controlling a camera head according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110467593.2A CN115250329B (en) | 2021-04-28 | 2021-04-28 | Camera control method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110467593.2A CN115250329B (en) | 2021-04-28 | 2021-04-28 | Camera control method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115250329A true CN115250329A (en) | 2022-10-28 |
CN115250329B CN115250329B (en) | 2024-04-19 |
Family
ID=83696572
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110467593.2A Active CN115250329B (en) | 2021-04-28 | 2021-04-28 | Camera control method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115250329B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116206094A (en) * | 2023-04-28 | 2023-06-02 | 尚特杰电力科技有限公司 | Fan blade angle measuring method, device and system and electronic equipment |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB319867A (en) * | 1928-07-23 | 1929-10-03 | Georges Basil Georgiadi S | Method and apparatus for aerial survey |
CN104486543A (en) * | 2014-12-09 | 2015-04-01 | 北京时代沃林科技发展有限公司 | Equipment and method for controlling cloud deck camera by intelligent terminal in touch manner |
CN104796672A (en) * | 2015-05-09 | 2015-07-22 | 合肥工业大学 | Emergency monitoring cloud platform device for unmanned aerial vehicle and operating method of emergency monitoring cloud platform device for unmanned aerial vehicle |
CN105763811A (en) * | 2016-03-31 | 2016-07-13 | 努比亚技术有限公司 | Shooting control device and method |
CN106027907A (en) * | 2016-06-30 | 2016-10-12 | 维沃移动通信有限公司 | Method for automatically adjusting camera, and mobile terminal |
CN205644294U (en) * | 2016-03-18 | 2016-10-12 | 北京光年无限科技有限公司 | Intelligent robot system that can trail in real time people's face |
CN107977981A (en) * | 2016-10-21 | 2018-05-01 | 杭州海康威视数字技术股份有限公司 | A kind of motion target tracking method and device |
CN108989672A (en) * | 2018-07-26 | 2018-12-11 | 维沃移动通信有限公司 | A kind of image pickup method and mobile terminal |
CN110460772A (en) * | 2019-08-14 | 2019-11-15 | 广州织点智能科技有限公司 | Camera Automatic adjustment method, device, equipment and storage medium |
CN111147749A (en) * | 2019-12-31 | 2020-05-12 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method, photographing device, terminal and storage medium |
WO2021008207A1 (en) * | 2019-07-17 | 2021-01-21 | 上海商汤智能科技有限公司 | Target tracking method and apparatus, intelligent mobile device and storage medium |
-
2021
- 2021-04-28 CN CN202110467593.2A patent/CN115250329B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB319867A (en) * | 1928-07-23 | 1929-10-03 | Georges Basil Georgiadi S | Method and apparatus for aerial survey |
CN104486543A (en) * | 2014-12-09 | 2015-04-01 | 北京时代沃林科技发展有限公司 | Equipment and method for controlling cloud deck camera by intelligent terminal in touch manner |
CN104796672A (en) * | 2015-05-09 | 2015-07-22 | 合肥工业大学 | Emergency monitoring cloud platform device for unmanned aerial vehicle and operating method of emergency monitoring cloud platform device for unmanned aerial vehicle |
CN205644294U (en) * | 2016-03-18 | 2016-10-12 | 北京光年无限科技有限公司 | Intelligent robot system that can trail in real time people's face |
CN105763811A (en) * | 2016-03-31 | 2016-07-13 | 努比亚技术有限公司 | Shooting control device and method |
CN106027907A (en) * | 2016-06-30 | 2016-10-12 | 维沃移动通信有限公司 | Method for automatically adjusting camera, and mobile terminal |
CN107977981A (en) * | 2016-10-21 | 2018-05-01 | 杭州海康威视数字技术股份有限公司 | A kind of motion target tracking method and device |
CN108989672A (en) * | 2018-07-26 | 2018-12-11 | 维沃移动通信有限公司 | A kind of image pickup method and mobile terminal |
WO2020020134A1 (en) * | 2018-07-26 | 2020-01-30 | 维沃移动通信有限公司 | Photographing method and mobile terminal |
WO2021008207A1 (en) * | 2019-07-17 | 2021-01-21 | 上海商汤智能科技有限公司 | Target tracking method and apparatus, intelligent mobile device and storage medium |
CN110460772A (en) * | 2019-08-14 | 2019-11-15 | 广州织点智能科技有限公司 | Camera Automatic adjustment method, device, equipment and storage medium |
CN111147749A (en) * | 2019-12-31 | 2020-05-12 | 宇龙计算机通信科技(深圳)有限公司 | Photographing method, photographing device, terminal and storage medium |
Non-Patent Citations (1)
Title |
---|
贾晓辉: "圆管外圆周焊接移动式机器人及其控制***的研究", 《优秀硕士论文》, 1 February 2003 (2003-02-01) * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116206094A (en) * | 2023-04-28 | 2023-06-02 | 尚特杰电力科技有限公司 | Fan blade angle measuring method, device and system and electronic equipment |
CN116206094B (en) * | 2023-04-28 | 2023-07-21 | 尚特杰电力科技有限公司 | Fan blade angle measuring method, device and system and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN115250329B (en) | 2024-04-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3872689B1 (en) | Liveness detection method and device, electronic apparatus, storage medium and related system using the liveness detection method | |
CN108229324B (en) | Gesture tracking method and device, electronic equipment and computer storage medium | |
WO2019133403A1 (en) | Multi-resolution feature description for object recognition | |
US9208579B2 (en) | Object tracking device | |
WO2020184207A1 (en) | Object tracking device and object tracking method | |
US20180211096A1 (en) | Living-body detection method and device and computer program product | |
US20120086778A1 (en) | Time of flight camera and motion tracking method | |
CN111626163B (en) | Human face living body detection method and device and computer equipment | |
CN102103457B (en) | Briefing operating system and method | |
CN107633208B (en) | Electronic device, the method for face tracking and storage medium | |
CN111753882B (en) | Training method and device of image recognition network and electronic equipment | |
CN113012383B (en) | Fire detection alarm method, related system, related equipment and storage medium | |
CN113228626B (en) | Video monitoring system and method | |
CN110738078A (en) | face recognition method and terminal equipment | |
JP2010160743A (en) | Apparatus and method for detecting object | |
CN112183431A (en) | Real-time pedestrian number statistical method and device, camera and server | |
CN115250329B (en) | Camera control method and device, computer equipment and storage medium | |
CN114861241A (en) | Anti-peeping screen method based on intelligent detection and related equipment thereof | |
WO2021196925A1 (en) | Method and apparatus for detecting and tracking moving object | |
CN113243015A (en) | Video monitoring system and method | |
CN115620378A (en) | Multi-view cow face intelligent acquisition method, device and system and related equipment | |
CN115514887A (en) | Control method and device for video acquisition, computer equipment and storage medium | |
US11790483B2 (en) | Method, apparatus, and device for identifying human body and computer readable storage medium | |
CN115049990A (en) | Data processing method, device and storage medium | |
CN112149463A (en) | Image processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |