Focusing method of camera device, camera device and computer readable storage medium

By storing the shooting record and lens position in the camera device, and directly obtaining the lens position with the shooting information label for focus, the problems of slow focus speed and empty lens return of the surveillance camera are solved, achieving faster focus speed and higher efficiency.

CN118945470APending Publication Date: 2024-11-12SHENZHEN BAICHUAN SECURITY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411005738.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-24
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

Existing surveillance cameras have slow focus speed and are prone to empty shots, resulting in low focus efficiency and potentially damage to the focus motor.

Method used

By pre-storing the shooting records in the camera device, recording the lens position using the shooting information tag, directly obtaining the lens position from the database during subsequent shooting, generating focus control commands, adjusting the lens to the corresponding position, avoiding multiple adjustments and reducing the focus motor The empty return.

Benefits of technology

It improves the focus speed of the camera equipment, reduces the number of lens adjustments, extends the service life of the motor, and improves the focus efficiency and stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118945470A_ABST
    Figure CN118945470A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of video monitoring, and discloses a focusing method of camera equipment, the camera equipment and a computer readable storage medium, and the method comprises the steps: obtaining a shooting information label from the shooting information of the camera equipment, judging whether a lens position corresponding to the shooting information label exists in a first database or not, and if yes, obtaining a shooting information label; if the lens position corresponding to the shooting information label exists in the first database, the lens position corresponding to the shooting information label is obtained from the first database according to the shooting information label, and then a focusing control instruction is generated according to the lens position; and finally, according to the focusing control instruction, controlling a shooting lens of the camera equipment to be arranged at a lens position corresponding to the shooting information label so as to complete focusing of the camera equipment. Through the above mode, rapid focusing of the camera device is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of video surveillance technology, and in particular to a focusing method of a camera device, a camera device, and a computer-readable storage medium. Background Art

[0002] During the shooting process of a surveillance camera, the distance between the camera and the subject is constantly changing. In order to keep the image captured by the surveillance camera clear, the focal length and focus position of the lens need to be constantly changed. This process of adjusting the focal length and focus position is called focusing. Focusing is generally divided into manual focus and automatic focus. Manual focus is the focus of the human eye. During the shooting process of a surveillance camera, the image in the viewfinder is observed through the human eye while manually adjusting the focus. When the eye determines that the image in the viewfinder is clear, the focus is good. Automatic focus is a technology that combines sensors and lenses. When the distance between the surveillance target and the lens changes, the automatic focus system analyzes the image captured by the image sensor to determine the clarity of the image. Once the clarity of the image is detected to be reduced, the automatic focus system will drive the motor to adjust the position of the lens group inside the lens to change the focal length and focus position of the lens.

[0003] At present, in order to make the use of surveillance cameras more convenient, an autofocus system is usually integrated into the surveillance camera. When it is detected that the clarity of the image has decreased, the position of the lens will be adjusted in the adjustable area of ​​the lens with a larger moving step, and the clarity of the images obtained by the lens in different positions will be compared. Then, the lens adjustment area for the next round will be determined based on the comparison results, and the moving step will be appropriately reduced. Then, the above process will be repeated until the lens moving step is reduced to a certain threshold. It is considered that the best focus position has been found, that is, the focus of the surveillance camera is completed. In addition, in the existing autofocus system, when the area photographed by the surveillance camera changes, the autofocus system will automatically focus. Even for areas that the surveillance camera often photographs, it is necessary to continuously adjust the position of the lens to find the best focus position.

[0004] The inventors of the present application discovered during research that the focusing method in the above-mentioned surveillance camera will result in a slow focusing speed of the surveillance camera, and during the focusing process, the shooting lens will often have an empty return phenomenon, resulting in low focusing efficiency and easily causing damage to the motor controlling the shooting lens. Summary of the invention

[0005] In view of the above problems, the embodiments of the present application provide a focusing method of a camera device, a camera device and a computer-readable storage medium, which are used to solve the problems of slow focusing speed and empty return of the shooting lens in the prior art.

[0006] According to one aspect of an embodiment of the present application, a focusing method for a camera device is provided, the method comprising: obtaining a shooting information tag from shooting information of the camera device; determining whether a lens position corresponding to the shooting information tag exists in a first database; if a lens position corresponding to the shooting information tag exists in the first database, obtaining the lens position corresponding to the shooting information tag from the first database according to the shooting information tag; generating a focus control instruction for the camera device according to the lens position; and controlling the shooting lens of the camera device to be set at the lens position corresponding to the shooting information tag according to the focus control instruction to complete the focusing of the camera device.

[0007] In an optional manner, the method further includes: obtaining input user mark information, wherein the user mark information is used to mark the lens position corresponding to the shooting area; obtaining the current lens position of the camera device; using the user mark information as a shooting information tag, and associating the shooting information tag with the current lens position, and storing them in a first database.

[0008] In an optional manner, the method also includes: determining whether the current time of the camera device meets the shooting trigger time, and associating the shooting trigger time with the user tag information; when the current time of the camera device meets the shooting trigger time, obtaining the user tag information associated with the shooting trigger time, and generating shooting information based on the user tag information.

[0009] In an optional manner, the method also includes: if the lens position corresponding to the shooting information tag does not exist in the first database, gradually adjusting the shooting lens according to the clarity of the image captured by the shooting lens to complete the focus of the camera device; capturing an image of the shooting area through the shooting lens; obtaining the current lens position of the camera device; using the image of the shooting area as the shooting information tag, and associating the shooting information tag with the current lens position, and storing them in the first database.

[0010] In an optional manner, the method further includes: associating the image of the shooting area with the current lens position and storing them in a second database, wherein the second database is used to store shooting records of the camera device, the shooting records including the image of the shooting area and the lens position corresponding thereto; analyzing the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record; comparing the shooting frequency corresponding to each shooting record with a preset threshold, and updating the shooting records corresponding to the shooting frequency that meets the preset threshold into the first database.

[0011] In an optional manner, obtaining a lens position corresponding to a shooting information tag from a first database according to the shooting information tag specifically includes: calculating a similarity between an image of a shooting area corresponding to the shooting information tag and each image in the first database; and determining a lens position corresponding to the shooting information tag according to the similarity.

[0012] In an optional manner, the method also includes: if the lens position corresponding to the shooting information tag does not exist in the first database, gradually adjusting the shooting lens according to the clarity of the image captured by the shooting lens to complete the focus of the camera device; obtaining the shooting time of the camera device and the current lens position of the camera device; using the shooting time as the shooting information tag, and associating the shooting information tag with the current lens position, and storing them in a second database, wherein the second database is used to store the shooting records of the camera device, the shooting records including the shooting time and the lens position corresponding thereto; analyzing the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record; comparing the shooting frequency corresponding to each shooting record with a preset threshold, and updating the shooting records corresponding to the shooting frequency that meets the preset threshold to the first database.

[0013] In an optional manner, the method also includes: determining whether the current time of the camera device meets the shooting trigger time, the shooting trigger time is associated with the shooting time; when the current time of the camera device meets the shooting trigger time, obtaining the shooting time associated with the shooting trigger time, and generating shooting information based on the shooting time.

[0014] In an optional manner, a shooting information tag is obtained from the shooting information of a camera device, including: obtaining multiple shooting information tags and the shooting priority corresponding to each shooting information tag from the shooting information; comparing the shooting priorities corresponding to each shooting information tag, and obtaining the shooting information tag corresponding to the highest shooting priority.

[0015] According to another aspect of an embodiment of the present application, a camera device is provided, which includes a shooting lens, a memory and a processor; the shooting lens is used to capture images; the memory is used to store computer programs; the processor executes the computer program to implement the focusing method of the camera device described in any one of the above items.

[0016] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the focusing method of the camera device described in any one of the above items is implemented.

[0017] In the embodiment of the present application, by pre-storing the shooting records of the camera device in the first database and recording the corresponding lens position through the shooting information tag, in the subsequent shooting process, the camera device can directly obtain the corresponding lens position from the first database according to the shooting information tag in the shooting information, and generate a focus control instruction to adjust the shooting lens according to the lens position. The controller of the camera device only needs to adjust the lens group in the shooting lens to the corresponding position according to the lens position, so that the shooting picture of the camera device can be clear, without the need to adjust the position of the lens group in the shooting lens back and forth many times, and the focusing speed of the camera device is faster. When the lens group in the shooting lens is adjusted by the focus motor, the focus motor only needs to rotate to the corresponding position to complete the focus, without the need to rotate back and forth to find the best focus position, effectively avoiding the problem of empty return of the focus motor.

[0018] The camera device and computer-readable storage medium provided in the present application have the same advantages as the focusing method of the above-mentioned camera device over the prior art, which will not be repeated here.

[0019] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are only used to illustrate the embodiments and are not to be considered as limiting the present application. In addition, the same reference symbols are used to represent the same components throughout the accompanying drawings. In the accompanying drawings:

[0021] Figure 1 A schematic diagram showing an application scenario of the focusing method of a camera device provided in an embodiment of the present application is shown;

[0022] Figure 2 A schematic diagram of the structure of a camera device provided in an embodiment of the present application is shown;

[0023] Figure 3 A schematic diagram showing a flow chart of a focusing method for an imaging device provided in a first embodiment of the present application is shown;

[0024] Figure 4 A schematic flow chart of a process for generating a first database in a focusing method for an imaging device provided in an embodiment of the present application is shown;

[0025] Figure 5 A schematic diagram of a first process of automatically updating a first database in a focusing method of a camera device provided in an embodiment of the present application is shown;

[0026] Figure 6A second flow chart of automatically updating the first database in the focusing method of the camera device provided in the embodiment of the present application is shown;

[0027] Figure 7 A third flow chart of automatically updating the first database in the focusing method of the camera device provided in the embodiment of the present application is shown;

[0028] Figure 8 A schematic diagram showing a flow chart of a focusing method for an imaging device provided in a second embodiment of the present application is shown;

[0029] Fig. 9 A schematic flow chart of a focusing method for an imaging device provided in a third embodiment of the present application is shown. DETAILED DESCRIPTION

[0030] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein.

[0031] See also Figure 1 As shown, Figure 1 The following is a schematic diagram showing an application scenario of the focusing method of a camera device provided in an embodiment of the present application. Figure 1 As shown, the focusing method of the camera device in the embodiment of the present application is applied to the camera device 1. The camera device 1 can be a camera for security monitoring, an IP camera or other video monitoring equipment. The camera device 1 can establish a communication connection with the electronic device 2 through a network 3. The electronic device 2 can be a touch-screen mobile phone, a smart phone, a tablet computer, a portable electronic device or other terminal electronic device with a display screen. The network 3 includes but is not limited to one or more of a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a 4G / 5G network, WIFI, Bluetooth (Bluetooth) and a point-to-point (P2P) communication network.

[0032] In the embodiment of the present application, the camera device 1 and the electronic device 2 may include one or more processors, which may be a central processing unit CPU, or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the present embodiment, which is not limited here. The one or more processors included in the electronic device may be processors of the same type, such as one or more CPUs; or they may be processors of different types, such as one or more CPUs and one or more ASICs, which is not limited here.

[0033] In an embodiment of the present application, the camera device 1 is installed in an area that needs to be monitored (such as a home, office, shopping mall, etc.), so that the camera device 1 can continuously capture surveillance videos in the monitored area and send the captured videos to the terminal electronic device 2 through the network 3 for users to browse.

[0034] See also Figure 2 As shown, Figure 2 FIG. 1 shows a schematic diagram of the structure of the camera device provided in an embodiment of the present application. Figure 2 As shown, the camera device 1 may include a shooting lens 11, a memory 12 and a processor 13. The shooting lens 11 is used to capture images, the memory 12 is used to store a computer program 14, and the processor 13 executes the computer program 14 to implement a focusing method of the camera device.

[0035] Among them, the shooting lens 11 is used to shoot and record the shooting area of ​​the camera device 1. A lens group is arranged inside the shooting lens 11, and the lens group can focus the light in the scene onto the image sensor 15 of the camera device 1, and then form an image on the display screen of the camera device 1 or the electronic device 2. During the focusing process of the camera device 1, adjusting the shooting lens 11 is actually adjusting the position of the lens group inside the shooting lens 11 to adjust the distance between the lens group and the image sensor 15 (i.e., the focal length). The lens group includes but is not limited to one or more of a convex lens, a concave lens, a zoom lens, and an infrared lens.

[0036] The processor 13 is used to execute the computer program 14, and specifically can execute the relevant steps in the embodiment of the focusing method of the camera device provided in the present application. Specifically, the computer program 14 can include computer executable instructions.

[0037] The processor 13 may be a CPU, or an ASIC, or one or more integrated circuits configured to implement the embodiments of the present application. The one or more processors included in the camera device 1 may be processors of the same type, such as one or more CPUs; or may be processors of different types, such as one or more CPUs and one or more ASICs.

[0038] The memory 12 is used to store a computer program 14. The memory 12 may include a high-speed RAM memory, and may also include a non-volatile memory, such as at least one disk memory.

[0039] In the embodiment of the present application, the camera device 1 further includes a focus motor 16. The processor 13 obtains the lens position from the first database by executing the steps in the embodiment of the focusing method of the camera device described below, and generates a corresponding focus control instruction according to the lens position and the current position of the focus motor 16 to control the focus motor 16 to drive the shooting lens 11 to move, so as to adjust the shooting lens 11 to complete the focus of the camera device. The focus motor 16 may include a zoom motor and a focus motor, wherein the zoom motor is used to adjust the focal length, and the focus motor is used to adjust the focal position.

[0040] Figure 3 FIG. 1 is a flow chart of a focusing method for an image pickup device provided in a first embodiment of the present application, and the method is applied to an image pickup device 1. In the embodiment of the present application, the focusing method for an image pickup device can be executed by a controller (e.g., processor 13) in the image pickup device 1. Figure 3 As shown, the method comprises the following steps:

[0041] Step S100: obtaining a shooting information tag from shooting information of a camera device.

[0042] The shooting information is used to characterize the focus adjustment requirements of the camera device 1, that is, the controller of the camera device 1 can adjust the focal length and focus of the camera device 1 according to the shooting information. The shooting information can be automatically generated by the controller of the camera device 1. For example, when the controller of the camera device 1 detects that the current image captured by the shooting lens 11 is blurred, it will generate shooting information according to the image of the shooting area; or when the time on the camera device 1 meets the shooting trigger time and the shooting lens 11 needs to be adjusted to shoot other areas, the controller of the camera device 1 can obtain the associated user-set tag or the time on the camera device 1 according to the shooting trigger time to generate shooting information. The shooting information can also be the shooting requirements sent by the user. For example, after the user sets the corresponding tag for the area that is often shot, when the camera lens 11 needs to be called to shoot the area, the corresponding tag can be clicked on the display screen of the camera device 1 or the electronic device 2, so that the display screen sends the shooting information generated according to the tag to the controller of the camera device 1.

[0043] In order to solve the problems of focus motor backlash and low focus efficiency in the prior art, a shooting information tag is set in the embodiment of the present application, and the shooting information tag is used to mark the lens position corresponding to a specific shooting area, so that the controller of the camera device 1 can directly determine the lens position through the shooting information tag. The shooting information tag can be a tag information pre-set by the user, for example, after the user shoots a certain shooting area, the user sets a tag for the area that is frequently shot; the shooting information tag can also be information automatically obtained by the camera device 1, for example, an image of the shooting area, the time on the camera device 1, etc.

[0044] Step S200: Determine whether there is a lens position corresponding to the shooting information tag in the first database.

[0045] If it exists, it means that there is a shot position that has been shot before in the first database, which can be directly called and step S300 is executed.

[0046] If not, it means that there is no lens position that has been photographed in the first database, and the lens position needs to be readjusted, and step S210 is executed.

[0047] Step S300: if the lens position corresponding to the shooting information tag exists in the first database, the lens position corresponding to the shooting information tag is obtained from the first database according to the shooting information tag.

[0048] The first database is used to store shooting information tags and the lens positions corresponding thereto. The data in the first database can be saved by the user. For example, after the camera device 1 is installed, the user sets corresponding tags for the areas that are frequently photographed according to his / her own usage habits. The controller of the camera device 1 associates the tags set by the user with the lens positions of the camera device 1 and stores them in the first database. In the embodiment of the present application, as an example, a save button can be set in the display interface of the electronic device 2. The user can associate the lens position of the camera device 1 with the tags set by the user by clicking the save button and store them in the first database. When the shooting area of ​​the camera device 1 needs to be adjusted, the button corresponding to the tag set by the user can be clicked, so that the electronic device 2 uses the tags set by the user as shooting information tags and sends shooting information to the controller of the camera device 1.

[0049] The data in the first database can also be automatically saved by the controller of the camera device 1. Specifically, when the camera device 1 shoots a new area, after the camera device 1 completes the focus using an automatic focus adjustment method such as an exhaustive search method, a hill climbing search method, or a neural network model, the image of the area is associated with the lens position after the camera device 1 completes the focus, and is stored in the first database. The next time the camera device 1 shoots the area, the image of the area can be used as a shooting information tag to directly obtain the corresponding lens position from the first database without the need to use an automatic focus adjustment method for focus adjustment. The controller of the camera device 1 can also save the shooting records of the camera device, associate the time when the controller of the camera device 1 adjusts the position of the shooting lens 11 with the lens position after the focus adjustment, and store them as shooting records. By analyzing the shooting records, the user's habits of using the camera device 1 can be obtained. When the controller of the camera device 1 detects that the user often makes the same adjustment to the shooting lens 11 of the camera device 1 at a certain time, the time and the corresponding lens position can be stored in the first database. When the time comes again, the controller of the camera device 1 can automatically use the time as a shooting information tag, and automatically obtain the lens position to adjust the shooting lens 11.

[0050] The first database can be stored in a storage medium on the camera device 1, and the storage medium can be a memory 12, a hard disk, etc. set inside the camera device 1, or an external storage medium connected to the camera device 1, such as a USB flash drive, a hard disk, an optical disk, etc.; the first database can also be stored in a server device that can store data, such as a server or a cloud connected to the camera device 1 via the network 3.

[0051] When the shooting information tags have multiple types, corresponding tags can be set for the shooting information tags, and corresponding tags can be set for different types of data in the first database, so that when the controller of the camera device 1 obtains the lens position, it can search for the corresponding data according to the tags corresponding to the shooting information tags, without searching all the data in the first database. Of course, the data corresponding to different types of shooting information tags in the first database can also be stored in different data tables, and when the controller of the camera device 1 obtains the lens position, it only needs to search the corresponding data table according to the tags corresponding to the shooting information tags.

[0052] Step S400: generating a focus control instruction of a camera device according to the lens position.

[0053] Among them, the lens position is used to characterize the focal length and focus position of the shooting lens 11 of the camera device 1. Specifically, when a lens group is provided in the shooting lens 11 of the camera device 1, the lens position may be the position of the lens group, that is, the positional relationship between the lenses in the lens group and the positional relationship between the lens group and the image sensor 15. In addition, when the position of the lens group is adjusted by the focus motor 16, the lens position may also be the position of the focus motor 16. Specifically, in the camera device 1, the moving direction of the lens group corresponds to the rotation direction of the focus motor 16, and the moving distance of the lens group corresponds to the number of rotations of the focus motor 16. When the camera device 1 adjusts the position of the lens group, it actually controls the focus motor 16 to rotate a corresponding number of rotations in a certain direction.

[0054] The controller of the camera device 1 can directly use the lens position as a focus control instruction. For example, when the lens group in the shooting lens 11 can adjust itself according to the instructions issued by the controller, the controller of the camera device 1 can directly use the lens position as a focus control instruction; when the lens group in the camera lens 11 is controlled by the focus motor 16, and the lens position is the position of the focus motor 16, the controller of the camera device 1 can directly use the lens position as a focus control instruction.

[0055] The controller of the camera device 1 can also obtain the current lens position of the camera device 1, determine the direction and distance of focus adjustment of the camera lens 11 in combination with the lens position, and finally generate a focus control instruction according to the direction and distance of focus adjustment. For example, when the lens group in the shooting lens 11 can be adjusted automatically according to the instructions issued by the controller, the controller of the camera device 1 can obtain the current position of the lens group, and then determine the moving direction and moving distance of the lens group in combination with the lens position, and finally generate a focus control instruction based on the moving direction and moving distance; when the lens group in the camera lens 11 is controlled by the focusing motor 16, if the lens position is the position of the lens group, the controller of the camera device 1 can obtain the current position of the lens group, and then determine the moving direction and moving distance of the lens group in combination with the lens position, and then determine the rotation direction and number of rotations of the focusing motor 16 based on the moving direction and moving distance, and finally generate a focus control instruction based on the rotation direction and number of rotations; if the lens position is the position of the focusing motor 16, the controller of the camera device 1 can obtain the current position of the focusing motor 16, and then determine the rotation direction and number of rotations of the focusing motor 16 based on the lens position, and finally generate a focus control instruction based on the rotation direction and number of rotations.

[0056] In addition, when the camera device 1 adjusts the shooting lens 11, it usually directly controls the focus motor 16 for adjustment. When the lens position is the position of the focus motor 16, the controller of the camera device 1 can directly generate a focus control instruction according to the position of the focus motor 16 to control the focus motor 16, without having to infer the position of the focus motor 16 according to the lens position, and then generate a focus control instruction according to the position of the focus motor 16. The controller of the camera device 1 generates the focus control instruction faster, which can improve the focusing speed of the camera device 1.

[0057] Step S500: According to the focus control instruction, the shooting lens 11 of the camera device 1 is controlled to be set at the lens position corresponding to the shooting information tag to complete the focus of the camera device.

[0058] Among them, when the controller of the camera device 1 directly uses the lens position as the focus control instruction, the component on the camera device 1 for adjusting the shooting lens 11 can determine the direction and distance of the focus adjustment of the shooting lens 11 in combination with the current lens position of the camera device 1, and then control the shooting lens 11 of the camera device 1 to move a corresponding distance in the direction of focus adjustment to complete the focus of the camera device 1. Taking the camera device 1 adjusting the shooting lens 11 through the focus motor 16 as an example, when the focus motor 16 receives the focus control instruction, it also needs to determine the rotation direction and number of rotations in combination with its current position, and finally rotate the corresponding number of rotations in the rotation direction to complete the focus of the camera device 1.

[0059] When the controller of the camera device 1 generates a focus instruction according to the direction and distance of the focus adjustment, the component on the camera device 1 for adjusting the shooting lens 11 can directly adjust the corresponding distance according to the direction of the focus adjustment to complete the focus of the camera device 1. Taking the camera device 1 adjusting the shooting lens 11 through the focus motor 16 as an example, when the focus motor 16 receives the focus control instruction, it can directly determine the rotation direction and the number of rotations according to the focus control instruction, and finally directly rotate the corresponding number of rotations according to the rotation direction to complete the focus of the camera device 1.

[0060] In summary, in the embodiment of the present application, by pre-storing the shooting records in the first database and recording the corresponding lens position through the shooting information tag, in the subsequent shooting process, the camera device 1 can directly obtain the corresponding lens position from the first database according to the shooting information tag in the shooting information, and generate a focus control instruction to adjust the shooting lens 11 according to the lens position. The controller of the camera device 1 only needs to adjust the lens group in the shooting lens 11 to the corresponding position according to the lens position, so that the shooting picture of the camera device 1 can be clear, and there is no need to adjust the position of the lens group in the shooting lens 11 back and forth many times, and the focusing speed of the camera device 1 is faster. When the lens group in the shooting lens 11 is adjusted by the focus motor 16, the focus motor 16 only needs to rotate to the corresponding position to complete the focus, and there is no need to rotate back and forth to find the best focus position, which effectively avoids the problem of the focus motor 16 returning empty.

[0061] In order to quickly obtain the lens position through the shooting information tag, it is necessary to set the shooting information tag and the lens position corresponding to the shooting information tag in advance in the first database. In some embodiments of the present application, for example Figure 4 As shown, Figure 4 A schematic flow chart of a process of generating a first database in a focusing method of a camera device provided in an embodiment of the present application is shown. The process of generating the first database includes:

[0062] Step S001: obtaining input user marking information, where the user marking information is used to mark the lens position corresponding to the shooting area.

[0063] After the user uses the camera device 1 to shoot a certain shooting area, completes focusing, and completes shooting, the user can mark the lens position corresponding to the shooting area through the display screen of the camera device 1 for subsequent direct use.

[0064] When the camera device 1 is provided with a display screen and the camera device 1 can be controlled through the display screen, the user tag information can be operated on the display screen of the camera device 1, and then sent to the controller of the camera device 1 by the display screen, or can be operated on the electronic device 2 that establishes a connection with the camera device 1, and then sent to the controller of the camera device 1 by the electronic device 2 through the network 3. The user tag information can be any label set by the user, for example, a label indicating a location, such as "door", "road", etc.; a label indicating a time, such as "morning", "noon", etc.; or other labels composed of any letters, numbers, words, etc.

[0065] Step S002: Acquire the current lens position of the camera device 1.

[0066] When the user needs to record the lens position corresponding to the current shooting area after completing shooting, the user mark information can be input through the display screen, and the lens position corresponding to the user mark information is the lens position of the camera device 1 at the current time. Among them, the current lens position obtained by the controller of the camera device 1 can include the overall position of the camera lens 11 in addition to representing the focal length and focus position of the shooting lens 11, so that the controller of the camera device 1 can adjust the shooting position of the shooting lens 11 according to the lens position to shoot a specific area.

[0067] Step S003: Using the user marking information as a shooting information tag, and associating the shooting information tag with the current lens position, and storing the tag in the first database.

[0068] After the user sets and saves the user mark information, the first database will record the current lens position corresponding to the user mark information, so that the camera device 1 can directly call the lens position corresponding to the user mark information to adjust the shooting lens 11 to shoot a specific area during the subsequent shooting process.

[0069] In the embodiment of the present application, as an example, it is assumed that the user needs to frequently call the camera device 1 to shoot the area corresponding to the "doorway". After the user completes the shooting of the "doorway" area by manual focusing and other methods, the user can choose to manually add user mark information through the setting options, such as: "doorway": the user clicks to save, and the system will automatically associate the user mark information "doorway" with the lens position at the current time and store it in the first database. In subsequent use, when the user directly clicks on "doorway" through the setting method, the controller of the camera device 1 will obtain the shooting information with the shooting information label "doorway", and then obtain the lens position corresponding to the "doorway" from the first database. Finally, adjust the area shot by the shooting lens 11 so that the shooting lens 11 shoots the area corresponding to the "doorway", and adjust the focal length and focus position of the shooting lens 11 so that the camera device 1 can obtain a clear image of the "doorway" area.

[0070] In an embodiment of the present application, the user saves the lens position corresponding to the area that the camera device 1 often needs to shoot according to his or her own habits, associates the input user mark information with the lens position, and stores it in the first database. When the camera device 1 needs to be used to shoot a certain area, it only needs to provide the user mark information corresponding to the area to the controller of the camera device 1, and the controller of the camera device 1 can automatically adjust the shooting lens 11 according to the lens position, making the use of the camera device 1 more convenient.

[0071] It should be pointed out that the generation process of the first database of steps S001-S003 and the execution order of step S100 do not necessarily have a sequence. The generation process of the first database can occur before step S100, that is, before shooting, the user first actively saves the lens positions corresponding to some areas that often need to be photographed using the camera device 1; it can also be set after completing a certain shooting, that is, the shooting process and the generation process of the first database are independent of each other. Only when the shooting information label and the lens position are saved in the first database can the empty return of the lens be effectively reduced and the focusing efficiency be improved.

[0072] In order to make the use of the camera device 1 more convenient, in some embodiments of the present application, in steps S001-S003, when the user sets the user tag information, new attribute information can also be set for the user tag information, such as setting the shooting trigger time in the user tag information. When the user sets the shooting trigger time, the camera device will trigger the relevant operation when the system time meets the shooting trigger time.

[0073] Furthermore, the focusing method of the camera device also includes:

[0074] Step S004a: determining whether the current time of the camera device 1 meets the shooting trigger time, and the shooting trigger time is associated and set in the user tag information;

[0075] Step S005a: when the current time of the camera device 1 meets the shooting trigger time, the user tag information associated with the shooting trigger time is acquired, and the shooting information is generated according to the user tag information.

[0076] Among them, the shooting trigger time plays a timing role, that is, when the user sets the user tag information, he can also set a time for the user tag information. As an example, assuming that the user needs to shoot the "door" at seven o'clock in the morning every day, after the user sets the "door" as the user mark information, he can also mark a time for the user mark information (that is, seven o'clock in the morning). During the operation of the camera device 1, the controller of the camera device 1 will obtain the time on the camera device 1. When the time on the camera device 1 meets "seven o'clock in the morning", the user mark information corresponding to "seven o'clock in the morning" (that is, the door) is obtained, and the shooting information is generated according to the user mark information, so that the controller of the camera device 1 adjusts the shooting lens 11 according to the shooting information.

[0077] Of course, in addition to being a specific time, the shooting trigger time can also be a time range, indicating that the camera device 1 needs to shoot the shooting area represented by the user mark information within the time range. In the embodiment of the present application, as an example, assuming that the shooting trigger time corresponding to the "door" is "7 am to 8 am", the controller of the camera device 1 can first save the current lens position at "7 am", and then adjust the shooting lens 11 according to the lens position corresponding to the "door", and at "8 am" the shooting lens 11 is adjusted according to the previously saved lens position to continue shooting the shooting area before "7 am".

[0078] The current time of the camera device 1 meets the requirements of the shooting trigger time. Specifically, the current time of the camera device 1 may be the same as the shooting trigger time. For example, if the shooting trigger time is "seven o'clock in the morning", the camera device 1 will generate shooting information based on the acquired user tag information only when the time on the camera device 1 is "7:00" or "7:00 in the morning"; if the shooting trigger time is "six thirty in the afternoon", the controller of the camera device 1 will generate shooting information based on the acquired user tag information only when the time on the camera device 1 is "18:30" or "6:30 in the afternoon", and so on. A time range can also be generated according to the shooting trigger time. When the current time of the camera device 1 is within this time range, the controller of the camera device 1 will generate shooting information according to the acquired user tag information. For example, assuming that the time five minutes before and after the shooting trigger time is the time range that satisfies the shooting trigger time, if the shooting trigger time is "seven o'clock in the morning", as long as the time on the camera device 1 is between "6:55 and 7:05" or between "6:55 and 7:05 in the morning", the controller of the camera device 1 will generate shooting information according to the acquired user tag information; if the shooting trigger time is "six thirty in the afternoon", as long as the time on the camera device 1 is between "18:25 and 18:35" or between "6:25 and 6:35 in the afternoon", the controller of the camera device 1 will generate shooting information according to the acquired user tag information, and so on.

[0079] In an embodiment of the present application, a user can set a shooting trigger time for the user marking information used at the same time according to his or her own usage habits, and associate the user marking information with the shooting trigger time, so that the controller of the camera device 1 can automatically adjust the shooting lens 11 to shoot the shooting area corresponding to the user marking information at a specific time, without the user having to click the button corresponding to the user marking information at a specific time to control the camera device 1 to shoot a specific area, which makes the use of the camera device 1 more convenient.

[0080] For the camera device 1 that has just completed initialization, usually no shooting information tag is recorded in the first database, and the user has not set the information in the first database. In this case, in some embodiments of the present application, such as Figure 5 As shown, Figure 5 A first flow chart of automatically updating the first database in the focusing method of the camera device provided in the embodiment of the present application is shown. During the use of the camera device 1, the automatic updating process of the first database includes:

[0081] Step S210: If the lens position corresponding to the shooting information tag does not exist in the first database, the shooting lens is gradually adjusted according to the clarity of the image captured by the shooting lens to complete the focus of the camera device.

[0082] Among them, when the lens position corresponding to the shooting information tag does not exist in the first database, the controller of the camera device 1 cannot directly adjust the shooting lens 11 according to the lens position. At this time, the shooting lens 11 can be adjusted by automatic focus adjustment methods such as exhaustive search method and hill climbing search method. However, these automatic focus adjustment methods need to adjust the shooting lens 11 back and forth many times to find the clearest position. Not only is the speed slow, but the focus motor 16 used to adjust the shooting lens 11 has a back-and-forth problem. Even if the clearest position is found, the shooting lens 11 may not be able to return to the clearest position due to the back-and-forth problem of the focus motor 16.

[0083] Therefore, a pre-trained neural network model can also be used to detect the clarity of the picture taken by the camera device 1. When adjusting the shooting lens 11, the neural network model is used in real time to detect the clarity of the picture taken by the camera device 1. When the detection result of the neural network model meets the requirements, that is, when the detection result of the neural network model is that the image is clear, or the clarity detected by the neural network model is greater than or equal to the preset clarity threshold, stop adjusting the shooting lens 11, thereby completing the focus of the camera device 1. A neural network is a neural network that simulates the human brain to achieve artificial intelligence-like machine learning technology. By training the neural network model, the accuracy of the neural network model's detection results of the clarity of the picture taken by the camera device 1 can be improved, so that when the camera device 1 adjusts the shooting lens 11, it can find the position with the clearest picture, and it can also avoid the problem of the focus motor 16 returning empty.

[0084] Step S220 : capturing an image of the shooting area through the shooting lens 11 .

[0085] Step S230a: Acquire the current lens position of the camera device.

[0086] Step S240a: Using the image of the shooting area as a shooting information tag, and associating the shooting information tag with the current lens position, and storing the tags in the first database.

[0087] When the camera device 1 is a surveillance camera device, its shooting area is relatively fixed, that is, the surveillance camera device may shoot the same area for a long time when in use, and only changes the shooting area occasionally. Therefore, when the shooting area of ​​the camera device 1 changes, the image of the shooting area and the corresponding lens position can be directly stored in the first database.

[0088] After the camera device 1 has completed focusing, the image of the shooting area is automatically saved. The image may be an image corresponding to the shooting area, a scene feature of the shooting area (for example, objects in the image corresponding to the shooting area, the positional relationship between the objects, etc.), etc. The scene feature of the shooting area may be obtained from the image corresponding to the shooting area by edge detection, contour extraction, image segmentation, angle detection, etc., and may also be obtained from the image corresponding to the shooting area by a deep learning model such as a convolutional neural network. In an embodiment of the present application, as an example, when the camera device 1 shoots the area of ​​the "doorway" for the first time, the camera device 1 will record the image of the "doorway" and the corresponding lens position. When the camera device 1 shoots the "doorway" next time, the corresponding lens position will be obtained from the first database according to the image captured by the shooting lens 11, and a focus control instruction will be generated according to the obtained lens position to adjust the shooting lens 11, without the need to gradually adjust the shooting lens 11 by an automatic focusing method.

[0089] In an embodiment of the present application, when the lens position corresponding to the shooting information tag does not exist in the first database, the lens position of the camera device 1 after focusing and the image of the shooting area will be associated and stored in the first database. When the same area is photographed next time, the controller of the camera device 1 can directly obtain the corresponding lens position from the first database, and then generate a focus control instruction according to the lens position to adjust the shooting lens 11, thereby achieving rapid focusing of the camera device 1.

[0090] When the camera device 1 frequently adjusts the shooting area, if the lens position corresponding to each shooting area is saved, the amount of data in the first database will be large, which not only requires a large amount of memory, but also takes more time to obtain the lens position corresponding to the shooting information tag from the first database. Therefore, in order to avoid the amount of data in the first database being too large, in some embodiments of the present application, such as Figure 6 As shown, Figure 6 A second flow chart of automatically updating the first database in the focusing method of the camera device provided in the embodiment of the present application is shown. The automatic updating process of the first database may also include:

[0091] Step S241a: Associating the image of the shooting area with the current lens position and storing them in a second database, wherein the second database is used to store shooting records of the camera device, and the shooting records include the image of the shooting area and the corresponding lens position.

[0092] In this embodiment, a second database is set up, which is used to store images of the shooting area captured during the use of the camera device 1 and the corresponding lens positions. The records in the second database cover all shooting records within a certain time period (for example, within the last three months or the last six months). The data volume is usually large and diverse; the first database is used to record images and lens positions screened out from the second database or set by the user.

[0093] The second database can be stored in a storage medium on the camera device 1, which can be a memory 12, a hard disk, etc. provided inside the camera device 1, or an external storage medium connected to the camera device 1, such as a USB flash drive, a hard disk, an optical disk, etc.; the second database can also be stored in a server device that can store data, such as a server or a cloud connected to the camera device 1 via the network 3. It should be noted that when the second database and the first database are provided in the same storage medium, the second database and the first database can be different data tables provided in the same database, or can be different database entities, which is not limited in this embodiment.

[0094] When storing the image of the shooting area and the current lens position, the image of the shooting area and the current lens position can be added to the second database as new data, or the data in the second database can be searched first to find out whether there is a shooting record that is the same as the image of the shooting area and the current lens position. If there is already a shooting record that is the same as the image of the shooting area and the current lens position in the second database, the number of records corresponding to the shooting record is updated. When there is no shooting record that is the same as the image of the shooting area and the current lens position in the second database, the image of the shooting area and the current lens position are added to the second database as new data. Of course, by obtaining the lens position from the first database and generating a focus control instruction according to the lens position to adjust the shooting lens 11, the image of the shooting area and the lens position can also be stored in the second database as a shooting record.

[0095] In addition, when searching whether there is already a shooting record with the same image of the shooting area and the current lens position in the second database, the similarity can be calculated between the image in the second database corresponding to the lens position with the same lens position as the current lens position and the image of the shooting area, and when the similarity between the image of the shooting area and the image in the second database is high, the two are regarded as the same data.

[0096] Step S242a: Analyze the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record.

[0097] Step S243a: Compare the shooting frequency corresponding to each shooting record with a preset threshold, and update the shooting record corresponding to the shooting frequency that meets the preset threshold into the first database.

[0098] When analyzing the shooting records, the number of times the image of the shooting area and the current lens position are recorded in the second database can be counted. When the number of times the image of the shooting area and the current lens position are recorded in the second database is greater than or equal to a preset threshold, the image of the shooting area and the current lens position are updated to the first database.

[0099] It is also possible to perform a statistical analysis on the number of times all the shooting records in the second database to obtain the frequency corresponding to each shooting record, and update the shooting records with a frequency higher than a preset threshold in all the shooting records to the first database, for example, update the shooting records with a frequency higher than a preset threshold such as 60% or 70% to the first database, or update the shooting records with a higher frequency in all the shooting records to the first database, for example, sort all the shooting records from high to low according to the corresponding frequency, and update the shooting records ranked in the top two, top three or top five to the first database.

[0100] When updating the shooting record to the first database, the shooting record can be stored in the first database as new data, or firstly check whether there is data in the first database with the same image as the image in the shooting record, and if so, update the lens position corresponding to the image in the first database. When the shooting record is the data with a higher frequency in the second database, these shooting records can overwrite the shooting record last updated to the first database, thereby realizing the update of the first database.

[0101] In the embodiment of the present application, the images of the shooting area and the corresponding lens positions are stored in the second database, and the shooting records in the second database are analyzed. From the analysis results, the user's usage habits of the camera device 1 are obtained to determine which areas are shot more frequently by the camera device 1, and the images and lens positions corresponding to these areas are updated to the first database, so that the camera device 1 can directly obtain the corresponding lens positions from the first database when shooting these areas, thereby realizing fast focusing of the camera device 1. The images and lens positions of the areas shot less frequently by the camera device 1 are not stored in the first database, which can effectively avoid the excessive amount of data in the first database, improve the efficiency of data search, and improve the focusing speed.

[0102] Further, in some examples of the present application, such as Figure 7 As shown, Figure 7 A third flow chart of automatically updating the first database in the focusing method of the camera device provided in the embodiment of the present application is shown. Further, the automatic updating process of the first database may also include:

[0103] Step S210 : if the lens position corresponding to the shooting information tag does not exist in the first database, the shooting lens 11 is gradually adjusted according to the clarity of the image captured by the shooting lens 11 to complete the focusing of the camera device 1 .

[0104] Step S230b: Acquire the shooting time of the camera device 1 and the current lens position of the camera device 1.

[0105] The user's habit of using the camera device 1 may be related not only to the area that the camera device 1 often shoots, but also to the shooting time of the camera device 1. For example, when the camera device 1 is used for patrol monitoring, the controller of the camera device 1 will adjust the shooting lens 11 according to the time to adjust the shooting area of ​​the camera device 1. At this time, regardless of whether the images of the shooting area are the same, as long as the time is the same, the controller of the camera device 1 will make the same adjustment to the shooting lens 11. In addition, when the user often adjusts the camera device 1 to shoot a certain area at the same time point, the shooting time of the camera device 1 and the lens position can also be associated. When the controller of the camera device 1 obtains the lens position from the first database, the lens position can be obtained by comparing whether the shooting time is the same, without calculating the similarity of the images and then obtaining the lens position based on the similarity. The controller of the camera device 1 can obtain the lens position faster.

[0106] Step S241b: Use the shooting time as a shooting information tag, associate the shooting information tag with the current lens position, and store them in a second database, wherein the second database is used to store the shooting records of the camera device 1, and the shooting records include the shooting time and the corresponding lens position.

[0107] Among them, during the use of the camera device 1, there is no necessary connection between the lens position of the camera device 1 and the shooting time. For example, the user adjusts the camera device 1 to shoot a certain area with high randomness. Taking the user adjusting the camera device 1 to shoot the "door" as an example, the user may adjust the camera device 1 in the "morning", or may adjust the camera device 1 in the "evening", or may even adjust the camera device 1 irregularly multiple times within a day. If the shooting time and the lens position are associated and stored in the first database every time the camera device 1 is adjusted, not only will the first database have a large amount of data, but these data will also affect the user's normal use of the camera device 1. Therefore, when storing data associated with the shooting time and lens position, the shooting time and current lens position of the camera device 1 need to be stored in the second database first, and the shooting records in the second database are analyzed to determine whether it is necessary to store the shooting time and current lens position in the first database.

[0108] When storing the shooting time and the current lens position, the shooting time and the current lens position can be added as new data to the second database, or the data in the second database can be searched first to find whether there is a shooting record with the same shooting time and the current lens position. If there is a shooting record with the same shooting time and the current lens position in the second database, the number of records corresponding to the shooting record is updated. When there is no shooting record with the same shooting time and the current lens position in the second database, the shooting time and the current lens position are added as new data to the second database. Of course, by obtaining the lens position from the first database and adjusting the shooting lens 11 according to the lens position, the shooting time and the lens position can also be stored as a shooting record in the second database.

[0109] The shooting time may include a time, for example, the time on the camera 1 is a certain hour and a certain minute, which may be a 12-hour time, such as "7:00 am", "6:00 pm", etc., or a 24-hour time, such as "7:00", "18:00", etc. The shooting time may also include a date, for example, the time on the camera is a certain year, month, day, day of the week, etc.

[0110] Step S242b: Analyze the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record.

[0111] Step S243b: Compare the shooting frequency corresponding to each shooting record with the preset threshold, and update the shooting record corresponding to the shooting frequency that meets the preset threshold into the first database.

[0112] Among them, when the shooting time only includes the moment, the user's habit of using the camera device 1 within a day (i.e., 24 hours) can be determined by analyzing the shooting time in the shooting record. For example, when the second database only records the shooting records of the past seven days and the shooting time is in 24-hour format, if "7:00" and the corresponding lens position appear seven times in the second database, it can be determined that the user will adjust the shooting lens 11 of the camera device 1 to the same position at seven o'clock every morning. At this time, "7:00" and the corresponding lens position can be stored in the first database, and so on.

[0113] When the shooting time includes not only the moment but also the date, not only the user's habit of using the camera device 1 within a day can be determined based on the moment, but also the user's habit of using the camera device 1 within a week or a month can be determined in combination with the date. For example, when the second database records the shooting records for half a year and the moment in the shooting time is in 24-hour format, if the shooting time "Monday 7:00" and the corresponding lens position appear in the second database the same number of times as the date "Monday" appears within half a year, it can be determined that the user will adjust the shooting lens 11 of the camera device 1 to the same position at 7 o'clock in the morning of every Monday. At this time, "Monday 7:00" and the corresponding lens position can be stored in the first database; if the shooting time "1st 7:00" and the corresponding lens position appear six times in the second database, it means that the user will adjust the shooting lens 11 of the camera device 1 to the same state at 7 o'clock in the morning on the 1st of each month. At this time, "1st 7:00" and the corresponding lens position can be stored in the first database, and so on.

[0114] When updating the shooting record to the first database, the shooting record can be stored in the first database as new data, or first search whether there is data in the first database with the same shooting time as the shooting time in the shooting record. If there is data in the first database with the same shooting time as the shooting time in the shooting record, the lens position corresponding to the shooting time in the first database is updated.

[0115] In an embodiment of the present application, when the lens position corresponding to the shooting information tag does not exist in the first database, after the shooting lens 11 is gradually adjusted, the adjusted lens position can be associated with the shooting time on the camera device 1 and recorded in the second database, and then the shooting records in the second database are analyzed, and the user's usage habits of the camera device 1 are obtained from the analysis results to determine at which shooting time the shooting lens 11 of the camera device 1 is often adjusted to the same position, and these shooting times and corresponding lens positions are stored in the first database. The next time the user adjusts the camera device 1 at the same shooting time, the camera lens can be directly adjusted according to the lens position to achieve fast focusing of the camera device 1.

[0116] When the first database stores images of the shooting area and corresponding lens positions, the camera device 1 can directly call the lens position according to the image when focusing. Figure 8 As shown, Figure 8 FIG. 1 shows a flow chart of a focusing method for an image capturing device provided in a second embodiment of the present application, wherein the second embodiment only uses steps S310 to S320 instead of Figure 3 Step S300 in the embodiment specifically includes the following steps:

[0117] Step S310: Calculate the similarity between the image of the shooting area corresponding to the shooting information tag and each image in the first database.

[0118] Step S320: determining the lens position corresponding to the shooting information tag according to the similarity.

[0119] The images stored in the first database are images acquired after the camera device 1 is focused. These images are usually clear images, but the captured images of the camera device 1 are usually blurred when acquiring the shooting information, that is, the image of the shooting area corresponding to the shooting information tag is usually a blurred image, which results in that the images in the first database are often not completely the same as the images of the shooting area corresponding to the shooting information tag. Therefore, the similarity between the image of the shooting area corresponding to the shooting information tag and each image in the first database can be calculated, and then the first database can be searched according to the similarity.

[0120] The similarity can be obtained by calculating the image of the shooting area corresponding to the shooting information tag and the image in the first database through algorithms such as semantic feature extraction, convolutional neural network, graph neural network, scene graph matching, etc. When determining the lens position according to the similarity, a preset threshold can be given, and the lens position corresponding to the image with a similarity greater than the preset threshold is determined as the lens position corresponding to the shooting information tag.

[0121] When there are multiple images with similarities greater than a preset threshold, these images can also be sorted from high to low according to the similarities, and the lens position corresponding to the image with the highest similarity is determined as the lens position corresponding to the shooting information tag. For example, when the preset threshold is 80%, if there are two images in the first database with similarities both higher than 80%, and the similarity corresponding to one of the images is 85% and the similarity corresponding to the other image is 90%, then the lens position corresponding to the image with a similarity of 90% in the first database is determined as the lens position corresponding to the shooting information tag.

[0122] In the embodiment of the present application, the lens position corresponding to the shooting information tag is determined according to the similarity between the image corresponding to the shooting information tag and the image in the first database, so that the corresponding lens position can be quickly and accurately obtained from the first database.

[0123] It should be noted that the generation process of the first database provided by steps S210-S240a and steps S241a-S243a is independent of the execution process of steps S310-S320 and there is no necessary dependency relationship. At the same time, the user can also set the automatically generated records, the user can set the number of records in the first database, and can also modify or delete the generated records. Only when the shooting information label and lens position are saved in the first database can the empty return of the lens be effectively reduced and the focusing efficiency be improved.

[0124] In some embodiments of the present application, the focusing method of the camera device further includes:

[0125] Step S004b: Determine whether the current time of the camera device 1 meets the shooting trigger time, where the shooting trigger time is associated with the shooting time.

[0126] Step S005b: When the current time of the camera device 1 meets the shooting trigger time, the shooting time associated with the shooting trigger time is obtained, and shooting information is generated according to the shooting time.

[0127] Among them, when the data in the first database associates the shooting time with the lens position, the corresponding shooting trigger time can be generated according to the shooting time. When the system time of the camera device 1 meets the requirements of the shooting trigger time, the shooting time corresponding to the shooting trigger time will be obtained, and then the lens position will be obtained according to the shooting time to adjust the shooting lens 11 of the camera device 1. In the embodiment of the present application, as an example, it is assumed that a group of data "seven o'clock in the morning" and the corresponding lens position are stored in the first database, and the controller of the camera device 1 will use the time "seven o'clock in the morning" as the shooting trigger time of the group of data. During the operation of the camera device 1, the controller of the camera device 1 will obtain the system time on the camera device 1. When the system time on the camera device 1 meets "seven o'clock in the morning", the shooting information is generated according to the shooting time of "seven o'clock in the morning".

[0128] In the embodiment of the present application, the shooting time in the first database is associated with the shooting trigger time, so that the controller of the camera device 1 can automatically perform cyclic shooting of different shooting areas according to the shooting time in the first database.

[0129] The above-mentioned embodiments respectively provide multiple focusing modes. When the multiple focusing modes are integrated into the same camera device, the camera device has multiple automatic focus functions, and these functions may conflict. For example, when the controller of the camera device receives shooting information whose shooting information tag is user marking information, the current time on the camera device meets the shooting trigger time and successfully generates shooting information whose shooting information tag is the shooting time. At this time, the controller of the camera device will receive two shooting information at the same time, and the shooting information tags included in the two shooting information are different, which may cause the controller of the camera device to obtain two different lens positions from the first database, thereby causing the controller of the camera device to be unable to adjust the shooting lens normally.

[0130] Therefore, in order to further ensure the normal operation of the camera device, in some embodiments of the present application, Fig. 9 As shown, Fig. 9 FIG. 1 shows a flow chart of a focusing method for an image capturing device provided in a third embodiment of the present application, wherein the third embodiment only uses steps S110 to S120 instead of Figure 3 Step S100 in the embodiment specifically comprises:

[0131] Step S110: acquiring a plurality of shooting information tags and the shooting priority corresponding to each shooting information tag from the shooting information.

[0132] Among them, the shooting priority can be the corresponding initial priority set for each shooting information tag of the camera device 1 before leaving the factory. For example, before the camera device 1 leaves the factory, the shooting priority of the user marking information, image and shooting time is set to: the shooting priority corresponding to the user marking information is higher than the shooting priority corresponding to the image, and the shooting priority corresponding to the image is higher than the shooting priority of the shooting time. Among them, the shooting priority corresponding to the user marking information obtained through the shooting trigger time is lower than the shooting priority corresponding to the user marking information obtained directly, but the shooting priority corresponding to the user marking information obtained in two different ways is higher than the shooting priority corresponding to the image and shooting time.

[0133] Of course, the shooting priority can also be set by the user according to his own usage habits after the camera device 1 is installed. For example, when the user wants the camera device 1 to shoot a certain area in a certain time period and not be affected by any other operations, the shooting priority corresponding to the user mark information obtained through the shooting trigger time can be set to be higher than the shooting priorities corresponding to all other shooting information tags, or the shooting priority corresponding to the shooting time can be set to be higher than the shooting priorities corresponding to all other shooting information tags; when the user wants to manually adjust the camera device 1 to shoot a certain area without being affected by any other functions, the shooting priority corresponding to the image can be set to be higher than the shooting priorities corresponding to all other shooting information tags.

[0134] In addition, when the functions corresponding to various embodiments are integrated on the same camera device 1 so that the camera device 1 has various autofocus functions, it is also possible to set on and off functions for different autofocus functions, and set each function to a default off state, so that the user can turn on the required autofocus function according to their own usage habits. For example, when the user does not need the camera device 1 to automatically adjust the shooting lens 11 according to the time on it, the focus function of obtaining the shooting time through the shooting trigger time can be turned off. When the current time of the camera device 1 meets the shooting trigger time, the controller of the camera device 1 will not automatically obtain the shooting time to generate shooting information, and will not adjust the shooting lens 11 of the camera device 1 according to the lens position corresponding to the shooting time.

[0135] Step S120: comparing the shooting priorities corresponding to the shooting information tags, and obtaining the shooting information tag corresponding to the highest shooting priority.

[0136] Among them, when the controller of the camera device 1 simultaneously obtains multiple shooting information tags, and the types of each shooting information tag are different, the shooting priorities corresponding to each shooting information tag are compared, and the first database is searched according to the shooting information tag with the highest shooting priority. The multiple shooting information tags simultaneously obtained by the controller of the camera device 1 can come from multiple shooting information respectively, or all from the same shooting information, or some of the shooting information tags can come from the same shooting information. In an embodiment of the present application, as an example, assuming that the shooting priority of the user mark information is higher than the shooting priority of the image, and the shooting priority of the image is higher than the shooting priority of the shooting time, when the controller of the camera device 1 simultaneously obtains three shooting information tags, and the three shooting information tags are user mark information, image, and shooting time, respectively, the controller of the camera device 1 will obtain the lens position corresponding to the user mark information from the first database according to the user mark information with the highest shooting priority.

[0137] also, Fig. 9 Steps S200 to S500 in Figure 3 Steps S200 to S500 are the same and will not be further described here.

[0138] In an embodiment of the present application, a corresponding shooting priority is set for the shooting information tag. When the controller of the camera device 1 simultaneously obtains multiple shooting information tags, the controller of the camera device 1 can search the first database only according to the shooting information tag with the highest shooting priority, thereby ensuring that the controller of the camera device 1 can only obtain one lens position each time, thereby ensuring the normal use of the camera device 1.

[0139] An embodiment of the present application provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by a processor, the focusing method embodiment of the above-mentioned camera device is implemented.

[0140] An embodiment of the present application provides a computer program, which can be executed by a processor to implement the focusing method embodiment of the above-mentioned camera device.

[0141] An embodiment of the present application provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the focusing method embodiment of the above-mentioned camera device is implemented.

[0142] In several embodiments provided in the present application, if any function is implemented in the form of a software function module / unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the present application can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, server or other electronic device) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (RandomAccess Memory, RAM), disk or optical disk and other media that can store computer program codes.

[0143] The algorithm or display provided here are not inherently related to any specific computer, virtual system or other equipment. Various general systems can also be used together with the teaching based on this. According to the above description, it is obvious to construct the structure required for this type of system. In addition, the present application embodiment is not directed to any specific programming language yet. It should be understood that various programming languages ​​can be utilized to realize the content of the present application described here, and the above description of specific languages ​​is to disclose the best mode of implementation of the present application.

[0144] It should be noted that the above embodiments illustrate the present application rather than limit the present application, and that those skilled in the art may design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference symbol between brackets shall not be constructed as a limitation on the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "one" or "an" preceding an element does not exclude the presence of multiple such elements. The present application may be implemented by means of hardware including several different elements and by means of a suitably programmed computer. In the claims that list several devices, several units or modules in these devices may be embodied by the same hardware item. The use of the words first, second, and third, etc. does not indicate any order. These words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.

[0145] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A focusing method for a camera device, characterized in that: The method comprises: Obtain shooting information tags from shooting information of a camera device; Determine whether there is a lens position corresponding to the shooting information tag in the first database; If the lens position corresponding to the shooting information tag exists in the first database, acquiring the lens position corresponding to the shooting information tag from the first database according to the shooting information tag; generating a focus control instruction of the camera device according to the lens position; The shooting lens of the camera device is controlled to be set at the lens position corresponding to the shooting information tag according to the focus control instruction to complete the focus of the camera device.

2. The focusing method of the camera device according to claim 1, characterized in that: The method further includes: Acquire input user marking information, where the user marking information is used to mark a lens position corresponding to a shooting area; Obtaining the current lens position of the camera device; The user marking information is used as a shooting information tag, and the shooting information tag is associated with the current lens position and stored in the first database.

3. The focusing method of the camera device according to claim 2, characterized in that: The method further includes: Determine whether the current time of the camera device meets the shooting trigger time, the shooting trigger time is associated and set in the user tag information; When the current time of the camera device meets the shooting trigger time, the user tag information associated with the shooting trigger time is acquired, and the shooting information is generated according to the user tag information.

4. The focusing method of the camera device according to claim 1, characterized in that: The method further includes: If the lens position corresponding to the shooting information tag does not exist in the first database, gradually adjusting the shooting lens according to the clarity of the image captured by the shooting lens to complete the focus of the camera device; Acquire an image of the shooting area through the shooting lens; Obtaining the current lens position of the camera device; The image of the shooting area is used as a shooting information tag, and the shooting information tag is associated with the current lens position and stored in the first database.

5. The focusing method of the camera device according to claim 4, characterized in that: The method further includes: Associating the image of the shooting area with the current lens position and storing them in a second database, wherein the second database is used to store shooting records of the camera device, and the shooting records include the image of the shooting area and the lens position corresponding thereto; Analyze the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record; The shooting frequency corresponding to each of the shooting records is compared with a preset threshold, and the shooting records corresponding to the shooting frequency that meets the preset threshold are updated into the first database.

6. The focusing method of the camera device according to claim 5, characterized in that: The acquiring the lens position corresponding to the shooting information tag from the first database according to the shooting information tag specifically includes: Calculating the similarity between the image of the shooting area corresponding to the shooting information tag and each image in the first database; The lens position corresponding to the shooting information tag is determined according to the similarity.

7. The focusing method of the camera device according to claim 1, characterized in that: The method further includes: If the lens position corresponding to the shooting information tag does not exist in the first database, gradually adjusting the shooting lens according to the clarity of the image captured by the shooting lens to complete the focus of the camera device; Acquire the shooting time of the camera device and the current lens position of the camera device; Using the shooting time as a shooting information tag, and associating the shooting information tag with the current lens position, and storing them in a second database, wherein the second database is used to store the shooting records of the camera device, and the shooting records include the shooting time and the lens position corresponding thereto; Analyze the shooting records in the second database to obtain the shooting frequency corresponding to each shooting record; The shooting frequency corresponding to each of the shooting records is compared with a preset threshold, and the shooting records corresponding to the shooting frequency that meets the preset threshold are updated into the first database.

8. The focusing method of the camera device according to claim 7, characterized in that: The method further includes: Determine whether the current time of the camera device meets a shooting trigger time, the shooting trigger time being associated with the shooting time; When the current time of the camera device meets the shooting trigger time, the shooting time associated with the shooting trigger time is acquired, and the shooting information is generated according to the shooting time.

9. The focusing method of the camera device according to claim 1, characterized in that: The step of obtaining the shooting information tag from the shooting information of the camera device includes: Acquire multiple shooting information tags and shooting priorities corresponding to the shooting information tags from the shooting information; The shooting priorities corresponding to the shooting information tags are compared to obtain the shooting information tag corresponding to the highest shooting priority.

10. A camera device, characterized in that: The camera device includes a shooting lens, a memory and a processor; The shooting lens is used to collect images; The memory is used to store computer programs; The processor executes the computer program to implement the focusing method of the imaging device according to any one of claims 1 to 9.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the focusing method of the imaging device according to any one of claims 1 to 9 is implemented.