Specific embodiment
In order to illustrate the technical solution of the embodiments of the present invention more clearly, will make below to required in the embodiment of the present inventionAttached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, forFor those of ordinary skill in the art, without any creative labor, it can also be obtained according to these attached drawingsHis attached drawing.
First embodiment
Shown in Figure 1, the embodiment of the present invention provides a kind of method for switching camera, is applied to have the first cameraWith the mobile terminal of second camera, including step 101~step 103, details are as follows.
Step 101: obtaining the image information of the first camera acquisition.
In the embodiment of the present invention, first camera can be front camera or rear camera, and described second takes the photographAs head can be front camera or rear camera.Specifically, if first camera is front camera, instituteStating second camera is just rear camera, if first camera is rear camera, the second cameraIt is just front camera.
Wherein, the method for the switching camera of the embodiment of the present invention is to be believed by the image acquired to the first cameraThe identification of breath closes first camera and opens second camera shooting to decide whether to switch first cameraHead.
Step 102: judging whether described image information matches with pre-set image information.
In the embodiment of the present invention, in order to realize the switching of camera, it can establish in the terminal for storing informationDatabase, and the sample information of image information for identification is stored in the database, the sample information is to be stored in advanceImage information, that is, pre-set image information.
Wherein, when identifying the image information that the step 101 obtains, mainly judge described image information whether in advanceIf image information matches.If described image information is matched with the pre-set image information, just switch first camera, andIf described image information and the pre-set image information mismatch, the working condition for keeping first camera is continued to.
Step 103: if described image information is matched with the pre-set image information, controls first camera and close,And it controls the second camera and opens.
Specifically, illustrating the item for meeting switching camera when described image information is matched with the pre-set image informationPart, so that it may control first camera and close, and control the second camera and open.
And if described image information and the pre-set image information mismatch, and control first camera and work on.
Specifically, illustrating not meeting switching camera when described image information and the pre-set image information mismatchCondition, so that it may control first camera and work on.
The method of the switching camera of the embodiment of the present invention, by obtaining the image information of the first camera acquisition, judgementWhether described image information matches with pre-set image information, if described image information is matched with the pre-set image information, controlFirst camera is closed, and is controlled the second camera and opened, and can conveniently and efficiently realize the switching of camera, letterChange operation, promotes user experience.
Second embodiment
Shown in Figure 2, the embodiment of the present invention also provides a kind of method for switching camera, is applied to have the first camera shootingThe mobile terminal of head and second camera, including step 201~step 208, details are as follows.
Step 201: by first camera or the second camera, obtaining finger imaging accounting and be greater than default thresholdThe image of value.
In the embodiment of the present invention, first camera can be front camera or rear camera, and described second takes the photographAs head can be front camera or rear camera.Specifically, if first camera is front camera, instituteStating second camera is just rear camera, if first camera is rear camera, the second cameraIt is just front camera.
Specifically, since mobile terminal is generally held by hand, so, it, can be by pre-set image information in order to easy to operateObject is set as finger.Also, the pre-set image information in order to obtain can first turn on first camera or describedTwo cameras, finger, then by the camera having turned on, obtain finger imaging accounting and are greater than in advance close to the camera having turned onIf the image of threshold value.The preset threshold is, for example, 30% or 50% etc., and the present invention is not limited.
Step 202: to described image carry out data acquisition, obtain include multiple finger characteristic informations pre-set image believeBreath.
In the embodiment of the present invention, the pre-set image information is to carry out data acquisition to the image that the step 201 obtainsIt obtains.Specifically, acquisition information may include multiple finger characteristic informations, described when carrying out data acquisition to described imageFinger characteristic information is, for example, finger print information, finger shape information, finger-joint information or finger color information etc..And it is everyAcquire a finger characteristic information, so that it may be added to the finger characteristic information as a data sample in database, constituteThe pre-set image information.The i.e. described pre-set image information includes multiple collected finger characteristic informations.
Step 203: obtaining the image information of the first camera acquisition.
Specifically, the method for the switching camera of the embodiment of the present invention, being will be by the image that acquires to the first cameraThe identification of information closes first camera and opens described second and take the photograph to decide whether to switch first cameraAs head.So the step 203 first has to obtain the image information of the first camera acquisition.
Step 204: comparison described image information and the finger print information.
In the embodiment of the present invention, when the pre-set image information includes finger print information, described image information is judgedWhether can be used with the matched mode of the pre-set image information: comparison described image information and the finger print information.Such asFruit comparing result is to have the finger print information in described image information, so that it may determine that described image information is preset with describedImage information matching.
Step 205: if in described image information have the finger print information, determine described image information with it is described pre-If image information matches, step 208 is executed.
Specifically, when the comparing result of the step 204, which is, has the finger print information in described image information,It can determine that described image information is matched with the pre-set image information.
Step 206: if in described image information do not have the finger print information, comparison described image information with it is describedAt least one of finger shape information, finger-joint information and finger color information.
In the embodiment of the present invention, when the pre-set image information further includes finger shape information, finger-joint information and handWhen referring at least one in colouring information, if not having the finger print information in described image information, further alsoAt least one of described image information and the finger shape information, finger-joint information and finger color information can be compared.
Step 207: if having the finger shape information, finger-joint information and finger color letter in described image informationAt least one of breath, determines that described image information is matched with the pre-set image information, executes step 208.
Specifically, when the comparing result of the step 206 is to have the finger shape information, hand in described image informationWhen at least one in articulations digitorum manus information and finger color information, that is, it can determine described image information and the pre-set image informationMatching.
Step 208: control first camera is closed, and is controlled the second camera and opened.
Specifically, illustrating the item for meeting switching camera when described image information is matched with the pre-set image informationPart, so that it may control first camera and close, and control the second camera and open.
If not having in the finger shape information, finger-joint information and finger color information in described image informationAt least one, determines that described image information and the pre-set image information mismatch.
Specifically, when the step 206 comparing result be described image information in do not have the finger shape information,When at least one in finger-joint information and finger color information, that is, it can determine that described image information and the pre-set image are believedBreath mismatches.
When described image information and the pre-set image information mismatch, illustrate the condition for not meeting switching camera,First camera just can control to work on.
The method of the switching camera of the embodiment of the present invention, only only by the state between finger and camera, it will be able toRealize the switching of camera, convenient and efficient, easy to operate, user experience is high.
3rd embodiment
Shown in Figure 3, the embodiment of the present invention also provides a kind of mobile terminal, has the first camera and the second camera shootingHead, corresponding with the switching method of camera shown in FIG. 1, the mobile terminal includes the first acquisition module 31, judgment module32 and control module 33, details are as follows.
Wherein, described first module 31 is obtained, for obtaining the image information of the first camera acquisition.
The judgment module 32, for judging whether described image information matches with pre-set image information.
The control module 33, for when described image information is matched with the pre-set image information, control described theOne camera is closed, and is controlled the second camera and opened.
In the embodiment of the present invention, the object of the pre-set image information is finger, shown in Figure 4, the mobile terminalIt further include the second acquisition module 34 and acquisition module 35, details are as follows.
Wherein, described second module 34 is obtained, for obtaining hand by first camera or the second cameraRefer to that imaging accounting is greater than the image of preset threshold.
The acquisition module 35 obtains including multiple finger characteristic informations for carrying out data acquisition to described imageThe pre-set image information.
Specifically, the pre-set image information includes finger print information, shown in Figure 4, the judgment module 32 is wrappedThe first comparison unit 321 and the first determination unit 322 are included, details are as follows.
Wherein, first comparison unit 321, for comparing described image information and the finger print information.
First determination unit 322 determines institute when for having the finger print information in described image informationImage information is stated to match with the pre-set image information.
Wherein, the pre-set image information further includes in finger shape information, finger-joint information and finger color informationAt least one, the judgment module 32 further includes the second comparison unit 323 and the second determination unit 324, and details are as follows.
Wherein, second comparison unit 323, for not having the finger print information in described image informationWhen, compare at least one of described image information and the finger shape information, finger-joint information and finger color information.
Second determination unit 324, for having the finger shape information, finger-joint in described image informationWhen at least one in information and finger color information, determine that described image information is matched with the pre-set image information.
Specifically, first camera is front camera, the second camera is rear camera;Alternatively, instituteStating the first camera is rear camera, and the second camera is front camera.
The mobile terminal of the embodiment of the present invention judges described image by obtaining the image information of the first camera acquisitionWhether information matches with pre-set image information, if described image information is matched with the pre-set image information, control described firstCamera is closed, and is controlled the second camera and opened, and can conveniently and efficiently be realized the switching of camera, be simplified operation,Promote user experience.
Fourth embodiment
Fig. 5 is the structural schematic diagram of the mobile terminal of fourth embodiment of the invention.Mobile terminal 500 shown in fig. 5 includes:At least one processor 501, memory 502, at least one network interface 504 and user interface 503.In mobile terminal 500Various components are coupled by bus system 505.It is understood that bus system 505 is for realizing the company between these componentsConnect letter.Bus system 505 further includes power bus, control bus and status signal bus in addition in addition to including data/address bus.ButIt is that various buses are all designated as bus system 505 in Fig. 5 for the sake of clear explanation.
Wherein, user interface 503 may include display, keyboard or pointing device (for example, mouse, trace ball(trackball), touch-sensitive plate or touch screen etc..Specifically, user interface 503 can also include that front camera and postposition imageHead.
It is appreciated that the memory 502 in the embodiment of the present invention can be volatile memory or nonvolatile memory,It or may include both volatile and non-volatile memories.Wherein, nonvolatile memory can be read-only memory (Read-Only Memory, ROM), programmable read only memory (Programmable ROM, PROM), the read-only storage of erasable programmableDevice (Erasable PROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM) orFlash memory.Volatile memory can be random access memory (Random Access Memory, RAM), be used as external highSpeed caching.By exemplary but be not restricted explanation, the RAM of many forms is available, such as static random access memory(Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), Synchronous Dynamic Random Access Memory(Synchronous DRAM, SDRAM), double data speed synchronous dynamic RAM (Double Data RateSDRAM, DDRSDRAM), enhanced Synchronous Dynamic Random Access Memory (Enhanced SDRAM, ESDRAM), synchronized linksDynamic random access memory (Synchlink DRAM, SLDRAM) and direct rambus random access memory (DirectRambus RAM, DRRAM).The memory 502 of system and method described herein is intended to include but is not limited to these and arbitrarily itsIt is suitble to the memory of type.
In some embodiments, memory 502 stores following element, executable modules or data structures, orTheir subset of person or their superset: operating system 5021 and application program 5022.
Wherein, operating system 5021 include various system programs, such as ccf layer, core library layer, driving layer etc., are used forRealize various basic businesses and the hardware based task of processing.Application program 5022 includes various application programs, such as mediaPlayer (Media Player), browser (Browser) etc., for realizing various applied business.Realize the embodiment of the present inventionThe program of method may be embodied in application program 5022.
In embodiments of the present invention, mobile terminal 500 has the first camera and second camera, by calling memoryThe program or instruction of 502 storages, specifically, can be the program or instruction stored in application program 5022, processor 501 is used forThe image information for obtaining the first camera acquisition, judges whether described image information matches with pre-set image information, if instituteIt states image information to match with the pre-set image information, controls first camera and close, and control the second cameraIt opens.
The method that the embodiments of the present invention disclose can be applied in processor 501, or be realized by processor 501.Processor 501 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is eachStep can be completed by the integrated logic circuit of the hardware in processor 501 or the instruction of software form.Above-mentioned processingDevice 501 can be general processor, digital signal processor (Digital Signal Processor, DSP), dedicated integrated electricityRoad (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (FieldProgrammable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,Discrete hardware components.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present invention.It is generalProcessor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with institute of the embodiment of the present inventionThe step of disclosed method, can be embodied directly in hardware decoding processor and execute completion, or with the hardware in decoding processorAnd software module combination executes completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed read-onlyIn the storage medium of this fields such as memory or electrically erasable programmable memory, register maturation.The storage medium is located atThe step of memory 502, processor 501 reads the information in memory 502, completes the above method in conjunction with its hardware.
It is understood that embodiments described herein can with hardware, software, firmware, middleware, microcode or itsCombination is to realize.For hardware realization, processing unit be may be implemented in one or more specific integrated circuit (ApplicationSpecific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing,DSP), digital signal processing appts (DSP Device, DSPD), programmable logic device (Programmable LogicDevice, PLD), field programmable gate array (Field-Programmable Gate Array, FPGA), general processor,In controller, microcontroller, microprocessor, other electronic units for executing herein described function or combinations thereof.
For software implementations, it can be realized herein by executing the module (such as process, function etc.) of function described hereinThe technology.Software code is storable in memory and is executed by processor.Memory can in the processor orIt is realized outside processor.
Optionally, the object of the pre-set image information is finger, and processor 501 is also used to: being imaged by described firstHead or the second camera obtain the image that finger imaging accounting is greater than preset threshold, carry out data acquisition to described image,Obtain include multiple finger characteristic informations the pre-set image information.
Optionally, the pre-set image information includes finger print information, and processor 501 is also used to: comparison described imageInformation and the finger print information determine described image information if having the finger print information in described image informationIt is matched with the pre-set image information.
Optionally, the pre-set image information further includes finger shape information, finger-joint information and finger color informationAt least one of, processor 501 is also used to: if not having the finger print information in described image information, described in comparisonAt least one of image information and the finger shape information, finger-joint information and finger color information, if described imageThere is at least one of the finger shape information, finger-joint information and finger color information in information, determine the figureAs information is matched with the pre-set image information.
Wherein, first camera is front camera, and the second camera is rear camera;Alternatively, describedFirst camera is rear camera, and the second camera is front camera.
Mobile terminal 500 can be realized each process that mobile terminal is realized in previous embodiment, to avoid repeating, hereIt repeats no more.
The mobile terminal 500 of the embodiment of the present invention judges the figure by obtaining the image information of the first camera acquisitionWhether match with pre-set image information as information, if described image information is matched with the pre-set image information, control described theOne camera is closed, and is controlled the second camera and opened, and can conveniently and efficiently be realized the switching of camera, be simplified behaviourMake, promotes user experience.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosureMember and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actuallyIt is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technicianEach specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceedThe scope of the present invention.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,The specific work process of device and unit, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In embodiment provided herein, it should be understood that disclosed device and method can pass through othersMode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, onlyA kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine orPerson is desirably integrated into another system, or some features can be ignored or not executed.Another point, shown or discussed is mutualBetween coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of device or unitIt connects, can be electrical property, mechanical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unitThe component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multipleIn network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.
It, can be with if the function is realized in the form of SFU software functional unit and when sold or used as an independent productIt is stored in a computer readable storage medium.Based on this understanding, technical solution of the present invention is substantially in other wordsThe part of the part that contributes to existing technology or the technical solution can be embodied in the form of software products, the meterCalculation machine software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be aPeople's computer, server or network equipment etc.) it performs all or part of the steps of the method described in the various embodiments of the present invention.And storage medium above-mentioned includes: that USB flash disk, mobile hard disk, ROM, RAM, magnetic or disk etc. are various can store program codeMedium.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, anyThose familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all containLid is within protection scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.