Summary of the invention
The embodiment of the present invention is designed to provide a kind of video capture method, apparatus, electronic equipment and storage medium, with
Realize the purpose for improving video quality.
In a first aspect, the embodiment of the invention provides a kind of video capture methods, which comprises
Present image is obtained, and detects the default object that occurs in the present image in the initial bit of the present image
Confidence breath;
According to the default object in the initial position message of the present image, the default object is calculated relative to end
The target position information of end equipment screen;
According to the target position information, it is focused to object region is preset described in the terminal device screen
Operation, and shoot the present image.
Optionally, initial bit confidence of the default object occurred in the detection present image in the present image
The step of breath includes:
Scheduled system function is transferred, image information is extracted from the present image by the system function;
According to described image information and pre-stored recognition function, image recognition handle is created;
Obtain the identification object corresponding with the type of the default object that constructs in advance, and by described image information and
In the identification object input described image identification handle, the default object occurred in the present image is obtained described current
The initial position message of image.
Optionally, described according to described image information and pre-stored recognition function, creation image recognition handle
Step includes:
Transfer pre-stored recognition function;
According to described image information, update the parameter preset of the recognition function, and using updated recognition function as
Image recognition handle.
Optionally, it is described according to the default object in the initial position message of the present image, calculate described default
The step of target position information of the object relative to terminal device screen includes:
Determine the current resolution of terminal device screen;
According to the current resolution, the default object the present image initial position message, and in advance
The corresponding positional relationship of the different resolution of storage, the positional relationship identify default object position and opposite in the picture
Corresponding relationship in terminal device screen position, the target position for calculating the default object relative to terminal device screen are believed
Breath.
Optionally, described according to the target position information, to where default object described in the terminal device screen
Region is focused the step of operation and includes:
According to the target position information, central point of the default object relative to the terminal device screen is calculated
Position is focused operation to the center position.
Optionally, the default object includes at least one of the following: personage, building, animal, plant.
Second aspect, the embodiment of the invention provides a kind of video capture device, described device includes:
Image detection module for obtaining present image, and detects the default object occurred in the present image in institute
State the initial position message of present image;
Location conversion module, for, in the initial position message of the present image, calculating institute according to the default object
State target position information of the default object relative to terminal device screen;
Image processing module is used for according to the target position information, to default pair described in the terminal device screen
As region is focused operation, and shoot the present image.
Optionally, described image detection module, comprising:
Information extraction submodule, for transferring scheduled system function, by the system function from the present image
Middle extraction image information;
Handle creates submodule, for creating image and knowing according to described image information and pre-stored recognition function
Other handle;
Position determination submodule, for obtaining the identification pair corresponding with the type of the default object constructed in advance
As, and by described image information and identification object input described image identification handle, it obtains going out in the present image
Initial position message of the existing default object in the present image.
Optionally, the handle creates submodule, is specifically used for:
Transfer pre-stored recognition function;
According to described image information, update the parameter preset of the recognition function, and using updated recognition function as
Image recognition handle.
Optionally, the location conversion module, comprising:
Resolution ratio determines submodule, for determining the current resolution of terminal device screen;
Position transform subblock, for according to the current resolution, the default object to be in the first of the present image
Beginning location information and the corresponding positional relationship of pre-stored different resolution, described default pair of the positional relationship mark
Corresponding relationship as position in the picture and relative to terminal device screen position calculates the default object and sets relative to terminal
The target position information of standby screen.
Optionally, described image processing module is specifically used for:
According to the target position information, central point of the default object relative to the terminal device screen is calculated
Position is focused operation to the center position.
Optionally, the default object includes at least one of the following: personage, building, animal, plant.
The third aspect, the embodiment of the invention provides a kind of electronic equipment, including processor, communication interface, memory and
Communication bus, wherein the processor, the communication interface, the memory are completed each other by the communication bus
Communication;
The memory, for storing computer program;
The processor when for executing the program stored on the memory, realizes method described in first aspect
Step.
Fourth aspect, the embodiment of the invention provides a kind of computer readable storage medium, the computer-readable storage
Dielectric memory contains computer program, and method step as described in relation to the first aspect is realized when the computer program is executed by processor
Suddenly.
It, can be according to pre- when terminal device, which detects, default object occurs in present image in the embodiment of the present invention
If object position, it is focused operation to object region is preset in terminal screen, and then can guarantee default object
The clarity of region improves video capture quality.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification
It obtains it is clear that being emerged from by implementing the present invention.The objectives and other advantages of the invention can by specification,
Specifically noted structure is achieved and obtained in claims and attached drawing.Certainly, implement any of the products of the present invention or
Method does not necessarily require achieving all the advantages described above at the same time.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
A kind of video capture method provided in an embodiment of the present invention is illustrated first.
As shown in Figure 1, a kind of video capture method provided in an embodiment of the present invention, may comprise steps of:
S101 obtains present image, and detects the default object that occurs in present image in the initial position of present image
Information;
Method provided in an embodiment of the present invention can be applied to terminal device arbitrarily with video capture function, for example,
The terminal device can be portable computer, mobile phone, iPAD etc..Specifically, the video that can be applied in terminal device is clapped
Application program is taken the photograph, such as can be applied to mounted video capture application program when terminal device factory;Alternatively, can also apply
In the video capture application program etc. that user voluntarily installs, it is not limited in the embodiment of the present invention.
In practical applications, user can carry out video capture by the video capture application program in terminal device, such as
Short-sighted frequency can be shot, and then short-sighted frequency is uploaded to network etc..It is appreciated that user is when shooting video, it is generally the case that
Its focus may not be all objects occurred in video pictures, and be only some specific object in video pictures,
The personage that occurs in such as video, animal.Therefore, in order to guarantee the quality of video captured by user, terminal device can be to view
User's object of interest in frequency picture is referred to as default object, is particularly handled, to guarantee user institute as far as possible
The clarity of focus.
Specifically, when terminal device detects video capture application program launching, the available current figure of terminal device
Picture, that is, the picture being currently located within the scope of its video capture.Working as and it is possible to detect the default object occurred in present image
The initial position message of preceding image.Above-mentioned default object for example may include at least one of following: personage, building, animal, plant
Object etc., it is not limited in the embodiment of the present invention.In this way, demand that can be different for user, guarantees that user is closed in video
The clarity of object is infused, the applicability of video capture method is improved.
For example, user with the type of pre-set default object and can be stored in terminal device, terminal device into
When row video capture, it can be detected in present image with the presence or absence of the default object of corresponding classification.If it does, further determining that
Default location information of the object in present image.
When terminal device is detected in present image with the presence or absence of default object, existing any image procossing can be used
Method is detected, and it is not limited in the embodiment of the present invention.For example, terminal device can use DPM (deformable
Parts model, deformable member model) etc. target detections class algorithm, to detect the default object in present image.Default pair
It can be after constructing coordinate system in present image, to preset the square where object as the initial position message in present image
The corresponding coordinate value of shape frame.
S102 calculates default object relative to terminal device according to default object in the initial position message of present image
The target position information of screen;
The default object of above-mentioned determination is default position of the object relative to image in the initial position message of present image
Information.In embodiments of the present invention, default object is handled in order to facilitate terminal device, it can be by default object current
The initial position message of image is converted to location information of the default object relative to terminal device screen, can be described as target position
Information.
For example, terminal device can determine the current resolution of terminal device screen first;And then according to current resolution,
Default initial position message and pre-stored different resolution corresponding positional relationship of the object in present image, the position
It sets relation identity and presets object position and the corresponding relationship relative to terminal device screen position in the picture, calculate default object
Target position information relative to terminal screen.
By the way that the corresponding positional relationship of different resolution is stored in advance, thus when carrying out video capture, it can be quickly quasi-
It is true by default object in the initial position message of present image, be converted to target position of the default object relative to terminal screen
Information, and then can be improved video capture efficiency, and can accurately determine position to be focused, guarantee to preset object in video
Clarity.
Such as, when the current resolution of terminal device screen be 1080*1920, the corresponding positional relationship of the resolution ratio, i.e., in advance
If object position and the corresponding relationship relative to terminal device screen position in the picture are as follows: 600*600 and 300*300 is preset
For object when the initial position message of present image is (x1, y1), default object can be calculated relative to end in terminal device
The target position information of end equipment screen is (0.5*x1,0.5*y1).
S103 is focused operation to object region is preset in terminal device screen according to target position information, and
Shoot present image.
After determining target position information, terminal device can gather to object region is preset in terminal device screen
Coke operation, and shoot present image.In this way, clarity preferable video in default object region can be taken.
It, can be according to pre- when terminal device, which detects, default object occurs in present image in the embodiment of the present invention
If object position, it is focused operation to object region is preset in terminal screen, and then can guarantee default object
The clarity of region improves video capture quality.
Can it is appreciated that accurately determine default object in the initial position message of present image, can determine quasi-
True is focused default object.
As a kind of embodiment of the embodiment of the present invention, as shown in Fig. 2, occur in terminal device detection present image
Object, which is preset, in the step of initial position message of present image includes:
S201, transfers scheduled system function, and image information is extracted from present image by system function;
When terminal device gets present image, it is generally the case that it can store the corresponding much information of present image,
Such as, acquisition time information, image information etc..
In the present embodiment, terminal device can extract image information from all information of present image.Such as, eventually
The system function for extracting image information can be stored in advance in end equipment, after getting present image, can transfer this
System function, and then image information is extracted from present image by the system function.
S202 creates image recognition handle according to image information and pre-stored recognition function;
After extracting image information, terminal device can be created according to the image information and pre-stored recognition function
Build image recognition handle.The image recognition handle is substantially functional form.
Specifically, terminal device can transfer pre-stored recognition function, and then according to the image information of extraction, update
The parameter preset of the recognition function, namely parameter relevant to image information, and know updated recognition function as image
Other handle.In this way, can use pre-stored recognition function, image recognition handle is created, directly so as to improve image
It identifies the creation efficiency of handle, and then improves video capture efficiency.
S203, obtains the identification object corresponding with the type of default object that constructs in advance, and by image information and knowledge
In other object input picture identification handle, the default object occurred in present image is obtained in the initial bit confidence of present image
Breath.
In embodiments of the present invention, terminal device can construct identification pair corresponding with all types of default objects in advance
As, recognition of face object such as corresponding with personage, plants identification object corresponding with plant etc..
Object is preset in determining present image in the initial position message of present image, terminal device is available pre-
The identification object corresponding with the type of default object first constructed, and image information and identification object input picture are identified into sentence
In handle, the initial position message of the default object that occurs in image recognition handle, that is, exportable present image in present image.
In the present embodiment, it can accurately determine the default object in present image in the initial bit confidence of present image
Breath, and then when carrying out video capture to default object, operation accurately can be focused to default object region, protected
Demonstrate,prove the picture quality that object region is preset in captured video.
As a kind of embodiment of the embodiment of the present invention, terminal device is according to target position information, to terminal device screen
When default object region is focused operation in curtain, default object can be calculated first according to target position information
Operation is focused relative to the center position of terminal screen, and then to center position.
It such as, is square where default object relative to the target position information of terminal device screen when identified default object
When the coordinate value of shape frame, terminal device can be by the central point of the rectangle frame, as default object relative in terminal screen
Heart point position.Specifically, terminal device can transfer the focus function of system, operation is focused to the center position.
The center point area of default object is the nucleus of default object and the most critical point of user's concern.This
In embodiment, when being focused to default object region, pass through the center point to default object relative to terminal screen
It sets and is focused, can guarantee that the picture quality of user's point of interest in captured video reaches best.
Below with reference to a specific embodiment, video capture method provided in an embodiment of the present invention is carried out specifically
It is bright.
As shown in figure 3, the video capture method in the present embodiment, the focus of user is face, and this method may include
Following steps:
1, a picture of cameras capture is got;
2, then picture is identified using the VNImageRequestHandler of system, determines in picture whether wrap
Containing face;
3, the position that face is taken out if comprising face terminates if not including face, namely directly carries out video
Shooting;
4, the position of face is that the position of face is converted to the position on terminal device screen relative to a frame picture
It sets, and calculates the central point of face location after conversion;
5, the focus function of calling system is focused the central point of face, and carries out video capture.
Specifically, mobile phone can be placed against the wall when user wants using one short-sighted frequency of mobile phone self-timer, oneself
It dances before mobile phone.When face is just appeared on mobile phone screen, mobile phone detects face, is just focused automatically to face, entirely
Face is exactly relatively clearly in shooting process.
Correspondingly, the embodiment of the invention also provides a kind of video capture devices, as shown in figure 4, described device includes:
Image detection module 410 for obtaining present image, and detects the default object occurred in the present image and exists
The initial position message of the present image;
Location conversion module 420, for, in the initial position message of the present image, being calculated according to the default object
Target position information of the default object relative to terminal device screen;
Image processing module 430, for being preset to described in the terminal device screen according to the target position information
Object region is focused operation, and shoots the present image.
It, can be according to pre- when terminal device, which detects, default object occurs in present image in the embodiment of the present invention
If object position, it is focused operation to object region is preset in terminal screen, and then can guarantee default object
The clarity of region improves video capture quality.
As a kind of embodiment of the embodiment of the present invention, described image detection module 410, comprising:
Information extraction submodule, for transferring scheduled system function, by the system function from the present image
Middle extraction image information;
Handle creates submodule, for creating image and knowing according to described image information and pre-stored recognition function
Other handle;
Position determination submodule, for obtaining the identification pair corresponding with the type of the default object constructed in advance
As, and by described image information and identification object input described image identification handle, it obtains going out in the present image
Initial position message of the existing default object in the present image.
As a kind of embodiment of the embodiment of the present invention, the handle creates submodule, is specifically used for:
Transfer pre-stored recognition function;
According to described image information, update the parameter preset of the recognition function, and using updated recognition function as
Image recognition handle.
As a kind of embodiment of the embodiment of the present invention, the location conversion module 420, comprising:
Resolution ratio determines submodule, for determining the current resolution of terminal device screen;
Position transform subblock, for according to the current resolution, the default object to be in the first of the present image
Beginning location information and the corresponding positional relationship of pre-stored different resolution, described default pair of the positional relationship mark
Corresponding relationship as position in the picture and relative to terminal device screen position calculates the default object and sets relative to terminal
The target position information of standby screen.
As a kind of embodiment of the embodiment of the present invention, described image processing module 430 is specifically used for:
According to the target position information, central point of the default object relative to the terminal device screen is calculated
Position is focused operation to the center position.
As a kind of embodiment of the embodiment of the present invention, the default object includes at least one of the following: personage, building
Object, animal, plant.
Correspondingly, the embodiment of the invention also provides a kind of electronic equipment, as shown in figure 5, including processor 501, communication
Interface 502, memory 503 and communication bus 504, wherein the processor 501, the communication interface 502, the memory
503 complete mutual communication by the communication bus 504;
The memory 503, for storing computer program;
The processor 501 when for executing the program stored on the memory, realizes following steps:
Present image is obtained, and detects the default object that occurs in the present image in the initial bit of the present image
Confidence breath;
According to the default object in the initial position message of the present image, the default object is calculated relative to end
The target position information of end equipment screen;
According to the target position information, it is focused to object region is preset described in the terminal device screen
Operation, and shoot the present image.
The communication bus 504 that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral
Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended Industry Standard
Architecture, EISA) bus etc..The communication bus 504 can be divided into address bus, data/address bus, control bus etc..For
Convenient for indicating, only indicated with a thick line in figure, it is not intended that an only bus or a type of bus.
Communication interface 502 is for the communication between above-mentioned electronic equipment and other equipment.
Memory 503 may include random access memory (Random Access Memory, RAM), also may include
Nonvolatile memory (Non-Volatile Memory, NVM), for example, at least a magnetic disk storage.Optionally, memory
It can also be that at least one is located remotely from the storage device of aforementioned processor.
Above-mentioned processor 501 can be general processor, including central processing unit (Central Processing
Unit, CPU), network processing unit (Network Processor, NP) etc.;It can also be digital signal processor (Digital
Signal Processing, DSP), specific integrated circuit (Application Specific Integrated Circuit,
ASIC), field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic
Device, discrete gate or transistor logic, discrete hardware components.
It, can be according to pre- when terminal device, which detects, default object occurs in present image in the embodiment of the present invention
If object position, it is focused operation to object region is preset in terminal screen, and then can guarantee default object
The clarity of region improves video capture quality.
Correspondingly, the embodiment of the invention also provides a kind of computer readable storage mediums.The computer-readable storage medium
It is stored with computer program in matter, following steps are realized when computer program is executed by processor:
Present image is obtained, and detects the default object that occurs in the present image in the initial bit of the present image
Confidence breath;
According to the default object in the initial position message of the present image, the default object is calculated relative to end
The target position information of end equipment screen;
According to the target position information, it is focused to object region is preset described in the terminal device screen
Operation, and shoot the present image.
Above-mentioned computer readable storage medium can include but is not limited to random access memory (RAM), dynamic random is deposited
Access to memory (DRAM), static random access memory (SRAM), read-only memory (ROM), programmable read only memory
(PROM), Erarable Programmable Read only Memory (EPROM), electrically erasable programmable read-only memory (EEPROM), flash memory (example
Such as, NOR type flash memory or NAND-type flash memory), Content Addressable Memory (CAM), polymer memory is (for example, ferroelectric polymers
Memory), phase transition storage, ovonic memory, silicon-oxide-nitride silicon-silica-silicon (Silicon-
Oxide-Nitride-Oxide-Silicon, SONOS) memory, magnetic card or light-card, also or any other appropriate type
Computer readable storage medium.
It, can be according to pre- when terminal device, which detects, default object occurs in present image in the embodiment of the present invention
If object position, it is focused operation to object region is preset in terminal screen, and then can guarantee default object
The clarity of region improves video capture quality.
It should be noted that, in this document, relational terms such as first and second and the like are used merely to a reality
Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation
In any actual relationship or order or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to
Non-exclusive inclusion, so that the process, method, article or equipment including a series of elements is not only wanted including those
Element, but also including other elements that are not explicitly listed, or further include for this process, method, article or equipment
Intrinsic element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that
There is also other identical elements in process, method, article or equipment including the element.
Each embodiment in this specification is all made of relevant mode and describes, the highlights of each of the examples are with
The difference of other embodiments, the same or similar parts between the embodiments can be referred to each other.Especially for device,
For electronic equipment, storage medium, since it is substantially similar to the method embodiment, so being described relatively simple, related place
Illustrate referring to the part of embodiment of the method.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all
Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention
It is interior.