WO2017143933A1 - 拍摄对象的识别方法、装置、移动终端和照相机 - Google Patents

拍摄对象的识别方法、装置、移动终端和照相机 Download PDF

Info

Publication number
WO2017143933A1
WO2017143933A1 PCT/CN2017/073582 CN2017073582W WO2017143933A1 WO 2017143933 A1 WO2017143933 A1 WO 2017143933A1 CN 2017073582 W CN2017073582 W CN 2017073582W WO 2017143933 A1 WO2017143933 A1 WO 2017143933A1
Authority
WO
WIPO (PCT)
Prior art keywords
photographing
photographing device
photo
focal length
focusing
Prior art date
Application number
PCT/CN2017/073582
Other languages
English (en)
French (fr)
Inventor
余文涛
张衬
Original Assignee
阿里巴巴集团控股有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to JP2018544870A priority Critical patent/JP7109368B2/ja
Priority to EP17755762.6A priority patent/EP3422698B1/en
Priority to KR1020187024358A priority patent/KR20180116286A/ko
Publication of WO2017143933A1 publication Critical patent/WO2017143933A1/zh
Priority to US16/112,240 priority patent/US11050920B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/55Depth or shape recovery from multiple images
    • G06T7/571Depth or shape recovery from multiple images from focus
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/57Mechanical or electrical details of cameras or camera modules specially adapted for being embedded in other devices
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/61Control of cameras or camera modules based on recognised objects
    • H04N23/611Control of cameras or camera modules based on recognised objects where the recognised objects include parts of the human body
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/67Focus control based on electronic image sensor signals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/80Camera processing pipelines; Components thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/95Computational photography systems, e.g. light-field imaging systems
    • H04N23/958Computational photography systems, e.g. light-field imaging systems for extended depth of field imaging
    • H04N23/959Computational photography systems, e.g. light-field imaging systems for extended depth of field imaging by adjusting depth of field during image capture, e.g. maximising or setting range based on scene characteristics

Definitions

  • the present application relates to the field of information security, and in particular, to a method, an apparatus, a mobile terminal, and a camera for recognizing a subject.
  • Taobao shop certification business Taobao members need to use the mobile phone to take photos of the member himself, the member's ID card, and submit it to Taobao for review.
  • members submit their certification materials by using the mobile phone application of mobile phone Taobao or Ali Qiandun.
  • members are restricted to use the camera of the mobile phone to shoot on the spot, but cannot upload from the mobile phone album. photo.
  • this restriction must use the current shooting situation of the mobile phone, which can exclude most malicious authenticated members, but there are still cases where a malicious user uses photos and identities of others who purchase or illegally collect stolen people from the black market. Certificate photos, and then in the process of certification, use the phone camera to remake these photos to do Taobao's store certification.
  • biometric recognition to remake photographs, including the following two methods: method one, fingerprint verification method, that is, verifying hardware facilities through fingerprint verification, verifying whether there is fingerprint in the photo, If it exists, the photo is a remake photo; method 2, the video live detection method, that is, the system randomly gives a sequence of standard actions, such as shaking the head, nodding, blinking, opening the mouth, etc., using the intelligent pattern recognition algorithm to verify the character at the time of shooting Real people, not photos.
  • the above two methods can achieve the function of recognizing or filtering out remake photos, but each has its own disadvantages.
  • the fingerprint verification method of method one needs to add new hardware; the video live detection method of method two needs to add additional software packages.
  • complex face detection algorithms and there are cases where the algorithm identifies failures.
  • the embodiment of the present application provides a method, an apparatus, a mobile terminal, and a camera for identifying a photographic subject, so as to at least solve the technical problem that the scheme for identifying a remake photograph in the prior art is high in complexity.
  • a method for recognizing a photographic subject comprising: when a photographing instruction is received, a photographing device that activates the terminal performs autofocus on the photographic subject; and the photographing device focuses on the photographic subject After successful, the focal length after the focus of the shooting device is acquired; based on the focal length after focusing, it is determined whether the object type of the shooting object is a photo.
  • an identification device for a photographic subject includes: an activation module, configured to: when receiving a shooting instruction, automatically start focusing on a photographic subject by a photographic device that activates the terminal;
  • the acquiring module is configured to acquire a focal length after the focusing of the shooting device after the shooting device successfully focuses on the shooting object; and
  • a determining module configured to determine, according to the focal length after the focusing, whether the object type of the shooting object is a photo.
  • a mobile terminal comprising: the above-mentioned identification device of a photographic subject.
  • a camera comprising: the above-described recognition device for a subject.
  • the autofocus function of the photographing device determines whether the object type of the photographing object is a photo based on the focal length after the photographing device focuses.
  • FIG. 1 is a schematic diagram of a principle of a method for recognizing a subject according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of an internal structure of a terminal photographing apparatus according to an embodiment of the present application.
  • FIG. 3 is a structural block diagram of a computer terminal for identifying a photographic subject according to an embodiment of the present application
  • FIG. 4 is a flowchart of a method for identifying a photographic subject according to an embodiment of the present application.
  • FIG. 5 is a flowchart of an optional method for identifying a photographic subject according to an embodiment of the present application.
  • FIG. 6 is a flowchart of another optional method for identifying a photographic subject according to an embodiment of the present application.
  • FIG. 7 is a flowchart of still another optional method for identifying a photographic subject according to an embodiment of the present application.
  • FIG. 8 is a schematic diagram of an apparatus for identifying a subject according to an embodiment of the present application.
  • FIG. 9 is a schematic diagram of an optional recognition device for a photographic subject according to an embodiment of the present application.
  • FIG. 10 is a schematic diagram of another optional recognition device for a photographic subject according to an embodiment of the present application.
  • FIG. 11 is a schematic diagram of still another optional recognition device for a photographic subject according to an embodiment of the present application.
  • FIG. 12 is a schematic diagram of a fourth optional object recognition device according to an embodiment of the present application.
  • FIG. 13 is a schematic diagram of a fifth optional object recognition device according to an embodiment of the present application.
  • FIG. 14 is a schematic diagram of an optional mobile terminal according to an embodiment of the present application.
  • 15 is a schematic illustration of an alternative camera in accordance with an embodiment of the present application.
  • FIG. 16 is a structural block diagram of a computer terminal according to an embodiment of the present application.
  • the distance u is the object distance, which is used to indicate the distance from the object to the optical center of the convex lens;
  • the distance f is the focal length, which is used to indicate the distance from the focus to the optical center;
  • the distance v is the image distance, which is used to indicate the distance from the image formed by the convex lens to the optical center.
  • the mobile phone camera may include a protective film 1, a lens group 2, a focus motor 3, an infrared filter 4, an image sensor 5, and a line connection substrate 6, as shown in FIG.
  • the focal length of the camera of the terminal can be fixed.
  • the camera camera can move the image distance v to achieve a clear image.
  • the focus motor is used to move the image sensor back and forth to achieve the purpose of focusing. Normally, the focus motor can move a few hundred micrometers, which reflects the range in which the camera can focus.
  • the above image sensor is generally a CMOS (complementary metal-oxide semiconductor) component, that is, a photosensitive element.
  • an embodiment of a method for recognizing a subject is also provided. It should be noted that the steps shown in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 3 is a structural block diagram of a computer terminal for identifying a photographic subject according to an embodiment of the present application.
  • computer terminal 30 may include one or more (only one shown) processor 302 (processor 302 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • processor 302 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA)
  • a memory 304 for storing data
  • a transmission module 306 for communication functions.
  • computer terminal 30 may also include more or fewer components than shown in FIG. 3, or have a different configuration than that shown in FIG.
  • the memory 304 can be used to store software programs and modules of the application software, such as program instructions/modules corresponding to the recognition method of the photographic subject in the embodiment of the present application, and the processor 302 executes by executing the software program and the module stored in the memory 304.
  • the memory 304 can include a high speed random access memory, and can also include a non-volatile memory, such as one or more magnetic memories. Storage device, flash memory, or other non-volatile solid state memory.
  • memory 304 can further include memory remotely located relative to processor 302, which can be connected to computer terminal 30 over a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • Transmission device 306 is for receiving or transmitting data via a network.
  • the network specific examples described above may include a wireless network provided by a communication provider of the computer terminal 30.
  • transmission device 306 includes a Network Interface Controller (NIC) that can be connected to other network devices through a base station to communicate with the Internet.
  • NIC Network Interface Controller
  • the transmission device 306 can be a Radio Frequency (RF) module for communicating with the Internet wirelessly.
  • RF Radio Frequency
  • FIG. 4 is a flowchart of a method for recognizing a subject according to an embodiment of the present application. As shown in FIG. 4, this embodiment may include the following steps:
  • Step S402 When receiving the shooting instruction, the photographing device of the activation terminal automatically focuses on the subject.
  • Step S404 After the photographing device successfully focuses on the subject, the focal length after the focus of the photographing device is acquired.
  • Step S406 It is determined whether the object type of the photographic subject is a photo based on the focal length after focusing.
  • the autofocus function of the photographing device of the terminal is used to determine whether the object type of the photographing object is a photo based on the focal length of the photographing device after the photographing device successfully focuses on the photographing object.
  • the hardware and the software flow are relatively simple, simplifying the process of recognizing the remake photos, and solving the problem of the complexity of the scheme for recognizing the remake photos in the prior art, so as to realize the efficient recognition of the remake photos.
  • the terminal may be a personal computer or a mobile terminal, such as a mobile terminal having a photographing function, such as a mobile phone or a tablet computer.
  • a mobile terminal such as a mobile phone having a fixed focus lens.
  • the above-mentioned focusing refers to an operation mode of changing the distance between the imaging surface and the lens according to the difference in the position at which the different objects are clearly imaged at the rear of the lens, that is, by changing the image distance to change the sharpness of the formed image.
  • the shooting device of the terminal (such as a mobile phone camera) is activated, and the autofocus function of the photographing device is used, and the autofocus algorithm drives the focus when the camera of the photographing device enters the autofocus mode.
  • the motor moves the image sensor back and forth to achieve the purpose of focusing to capture a clear image. Since the size of the photo is much smaller than the size of a real person, if you want to make the size of the image on the terminal close when shooting real people and remake photos, the distance between the photo and the camera of the shooting device is much smaller than that of a real person. The distance from the camera is reflected in the imaging formula, that is, the object distance is different. Therefore, the difference in the distance can be used to determine whether the object type of the subject of the photographing device is a photo or a real person.
  • the shooting instruction described above may be generated by a server or may be generated by a terminal.
  • the server After receiving the identity verification request sent by the terminal, the server generates the shooting instruction to take a photo of the user of the terminal; or the user activates the shooting device by operating a startup button of the shooting device on the terminal, to The user takes a photo, which can be a click operation.
  • the mobile phone application (such as Ali Qiandun) prompts the user to take a photo, and the user clicks the start shooting button.
  • the mobile phone camera automatically focuses on the subject. After the auto focus is successful, the user clicks the photo button.
  • the camera of the mobile phone collects an image, and the mobile terminal generates image data corresponding to the image, and the image data includes focal length information after focusing and object distance information corresponding to the focal length information, and the mobile phone system transmits the generated image data to the network through the network.
  • the server of the mobile phone application (such as Ali Qiandun) determines whether the user's identity is true or not based on the data sent by the terminal to determine whether the subject is a photo or a real person.
  • determining whether the object type of the photographic subject is a photo based on the focal length after focusing includes: determining whether the distance between the shooting device and the photographic subject is less than a preset threshold based on the focal length after focusing, wherein the preset threshold It is used to indicate the minimum distance required for the shooting device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance of the shooting device from the photographic subject is less than a preset threshold, it is determined that the object type of the photographic subject is a photo.
  • this embodiment may include the following steps:
  • Step S501 When receiving the shooting instruction, the photographing device of the activation terminal automatically focuses on the subject.
  • Step S502 After the photographing device successfully focuses on the photographing object, the focal length after the focusing of the photographing device is acquired.
  • Step S503 Determine whether the distance between the photographing device and the photographing object is less than a preset threshold based on the focal length after focusing.
  • step S504 if it is determined that the distance between the photographing device and the photographing object is less than a preset threshold, step S504 is performed; if it is determined that the distance between the photographing device and the photographing object is not less than a preset threshold, step S505 is performed.
  • the above-mentioned preset threshold refers to a minimum distance required between the photographing device and the photographing living body when the photographing device performs auto-focusing on a living body object (such as a real person) and forms a clear image behind the camera of the photographing device.
  • Step S504 It is determined that the object type of the photographic subject is a photo.
  • Step S505 It is determined that the object type of the photographic subject is a real person.
  • the shooting device of the terminal is activated, and the automatic use of the shooting device is utilized.
  • Focus function when the camera of the shooting device enters the auto focus mode, the autofocus algorithm will drive the focus motor to move the image sensor back and forth to achieve the purpose of focusing to capture a clear image.
  • the camera when the user uses the existing photo to remake, due to the size limitation of the existing photo, in order to get close to the size of the real-life image, and not let the photo leak, the camera must be attached to the photo.
  • the image sensor is driven by the focus motor to move, a clear picture can be taken.
  • the object distance u becomes smaller and the image distance v becomes larger.
  • Take a 10-inch photo for example, the distance between the phone camera and the photo is about 20 cm to take a clear picture. If it is a real person, the distance between the mobile phone camera and the real person is about 100 cm.
  • the movement of the image sensor is driven by the focus motor to make the image distance v smaller and a clear picture is taken.
  • the difference between the remake photos and the real person's object distance is about 5-10 times, and there is a significant difference in the image distance v, so the photo can be identified by the difference between the object distance and the image distance. Whether it is a remake of photos.
  • the distance between the above-mentioned mobile phone camera and the real person is 100 cm as the above-mentioned preset threshold value to determine whether the object of the mobile phone is a photo.
  • the focal length after focusing is obtained by the mobile phone system software, and the imaging formula can be used to determine the distance between the mobile phone and the photographic subject (ie, the object distance mentioned above), when the object distance is When it is less than 100 cm, it can be judged that the subject is a photo, and when the object distance is greater than 100 cm, it can be judged that the subject is a real person.
  • the embodiment of the embodiment by using the focal length after autofocus of the photographing device, combined with the imaging formula, the distance between the photographing device and the photographing object can be obtained, and according to the distance, it can be directly determined whether the object type of the photographing object is a photograph, the embodiment of the embodiment
  • the principle is simple and clear, and the algorithm is simple and easy to implement.
  • determining whether the object type of the photographic subject is a photo based on the focal length after focusing includes: determining whether the distance between the shooting device and the photographic subject is less than a preset threshold based on the focal length after focusing, wherein the preset threshold a minimum distance required for the shooting device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance between the shooting device and the photographic subject is less than a preset threshold, acquiring image data of the photographic subject generated based on the shooting instruction; It is detected whether there is a pre-acquired remake photo feature in the image data; if there is a pre-acquired remake photo feature in the image data, it is determined that the object type of the photographic subject is a photo.
  • the embodiment may include the following steps:
  • Step S601 When receiving the shooting instruction, the photographing device of the activation terminal automatically focuses on the subject.
  • Step S602 After the photographing device successfully focuses on the photographing object, the focal length after the focusing of the photographing device is acquired.
  • Step S603 It is determined whether the distance between the photographing device and the photographing object is less than a preset threshold based on the focal length after focusing.
  • step S604 if it is determined that the distance between the photographing device and the photographing object is less than a preset threshold, step S604 is performed; if it is determined that the distance between the photographing device and the photographing object is not less than a preset threshold, step S605 is performed.
  • the preset threshold value refers to a minimum distance required between the photographing device and the photographing living body when the photographing device performs autofocusing on a living subject (such as a real person) and forms a clear image in the camera of the photographing device.
  • Step S604 Acquire image data of the photographic subject generated based on the shooting instruction.
  • the above image data includes the shooting time of the image, the resolution of the image, the two-dimensional information or three-dimensional information in the image, the fingerprint information on the image surface, and the reflected light information on the image surface.
  • step S606 is performed.
  • Step S605 It is determined that the object type of the photographic subject is a real person.
  • Step S606 Detect whether there is a pre-acquired remake photo feature in the image data.
  • step S607 if there is a pre-acquisition remake photo feature in the image data, step S607 is performed; if there is no pre-acquired remake photo feature in the image data, step S605 is performed.
  • the above-mentioned pre-acquired remake photo features include the resolution of the image, the two-dimensional information in the image, the fingerprint information on the image surface, and the reflected light information on the image surface.
  • Step S607 It is determined that the object type of the photographic subject is a photo.
  • the remake of the photo differs from the directly captured live photo in resolution, the specific difference being determined by the resolution of the camera of the camera.
  • resolution data of a remake photograph acquired in advance in the image data it is determined that the object type of the photographic subject is a photo.
  • the measured light value is compared with the reflected light value of the pre-acquired remake photo, and when the measured light value is greater than the reflective light value, the shooting is determined.
  • the object type of the object is a photo.
  • the object type of the photographic subject is a photo that can be represented by the two-dimensional information in the two-dimensional space.
  • the fingerprint information refers to the fingerprint information of the contact remaining on the remake photo, that is, the object type of the photographic subject is a photo.
  • the object type of the photographic subject can be determined as a photo, and the scheme only needs to perform feature comparison, and does not require a complicated algorithm. So simple and easy to implement.
  • the less than the preset threshold includes: determining whether the focal length after focusing is within a specified zoom range of the photographing device, wherein the specified zoom range corresponds to a preset threshold; if the focal length after focusing is within a specified zoom range of the photographing device, determining The distance between the shooting device and the subject is less than the preset threshold.
  • the above-specified zoom range refers to an autofocus range corresponding to the distance between the photographing device and the photographing living body when a clear image is taken after the camera of the photographing device.
  • the user clicks the shooting button to activate the camera of the terminal (such as a mobile phone), and when the mobile phone supports the auto focus function, the mobile phone camera enters the auto focus mode, and the autofocus algorithm drives the focus.
  • the motor moves the image sensor back and forth to achieve the purpose of autofocus. Since the range in which the focus motor can move is typically a few hundred microns, the autofocus range that is reflected in the camera is very limited. If the focal length returned by the mobile phone software is within the specified zoom range of the camera, the distance between the corresponding shooting device and the photographic subject is less than a preset threshold, that is, the object type of the photographic subject at this time is a photo.
  • the corresponding preset threshold is 1 meter.
  • the maximum value of the specified zoom range is taken to make a clear image of the real person through the camera, from the above principle. It can be seen from the description that when shooting a non-living object, it needs to be in the range of 0-1 m, and even a smaller range. If a certain subject is photographed on the mobile phone camera, after the focus is successful, the focal length of the camera returned by the mobile phone software is within the specified zoom range, and it can be determined that the object distance between the camera and the subject is less than 1 meter, thereby determining the subject. For non-living objects, such as photos.
  • the auto-focusing of the photographing device by the photographing device of the activation terminal includes: when the photographing instruction is received, the photographing device of the terminal is initialized; after the initialization of the photographing device is completed, detecting whether the photographing device of the terminal supports the automatic device Focus mode; activates the autofocus mode of the shooting device when the shooting device that detects the terminal supports the autofocus mode, so that the shooting device automatically focuses on the subject.
  • detecting whether the photographing device of the terminal supports the auto focus mode comprises: picking up a focus mode list of the photographing device; and if the auto focus mode identification information exists in the focus mode list, detecting that the photographing device of the terminal supports the auto focus mode.
  • the solution of the foregoing embodiment may be implemented by using a software algorithm provided by the Android system to obtain an auto focus of the mobile phone camera.
  • the flow of the software algorithm is shown in Figure 7, and includes the following steps:
  • Step S701 Initialize the camera and call Camera.open().
  • the mobile application opens the mobile phone camera and initializes the camera by calling Camera.open().
  • Step S702 Determine whether the camera initialization is successful.
  • step S703 is performed; if the initialization of the camera fails, the process returns to step S701.
  • Step S703 Determine whether the mobile phone supports the auto focus mode.
  • the method of judging is to call Camear.Parameters.Get Supported Focus Modes(), this method returns a list (ie, the above-mentioned focus mode list), and the list may include at least one of the six focus modes shown in Table 1.
  • a list ie, the above-mentioned focus mode list
  • the list may include at least one of the six focus modes shown in Table 1.
  • FOCUS_MODE_AUTO Autofocus mode FOCUS_MODE_INFINITY Infinite focus mode
  • FOCUS_MODE_FIXED Fixed focus mode FOCUS_MODE_EDOF Full focus mode
  • step S704 is performed.
  • the mobile phone does not support the auto focus mode. In this case, the above embodiment of the present application cannot be implemented, and the process returns to step S701.
  • Step S704 Start the autofocus mode of the mobile phone to enable the photographing device to automatically focus on the subject.
  • Step S705 When the focusing is successful, the system returns the focal length after focusing.
  • the system automatically calls the callback function cb, and the callback function cb includes a core logic algorithm for determining the focal length after focusing.
  • the callback function cb includes a core logic algorithm for determining the focal length after focusing.
  • Android a method that calls Camera.get Focus Distances() is provided to return the focus after focusing.
  • the size of this focal length depends on the underlying camera hardware driver. If the underlying hardware does not provide this interface, this scheme will not work.
  • Step S706 determining the portrait distance.
  • the focal length returned in the middle can be regarded as a remake as long as it is judged that the focal length is smaller than the maximum value of the zoom range of the mobile phone.
  • the user clicks the start shooting button opens the mobile phone camera in the mobile application, and initializes the camera by calling Camera.open().
  • Camera.open() In the case that the camera is successfully initialized, it is determined whether the mobile phone supports the auto focus mode.
  • the method of judging is to call Camear.Parameters.Get Supported Focus Modes(), this method returns a list (ie, the above-mentioned focus mode list), when the focus returns.
  • the mode list contains FOCUS_MODE_AUTO or FOCUS_MODE_MACRO (that is, the above-mentioned identification information of the autofocus mode), it means that the mobile phone supports the autofocus mode.
  • the related software interface for obtaining the camera autofocus focal length provided by the Android system is used to return the focal length of the camera after focusing, and the object type of the photographing object can be determined according to the focal length.
  • the above embodiment has been tested and successfully implemented in the Samsung Galaxy Nexus mobile phone.
  • the solution of the present application can be used on a terminal with an Android operating system installed, or an operating system installed with iOS (abbreviation of iphone Operating System, that is, Apple's iOS operating system), and has a photo taking.
  • the information of the camera's auto focus can be obtained through the system interface.
  • the method for identifying the photographic subject of the present application is based on the identification method of the client side, and has no coupling relationship with the business system. If the business system is based on the wind control requirement, the identification of the photographic subject of the present application needs to be added. In the method of detecting the remake photograph, it is only necessary to embed the implementation steps of the recognition method of the subject of the present application in the flow of the existing business system, and report the detection data to the background system for analysis.
  • the mobile phone application (such as Ali Qiandun) prompts the user to take a portrait photo, and the user needs to click the start shooting button; when the user opens the mobile phone camera in the mobile application, the interface of the Android system starts to initialize the camera, and when the camera is successfully initialized, the mobile phone is judged.
  • the system automatically calls the set callback function of the focus, returns the focal length after the focus, the user clicks the photo button, the camera of the mobile phone collects the image, and the mobile phone terminal Generating image data corresponding to the image, the image data includes focal length information after focusing and object distance information corresponding to the focal length information, and the mobile phone system transmits the generated image data to the mobile phone application (such as Ali Qiandun) through the network.
  • the server and the server determine whether the subject is a real or effective person based on the data sent by the terminal to determine whether the subject is a photo or a real person.
  • the focal length after the auto focus is derived, and the distance between the camera camera and the object is obtained according to the focal length, and the distance is used to determine whether the subject is very close.
  • the distance that is, the minimum distance necessary to finally determine whether a real person takes a half-length photograph, compared with the prior art method of recognizing a remake photograph, the scheme does not require additional hardware and software flow based on the photographing equipment.
  • the invention is relatively simple, and simplifies the process of recognizing the remake photograph, and solves the problem that the scheme for recognizing the remake photograph in the prior art is high in complexity, so as to realize efficient recognition of the remake photograph.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the prior art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk,
  • the optical disc includes a number of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the methods described in various embodiments of the present application.
  • the identification apparatus includes: a startup module 20, an acquisition module 40, and a determination module 60.
  • the startup module 20 is configured to: when receiving the shooting instruction, the shooting device that activates the terminal performs auto focus on the photographic subject.
  • the obtaining module 40 is configured to acquire a focal length after focusing of the photographing device after the photographing device successfully focuses on the photographing object.
  • the determining module 60 is configured to determine whether the object type of the photographic subject is a photo based on the focal length after focusing.
  • the autofocus function of the photographing device of the terminal is used to determine whether the object type of the photographing object is a photo based on the focal length of the photographing device after the photographing device successfully focuses on the photographing object.
  • the hardware and the software flow are relatively simple, simplifying the process of recognizing the remake photos, and solving the problem of the complexity of the scheme for recognizing the remake photos in the prior art, so as to realize the efficient recognition of the remake photos.
  • the terminal may be a personal computer or a mobile terminal, such as a mobile terminal having a photographing function, such as a mobile phone or a tablet computer.
  • a mobile terminal such as a mobile phone having a fixed focus lens.
  • the above-mentioned focusing refers to an operation mode of changing the distance between the imaging surface and the lens according to the difference in the position at which the different objects are clearly imaged at the rear of the lens, that is, by changing the image distance to change the sharpness of the formed image.
  • the shooting device of the terminal (such as a mobile phone camera) is activated, and the autofocus function of the photographing device is used, and the autofocus algorithm drives the focus when the camera of the photographing device enters the autofocus mode.
  • the motor moves the image sensor back and forth to achieve the purpose of focusing to capture a clear image. Since the size of the photo is much smaller than the size of a real person, if you want to make the size of the image on the terminal close when shooting real people and remake photos, the distance between the photo and the camera of the shooting device is much smaller than that of the real person and the camera. The distance is reflected in the imaging formula, that is, the object distance is different, so the difference in the distance can be used to determine whether the object type of the subject of the photographing device is a photo or a real person.
  • the shooting instruction described above may be generated by a server or may be generated by a terminal.
  • the server After receiving the identity verification request sent by the terminal, the server generates the shooting instruction to take a photo of the user of the terminal; or the user activates the shooting device by operating a startup button of the shooting device on the terminal, to The user takes a photo, which can be a click operation.
  • the determining module 60 includes: a determining sub-module 601, configured to determine, according to a focal length after focusing, whether a distance between the photographing device and the photographing object is less than a preset threshold, wherein The threshold value is used to indicate the minimum distance required for the photographing device to capture the living body object, wherein the object type includes the living body object and the photo; the first determining sub-module 603 is configured to determine if the distance between the photographing device and the photographing object is less than a preset threshold.
  • the object type of the subject is a photo.
  • the shooting device of the terminal is activated, and the autofocus function of the photographing device is used.
  • the autofocus algorithm drives the focus motor to move the image sensor back and forth. To achieve the purpose of focusing to capture a clear image when the camera is paired After the subject is successfully focused, the focal length after the focus of the shooting device can be obtained.
  • the embodiment of the embodiment by using the focal length after autofocus of the photographing device, combined with the imaging formula, the distance between the photographing device and the photographing object can be obtained, and according to the distance, it can be directly determined whether the object type of the photographing object is a photograph, the embodiment of the embodiment
  • the principle is simple and clear, and the algorithm is simple and easy to implement.
  • the determining module 60 includes: a determining sub-module 601, configured to determine, according to a focal length after focusing, whether a distance between the photographing device and the photographing object is less than a preset threshold, wherein The threshold is used to indicate the minimum distance required for the shooting device to capture the living body object, wherein the object type includes the living body object and the photo; and the obtaining sub-module 605 is configured to acquire the shooting based on the shooting device if the distance from the shooting object is less than a preset threshold.
  • the first detection sub-module 607 is configured to detect whether there is a pre-acquired remake photo feature in the image data
  • the second determining sub-module 609 is configured to: if there is a pre-acquired remake photo in the image data The feature determines the object type of the subject as a photo.
  • the object type of the photographic subject can be determined as a photo, and the scheme only needs to perform feature comparison, and does not require a complicated algorithm. So simple and easy to implement.
  • the determining sub-module 601 includes: a focal length determining sub-module 6011, configured to determine whether the focal length after focusing is within a specified zoom range of the photographing device, wherein the zoom range is specified
  • the third determining sub-module 6013 is configured to determine that the distance between the photographing device and the photographing object is less than a preset threshold if the focal length after focusing is within a specified zoom range of the photographing device.
  • the above-specified zoom range refers to an autofocus range corresponding to the distance between the photographing device and the photographing living body when a clear image is taken after the camera of the photographing device.
  • the user clicks the shooting button to activate the camera of the terminal (such as a mobile phone), and when the mobile phone supports the auto focus function, the mobile phone camera enters the auto focus mode, and the autofocus algorithm drives the focus.
  • the motor moves the image sensor back and forth to achieve the purpose of autofocus. Since the range in which the focus motor can move is typically a few hundred microns, the autofocus range that is reflected in the camera is very limited. If the focal length returned by the mobile phone software is within the specified zoom range of the camera, the distance between the corresponding shooting device and the photographic subject is less than a preset threshold, that is, the object type of the photographic subject at this time is a photo.
  • the startup module 20 includes: an initialization sub-module 201, configured to initialize a photographing device of the terminal when receiving a photographing instruction; and a second detecting sub-module 203 for Initial After the shooting device is completed, detecting whether the shooting device of the terminal supports the auto focus mode; the activation sub-module 205 is configured to start the auto-focus mode of the shooting device when the detecting device of the terminal detects that the auto-focus mode is supported, so that the shooting is performed. The device automatically focuses on the subject.
  • the second detecting submodule 203 includes: a retrieving submodule 2031 for retrieving a focus mode list of the photographing device; and an identification information detecting submodule 2033 for automatically presenting in the focus mode list When the identification information of the focus mode is detected, it is detected that the shooting device of the terminal supports the auto focus mode.
  • the user clicks the start shooting button opens the mobile phone camera in the mobile application, and initializes the camera by calling Camera.open().
  • Camera.open() In the case that the camera is successfully initialized, it is determined whether the mobile phone supports the auto focus mode.
  • the method of judging is to call Camear.Parameters.Get Supported Focus Modes(), this method returns a list (ie, the above-mentioned focus mode list), when the focus returns.
  • the mode list contains FOCUS_MODE_AUTO or FOCUS_MODE_MACRO (that is, the above-mentioned identification information of the autofocus mode), it means that the mobile phone supports the autofocus mode.
  • the mobile phone application (such as Ali Qiandun) prompts the user to take a portrait photo, and the user needs to click the start shooting button; when the user opens the mobile phone camera in the mobile application, the interface of the Android system starts to initialize the camera, and when the camera is successfully initialized, the mobile phone is judged.
  • the system is Automatically recall the set focus function of the focus, return the focus after focusing, the user clicks the camera button, the camera of the mobile phone captures the image, and the mobile terminal generates image data corresponding to the image, the image data includes the focal length information after focusing and The object distance information corresponding to the focal length information, the mobile phone system transmits the generated image data to the server of the mobile phone application (such as Ali Qiandun) through the network, and the server determines whether the shooting object is a photo or a real person according to the data sent by the terminal, thereby Whether the identity of the real and effective user off.
  • the server of the mobile phone application such as Ali Qiandun
  • the related software interface for obtaining the camera autofocus focal length provided by the Android system is used to return the focal length of the camera after focusing, and the object type of the photographing object can be determined according to the focal length.
  • the above embodiment has been tested and successfully implemented in the Samsung Galaxy Nexus mobile phone.
  • the solution of the present application can be used on a terminal with an Android operating system installed, or It is used on a terminal that has an iOS operating system and has an interface that can acquire a focal length when taking a picture.
  • the information of the camera's auto focus can be obtained through the system interface.
  • the focal length after the auto focus is derived, and the distance between the camera camera and the object is obtained according to the focal length, and the distance is used to determine whether the subject is very close.
  • the distance that is, the minimum distance necessary to finally determine whether a real person takes a half-length photograph, compared with the prior art method of recognizing a remake photograph, the scheme does not require additional hardware and software flow based on the photographing equipment.
  • the invention is relatively simple, and simplifies the process of recognizing the remake photograph, and solves the problem that the scheme for recognizing the remake photograph in the prior art is high in complexity, so as to realize efficient recognition of the remake photograph.
  • an embodiment of a mobile terminal which comprises the identification device of the photographic subject in the above embodiment 2.
  • the mobile terminal includes a photographing device 50 and a processor 70.
  • the photographing device 50 is configured to start when a photographing instruction is received, and perform autofocus on the photographing object.
  • the processor 70 is configured to acquire a focal length after focusing of the photographing device after the photographing device successfully focuses on the photographing object, and determine whether the object type of the photographing object is a photo based on the focal length after the focusing.
  • the processor determines whether the object type of the photographing object is a photo based on the focal length after the photographing device focuses.
  • the above-mentioned focusing refers to an operation mode of changing the distance between the imaging surface and the lens according to the difference in the position at which the different objects are clearly imaged at the rear of the lens, that is, by changing the image distance to change the sharpness of the formed image.
  • the shooting device of the mobile terminal (such as a mobile phone camera) is activated, and the autofocus function of the photographing device is used, and the autofocus algorithm is driven when the camera of the photographing device enters the autofocus mode.
  • the focus motor moves the image sensor back and forth to achieve the purpose of focusing to capture a clear image. Since the size of the photo is much smaller than the size of a real person, if you want to make the size of the image on the mobile terminal close when shooting real people and remake photos, the distance between the photo and the camera of the shooting device is much smaller than that of the real person and the camera. The distance, the reaction in the imaging formula, that is, the object distance is different, so you can use this distance The difference in distance determines whether the object type of the subject of the photographing device is a photo or a real person.
  • an embodiment of a camera including the recognition device of the photographic subject in the above-described Embodiment 2.
  • the camera includes a camera 80 and a processor 90.
  • the camera 80 is configured to start when a shooting instruction is received, and automatically focus the subject.
  • the processor 90 is configured to acquire a focal length after focusing of the photographing device after the camera successfully focuses on the photographing object, and determine whether the object type of the photographing object is a photo based on the focal length after the focusing.
  • the processor determines whether the object type of the subject is a photo based on the focal length after the camera focuses.
  • the above-mentioned focusing refers to an operation mode of changing the distance between the imaging surface and the lens according to the difference in the position at which the different objects are clearly imaged at the rear of the lens, that is, by changing the image distance to change the sharpness of the formed image.
  • the camera when the user is required to take a photo, the camera is activated, and the camera's autofocus function is used.
  • the autofocus algorithm drives the focus motor to move the image sensor back and forth to achieve focus. Purpose to take a clear picture. Since the size of the photo is much smaller than the size of a real person, if you want to make the size of the image on the camera close when shooting real people and remake photos, the distance between the photo and the camera is much smaller than the distance between the real person and the camera. In the imaging formula, that is, there is a difference in the object distance, so the difference in the distance can be used to determine whether the object type of the camera is a photo or a real person.
  • Embodiments of the present application may provide a computer terminal, which may be any one of computer terminal groups.
  • the foregoing computer terminal may also be replaced with a terminal device such as a mobile terminal.
  • the computer terminal may be located in at least one network device of the plurality of network devices of the computer network.
  • the computer terminal may execute a program generation of the following steps in the method for recognizing a photographic subject Code:
  • the shooting device that starts the terminal automatically focuses on the subject; after the shooting device successfully focuses on the subject, acquires the focal length after the focusing of the shooting device; determines the object of the shooting object based on the focal length after focusing Whether the type is a photo.
  • FIG. 16 is a structural block diagram of a computer terminal according to an embodiment of the present application.
  • the computer terminal A may include one or more (only one shown in the figure) processor 161, memory 163, and transmission device 165.
  • the memory can be used to store a software program and a module, such as a method for identifying a photographic subject and a program instruction/module corresponding to the device in the embodiment of the present application, and the processor executes various programs by running a software program and a module stored in the memory.
  • Functional application and data processing that is, the above-described method of recognizing a subject.
  • the memory may include a high speed random access memory, and may also include non-volatile memory such as one or more magnetic storage devices, flash memory, or other non-volatile solid state memory.
  • the memory can further include memory remotely located relative to the processor, which can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
  • the processor can call the information and the application stored in the memory through the transmission device to perform the following steps: when receiving the shooting instruction, the shooting device that starts the terminal automatically focuses on the subject; after the shooting device focuses on the subject successfully, Obtain the focal length of the shooting device after focusing; determine whether the object type of the subject is a photo based on the focal length after focusing.
  • the processor may further perform the following steps: determining whether the object type of the photographic subject is a photo based on the focal length after the focusing comprises: determining whether the distance between the shooting device and the photographic object is less than a preset threshold based on the focal length after the focusing, wherein The preset threshold is used to indicate a minimum distance required for the shooting device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance of the shooting device from the photographic subject is less than a preset threshold, it is determined that the object type of the photographic subject is a photo.
  • the processor may further perform the following steps: determining whether the object type of the photographic subject is a photo based on the focal length after the focusing comprises: determining whether the distance between the shooting device and the photographic object is less than a preset threshold based on the focal length after the focusing, wherein The preset threshold is used to indicate a minimum distance required for the shooting device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance between the shooting device and the photographic subject is less than a preset threshold, acquiring a photographic subject generated based on the shooting instruction Image data; detecting whether there is a pre-acquired remake photo feature in the image data; if there is a pre-acquired remake photo feature in the image data, determining that the object type of the photographic subject is a photo.
  • the processor may further perform the following steps: determining a shooting device and shooting based on the focal length after focusing Whether the distance of the object is less than a preset threshold includes: determining whether the focal length after focusing is within a specified zoom range of the photographing device, wherein the specified zoom range corresponds to a preset threshold; if the focal length after focusing is within a specified zoom range of the photographing device , it is determined that the distance between the shooting device and the photographic subject is less than a preset threshold.
  • the processor may further perform the following steps: the capturing device that activates the terminal performs auto-focusing on the photographic object, including: when receiving the shooting instruction, initializing the shooting device of the terminal; after initializing the shooting device, detecting the shooting of the terminal Whether the device supports the autofocus mode; when the shooting device that detects the terminal supports the autofocus mode, the autofocus mode of the photographing device is activated to enable the photographing device to automatically focus on the subject.
  • the foregoing processor may further perform the following steps: detecting whether the shooting device of the terminal supports the auto focus mode comprises: capturing a focus mode list of the photographing device; and detecting if the auto focus mode identification information exists in the focus mode list The shooting device of the terminal supports the auto focus mode.
  • the autofocus function of the photographing device of the terminal is used to determine whether the object type of the photographing object is a photo based on the focal length of the photographing device after the photographing device successfully focuses on the photographing object.
  • the hardware and the software flow are relatively simple, which simplifies the process of recognizing the remake photos, and solves the technical problem of the complexity of the scheme for recognizing the remake photos in the prior art, so as to realize the efficient recognition of the remake photos.
  • FIG. 16 is merely illustrative, and the computer terminal can also be a smart phone (such as an Android mobile phone, an iOS mobile phone, etc.), a tablet computer, an applause computer, and a mobile Internet device (MID). ), PAD and other terminal devices.
  • Fig. 16 does not limit the structure of the above electronic device.
  • computer terminal A may also include more or fewer components (such as a network interface, display device, etc.) than shown in FIG. 16, or have a different configuration than that shown in FIG.
  • Embodiments of the present application also provide a storage medium.
  • the storage medium may be used to save the program code executed by the method for identifying the photographic subject provided in the first embodiment.
  • the foregoing storage medium may be located in a computer terminal group in a computer network.
  • a computer terminal or in any one of the mobile terminal groups.
  • the storage medium is configured to store program code for performing the following steps: when receiving the shooting instruction, the shooting device of the activation terminal automatically focuses on the photographic subject; After the focus is successful, the focal length after the focus of the shooting device is obtained; based on the focal length after the focus, it is determined whether the object type of the shooting object is a photo.
  • the storage medium is further configured to store program code for performing the following steps: determining whether the object type of the photographic subject is a photo based on the focal length after focusing comprises: determining whether the distance between the shooting device and the photographic subject is based on the focal length after focusing Is less than a preset threshold, wherein the preset threshold is used to indicate a minimum distance required for the shooting device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance between the shooting device and the photographic subject is less than a preset threshold, determining to shoot The object type of the object is a photo.
  • the storage medium is further configured to store program code for performing the following steps: determining whether the object type of the photographic subject is a photo based on the focal length after focusing comprises: determining whether the distance between the shooting device and the photographic subject is based on the focal length after focusing
  • the preset threshold is used to indicate a minimum distance required for the photographing device to capture a living body object, wherein the object type includes a living body object and a photo; if the distance between the photographing device and the photographing object is less than a preset threshold, the acquisition is based on The image data of the photographic subject generated by the instruction is captured; whether the pre-acquired remake photo feature exists in the image data is detected; if there is a pre-acquired remake photo feature in the image data, the object type of the photographic subject is determined to be a photo.
  • the storage medium is further configured to store program code for performing: determining whether the distance between the photographing device and the photographing object is less than a preset threshold based on the focal length after focusing comprises: determining whether the focal length after focusing is at the photographing device Within the specified zoom range, the specified zoom range corresponds to the preset threshold; if the focus after focusing is within the specified zoom range of the shooting device, it is determined that the distance between the subject and the subject is less than the preset threshold.
  • the storage medium is further configured to store program code for performing the following steps: the photographing device that activates the terminal performs autofocusing on the photographing object, including: when receiving the photographing instruction, initializing the photographing device of the terminal; After completion, it is detected whether the shooting device of the terminal supports the auto focus mode; in the case where the shooting device of the terminal is detected to support the auto focus mode, the auto focus mode of the photographing device is activated to cause the photographing device to automatically focus on the subject.
  • the storage medium is further configured to store program code for performing the following steps: detecting whether the photographing device of the terminal supports the auto focus mode comprises: picking up a focus mode list of the photographing device; if an auto focus mode exists in the focus mode list When the identification information is detected, it is detected that the shooting device of the terminal supports the auto focus mode.
  • the autofocus function of the photographing device of the terminal is used, and the photographing device is used for the photographing object. After the focus is successful, it is determined whether the object type of the subject is a photo based on the focal length of the photographing device after focusing.
  • the hardware and the software flow are relatively simple, which simplifies the process of recognizing the remake photos, and solves the technical problem of the complexity of the scheme for recognizing the remake photos in the prior art, so as to realize the efficient recognition of the remake photos.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Human Computer Interaction (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Studio Devices (AREA)
  • Image Analysis (AREA)
  • Automatic Focus Adjustment (AREA)

Abstract

本申请公开了一种拍摄对象的识别方法、装置、移动终端和照相机。其中,该识别方法包括:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;基于对焦后的焦距判断拍摄对象的对象类型是否为照片。本申请解决了现有技术中识别翻拍照片的方案复杂程度高的技术问题。

Description

拍摄对象的识别方法、装置、移动终端和照相机
本申请要求2016年02月26日递交的申请号为201610109132.7、发明名称为“拍摄对象的识别方法、装置、移动终端和照相机”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及信息安全领域,具体而言,涉及一种拍摄对象的识别方法、装置、移动终端和照相机。
背景技术
在业务中经常需要用户提供真实身份认证的情况,比如淘宝开店认证、支付宝的实名认证、网商银行的实名认证等,又比如证券公司的开户,银行信用卡开户等,都需要用户提供真实的身份资料,一般需要提供的身份资料包括本人认证时的现场照片、身份证照片等。此处的“真实的身份资料”,不单单是指的证件和照片是真实的,而且要求这些证件的使用者就是这些证件的本人。
举例说明,在淘宝开店认证业务中,淘宝会员来做认证需要使用手机拍摄会员本人的照片、会员本人的身份证,提交到淘宝做审核。在提交的过程中,会员通过使用手机淘宝或阿里钱盾的手机应用来提交认证资料,在这些应用中,会员被限制了只能使用手机的摄像头当场拍摄,而不能从手机相册里上传已有照片。一般情况下,这种限制必须使用手机当前拍摄的情况,能够排除大部分的恶意认证会员,但仍会出现以下这种情况:有恶意用户使用从黑市购买或非法收集盗用的他人的照片和身份证照片,然后在认证过程中,用手机摄像头翻拍这些照片来做淘宝的开店认证。
为了解决上述的翻拍照片的问题,现有技术中提出了使用生物特征识别来翻拍照片,包括如下两种方法:方法一,指纹验证方法,即通过指纹验证硬件设施,验证照片中是否存在指纹,若存在,则该照片为翻拍照片;方法二,视频活体检测方法,即系统随机给出一序列标准动作,比如摇头、点头、眨眼、张嘴等动作,利用智能模式识别算法验证拍摄时的人物为真实人物,而不是照片。
上述的两种方法能够达到识别或过滤出翻拍照片的作用,但都有各自缺点。方法一的指纹验证方法需要增加新的硬件;方法二的视频活体检测方法需要增加额外的软件包 和复杂人脸检测算法,并且有算法识别失败的情况。
针对现有技术中识别翻拍照片的方法复杂程度高的问题,目前尚未提出有效的解决方案。
发明内容
本申请实施例提供了一种拍摄对象的识别方法、装置、移动终端和照相机,以至少解决现有技术中识别翻拍照片的方案复杂程度高的技术问题。
根据本申请实施例的一个方面,提供了一种拍摄对象的识别方法,该识别方法包括:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
根据本申请实施例的另一方面,还提供了一种拍摄对象的识别装置,该识别装置包括:启动模块,用于当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;获取模块,用于在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;判断模块,用于基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
根据本申请实施例的另一方面,还提供了一种移动终端,该移动终端包括:上述的拍摄对象的识别装置。
根据本申请实施例的另一方面,还提供了一种照相机,该照相机包括:上述的拍摄对象的识别装置。
在本申请实施例中,利用终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象对焦成功后,基于拍摄设备对焦后的焦距判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的技术问题。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本申请实施例的一种拍摄对象的识别方法的原理示意图;
图2是根据本申请实施例的一种终端拍摄设备的内部结构示意图;
图3是根据本申请实施例的一种拍摄对象的识别方法的计算机终端的结构框图;
图4是根据本申请实施例的一种拍摄对象的识别方法的流程图;
图5是根据本申请实施例的一种可选的拍摄对象的识别方法的流程图;
图6是根据本申请实施例的另一种可选的拍摄对象的识别方法的流程图;
图7是根据本申请实施例的又一种可选的拍摄对象的识别方法的流程图;
图8是根据本申请实施例的一种拍摄对象的识别装置的示意图;
图9是根据本申请实施例的一种可选的拍摄对象的识别装置的示意图;
图10是根据本申请实施例的另一种可选的拍摄对象的识别装置的示意图;
图11是根据本申请实施例的又一种可选的拍摄对象的识别装置的示意图;
图12是根据本申请实施例的第四种可选的拍摄对象的识别装置的示意图;
图13是根据本申请实施例的第五种可选的拍摄对象的识别装置的示意图;
图14是根据本申请实施例的一种可选的移动终端的示意图;
图15是根据本申请实施例的一种可选的照相机的示意图;以及
图16是根据本申请实施例的一种计算机终端的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,对本申请涉及的相关原理作如下解释:
光学成像原理:如图1所示,原物体通过凸透镜,在凸透镜后形成原物体的像。图1中的F点为焦点,是由平行于主光轴的光线穿过凸透镜,在主光轴上汇聚的一点;图1中的O点为光心,即凸透镜的中心;图1中的距离u为物距,用于表示物体到凸透镜光心的距离;距离f为焦距,用于表示焦点到光心的距离;距离v为像距,用于表示凸透镜成的像到光心的距离。物距、像距以及焦距之间满足成像公式:1/u(物距)+1/v(像距)=1/f(透镜焦距),并当u>2*f且f<v<2*f时,满足照相机的成像关系。
自动对焦模式:手机摄像头中可以包括如图2所示的保护膜①、镜头组②、对焦马达③、红外线滤光片④、影像传感器⑤以及线路连接基板⑥。如图2所示,终端的摄像头的焦距可以是固定的,为了拍摄出清晰的照片,手机摄像头可以移动像距v,以达到成清晰的像的目的。在这种摄像头中,通过对焦马达、前后移动影像传感器来达到对焦的目的,且通常情况下,对焦马达能移动的距离为几百微米,它反映了摄像头能对焦的范围。其中,上述的影像传感器一般为cmos(complementary metal-oxide semiconductor,互补性氧化金属导体)组件,也即感光元件。
实施例1
根据本申请实施例,还提供了一种拍摄对象的识别方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
本申请实施例一所提供的方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在计算机终端上为例,图3是根据本申请实施例的一种拍摄对象的识别方法的计算机终端的结构框图。如图3所示,计算机终端30可以包括一个或多个(图中仅示出一个)处理器302(处理器302可以包括但不限于微处理器MCU或可编程逻辑器件FPGA等的处理装置)、用于存储数据的存储器304、以及用于通信功能的传输模块306。本领域普通技术人员可以理解,图3所示的结构仅为示意,其并不对上述电子装置的结构造成限定。例如,计算机终端30还可包括比图3中所示更多或者更少的组件,或者具有与图3所示不同的配置。
存储器304可用于存储应用软件的软件程序以及模块,如本申请实施例中的拍摄对象的识别方法对应的程序指令/模块,处理器302通过运行存储在存储器304内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的拍摄对象的识别方法。存储器304可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存 储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器304可进一步包括相对于处理器302远程设置的存储器,这些远程存储器可以通过网络连接至计算机终端30。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输装置306用于经由一个网络接收或者发送数据。上述的网络具体实例可包括计算机终端30的通信供应商提供的无线网络。在一个实例中,传输装置306包括一个网络适配器(Network Interface Controller,NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输装置306可以为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
在上述运行环境下,本申请提供了如图4所示的一种拍摄对象的识别方法的实施例。图4是根据本申请实施例的一种拍摄对象的识别方法的流程图。如图4所示,该实施例可以包括如下步骤:
步骤S402:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦。
步骤S404:在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距。
步骤S406:基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
采用本申请实施例,利用终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象对焦成功后,基于拍摄设备对焦后的焦距判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
上述终端可以为个人计算机或移动终端,如手机、或平板电脑等具有拍摄功能的移动终端。可选地,本申请的方案可以通过具有定焦镜头的移动终端(如手机)来实现。
上述的对焦是指根据不同物体在镜头后部清晰成像的位置的不同而改变成像面与透镜之间的距离的操作方式,也即通过改变像距以改变所成图像的清晰度。
具体地,当需要用户拍摄照片的时候,启动终端的拍摄设备(如手机摄像头),利用拍摄设备的自动对焦功能,在拍摄设备的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像。由于照片的大小要远远小于真人的大小,因此在拍摄真人、翻拍照片的时候,如果想让终端上的成像照片大小接近,那么照片与拍摄设备的摄像头的距离要远远小于真人 与摄像头的距离,反应在成像公式中,也即物距存在差异,因此可以利用这个距离的差异判断出拍摄设备的拍摄对象的对象类型为照片,还是真人。
可选地,上述的拍摄指令可以由服务器生成,也可以由终端生成。如,服务器在接收到终端发送的身份验证请求之后,生成该拍摄指令,以对该终端的使用者进行拍照;或者,用户通过操作终端上的拍摄设备的启动按钮,启动该拍摄设备,以对用户进行拍照,该操作可以为点击操作。
下面以淘宝开店身份认证的业务流程为例,详述本申请的上述实施例:
手机应用(比如阿里钱盾)提示用户需要拍摄照片,用户点击启动拍摄按钮,在手机支持自动对焦功能的情况下,手机摄像头对拍摄对象进行自动对焦,在自动对焦成功后,用户点击拍照按钮,手机的摄像头采集到图像,手机终端生成对应于该图像的图像数据,该图像数据中包含有对焦后的焦距信息以及与焦距信息对应的物距信息,手机系统将生成的图像数据通过网络传输到手机应用(如阿里钱盾)的服务器,服务器根据终端发送的这些数据,来判断拍摄对象是照片还是真人,从而判断用户的身份是否真实有效。
在一种可选的实施方案中,基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则确定拍摄对象的对象类型为照片。
如图5所示,该实施例可以包括如下步骤:
步骤S501:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦。
步骤S502:在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距。
步骤S503:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值。
具体地,若判断出拍摄设备与拍摄对象的距离小于预设阈值,则执行步骤S504;若判断出拍摄设备与拍摄对象的距离不小于预设阈值,则执行步骤S505。
其中,上述的预设阈值是指拍摄设备在对拍摄活体对象(如真人)进行自动对焦,并在拍摄设备的摄像头后成清晰的像时,拍摄设备与拍摄活体之间所需的最小距离。
步骤S504:确定拍摄对象的对象类型为照片。
步骤S505:确定拍摄对象的对象类型为真人。
具体地,当需要用户拍摄照片的时候,启动终端的拍摄设备,利用拍摄设备的自动 对焦功能,在拍摄设备的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像,当拍摄设备对拍摄对象对焦成功后,此时可以获得拍摄设备对焦后的焦距,该焦距与物距、和像距之间满足成像公式:1/u(物距)+1/v(像距)=1/f(焦距),因此,可以基于对焦后的焦距得出物距,并通过物距的大小判断出拍摄对象是照片,还是活体对象(真人)。
例如,当用户采用已有的照片来翻拍时,由于已有照片的尺寸限制,为了得到与真人的成像照片大小接近,而不让照片漏出马脚,必然要把手机摄像头与照片贴得比较近,通过对焦马达驱动影像传感器移动,才能拍摄到清晰的照片,反应在成像公式上就是物距u变小,像距v变大。以10寸照片为例,手机摄像头与照片的距离大约为20厘米才能拍出不露马脚的清晰照片。如果是拍摄真人,手机摄像头与真人的距离大约是100厘米左右,通过对焦马达驱动影像传感器的移动,使得像距v变小,拍摄出清晰照片。对上述内容分析可知,使用的翻拍照片与真人的物距差别在5-10倍左右,反应在像距v上,会有一个明显的差异,因此可以通过物距和像距的差异来识别照片是否为翻拍照片。
以上述的手机摄像头与真人的距离为100厘米作为上述的预设阈值,来判断手机的拍摄对象是否为照片。具体地,在手机摄像头对拍摄对象对焦成功后,通过手机系统软件获取对焦后的焦距,结合成像公式,可以确定出手机与拍摄对象之间的距离(即上述的物距),当该物距小于100厘米时,可以判断出拍摄对象为照片,当该物距大于100厘米时,可以判断出拍摄对象为真人。
通过上述实施例,利用拍摄设备的自动对焦后的焦距,结合成像公式,可以得到拍摄设备与拍摄对象的距离,并根据该距离可以直接判断出拍摄对象的对象类别是否为照片,该实施方案的原理简单明了,且算法简单,容易实现。
在一种可选的实施方案中,基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;检测图像数据中是否存在预先获取的翻拍照片特征;若图像数据中存在预先获取的翻拍照片特征,则确定拍摄对象的对象类型为照片。
如图6所示,该实施例可以包括如下步骤:
步骤S601:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦。
步骤S602:在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距。
步骤S603:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值。
具体地,若判断出拍摄设备与拍摄对象的距离小于预设阈值,则执行步骤S604;若判断出拍摄设备与拍摄对象的距离不小于预设阈值,则执行步骤S605。
其中,上述的预设阈值是指拍摄设备在对拍摄活体对象(如真人)进行自动对焦,并在拍摄设备的摄像头中成清晰的像时,拍摄设备与拍摄活体之间所需的最小距离。
步骤S604:获取基于拍摄指令生成的拍摄对象的图像数据。
上述的图像数据中包括图像的拍摄时间、图像的分辨率、图像中的二维信息或三维信息、图像表面上的指纹信息以及图像表面上的反射光线信息。
在获取基于拍摄指令生成的拍摄对象的图像数据之后,则执行步骤S606。
步骤S605:确定拍摄对象的对象类型为真人。
步骤S606:检测图像数据中是否存在预先获取的翻拍照片特征。
具体地,若图像数据中存在预先获取的翻拍照片特征,则执行步骤S607;若图像数据中不存在预先获取的翻拍照片特征,则执行步骤S605。
上述的预先获取的翻拍照片特征包括图像的分辨率、图像中的二维信息、图像表面上的指纹信息以及图像表面上的反射光线信息。
步骤S607:确定拍摄对象的对象类型为照片。
可选地,翻拍的照片与直接采集的真人照片在分辨率上存在差别,具体的差别由拍摄设备的摄像头的分辨率决定。在图像数据中存在预先获取的翻拍照片的分辨率数据时,则确定拍摄对象的对象类型为照片。
可选地,翻拍的照片上存在反光现象,通过测量光值后,将该测量光值与预先获取的翻拍照片的反光光值做比较,在测量光值大于反光光值的情况下,确定拍摄对象的对象类型为照片。
可选地,当图像数据中包含图像的二维信息时,则可确定拍摄对象的对象类型为可以由二维空间中的二维信息表示的照片。
可选地,当图像数据中含有指纹信息时,该指纹信息指的是翻拍的照片上残留的接触者的指纹信息,即可表明拍摄对象的对象类型为照片。
通过上述实施例,在判断出拍摄设备拍摄的图像数据中存在预先获取的翻拍照片特征的情况下,即可确定拍摄对象的对象类型为照片,该方案仅需要进行特征对比,不需要复杂的算法,因此简单、易实现。
在本申请的上述实施例中,基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否 小于预设阈值包括:判断对焦后的焦距是否在拍摄设备的指定变焦范围内,其中,指定变焦范围与预设阈值相对应;若对焦后的焦距在拍摄设备的指定变焦范围内,则判断出拍摄设备与拍摄对象的距离小于预设阈值。
上述的指定变焦范围是指当拍摄设备的摄像头后成清晰的像时,拍摄设备与拍摄活体之间的距离对应的自动对焦范围。
具体地,当需要用户拍摄照片的时候,用户点击拍摄按钮,启动终端(如手机)的摄像头,并在手机支持自动对焦功能的情况下,手机摄像头进入自动对焦模式,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到自动对焦的目的。由于对焦马达能移动的范围一般为几百微米,因此反应到摄像头的自动对焦范围非常有限。若手机软件返回的焦距在摄像头的指定变焦范围内,则对应拍摄设备与拍摄对象的距离小于预设阈值,也即此时的拍摄对象的对象类型为照片。
例如,对应的预设阈值为1米,当手机摄像头拍摄1米左右的真人时,在对焦时,取指定变焦范围的极大值,以通过摄像头成该真人的清晰的像,从上述的原理说明中可知,在拍摄非活体对象时,需在0-1m的范围内,甚至有可能是更小的范围。若在手机摄像头拍摄某一拍摄对象时,在对焦成功后,手机软件返回的摄像头的焦距在指定变焦范围内,可以确定此时的摄像头与拍摄对象的物距小于1米,从而确定该拍摄对象为非活体对象,如照片。
在本申请的上述实施例中,启动终端的拍摄设备对拍摄对象进行自动对焦包括:当接收到拍摄指令时,初始化终端的拍摄设备;在初始化拍摄设备完成之后,检测终端的拍摄设备是否支持自动对焦模式;在检测出终端的拍摄设备支持自动对焦模式的情况下,启动拍摄设备的自动对焦模式,以使拍摄设备对拍摄对象进行自动对焦。
进一步地,检测终端的拍摄设备是否支持自动对焦模式包括:调取拍摄设备的对焦模式列表;若对焦模式列表中存在自动对焦模式的标识信息时,检测出终端的拍摄设备支持自动对焦模式。
可选地,上述实施例的方案可以通过安卓系统提供的获取手机摄像头自动对焦焦距的软件算法实现。该软件算法的流程如图7所示,包括如下步骤:
步骤S701:初始化摄像头,调用Camera.open()。
具体地,当需要用户拍摄照片的时候,手机应用打开手机摄像头,并通过调用Camera.open()初始化摄像头。
步骤S702:判断摄像头初始化是否成功。
具体地,若初始化摄像头成功,则执行步骤S703;若初始化摄像头失败,则返回执行步骤S701。
步骤S703:判断手机是否支持自动对焦模式。
具体地,判断的方式是调用Camear.Parameters.Get Supported Focus Modes(),这个方法返回一个列表(即上述的对焦模式列表),该列表中至少可以包括表1示出的6种对焦模式中的一种。
表1
FOCUS_MODE_AUTO 自动对焦模式
FOCUS_MODE_INFINITY 无穷对焦模式
FOCUS_MODE_MACRO 微距对焦模式
FOCUS_MODE_FIXED 固定对焦模式
FOCUS_MODE_EDOF 全焦对焦模式
FOCUS_MODE_CONTINUOUS_VIDEO 连续摄像对焦模式
当返回的对焦模式列表中包含FOCUS_MODE_AUTO或FOCUS_MODE_MACRO(即上述的自动对焦模式的标识信息)时,则代表手机支持自动对焦模式,则执行步骤S704。当对焦模式列表中不包含FOCUS_MODE_AUTO和FOCUS_MODE_MACRO这两种模式时,则代表手机不支持自动对焦模式,在该种情况下,本申请的上述实施例则无法实现,返回执行步骤S701。
步骤S704:启动手机的自动对焦模式,以使拍摄设备对拍摄对象进行自动对焦。
具体地,当启动手机的自动对焦模式时,首先设置手机摄像头对焦模式参数为FOCUS_MODE_AUTO,调用的方法为Camear.Parameters.Set Focus Mode(FOCUS_MODE_AUTO),然后调用auto Focus(cb)启动自动对焦,并注册回调函数cb,并在对焦成功后系统调用此回调函数。
步骤S705:当对焦成功后,系统返回对焦后的焦距。
具体地,当对焦成功后,系统会自动调用回调函数cb,回调函数cb中包含判断对焦后的焦距的核心逻辑算法。在安卓系统中,提供了一个调用Camera.get Focus Distances()的方法来返回对焦后的焦距。在实际应用中,该焦距的大小依赖于底层相机硬件驱动程序,如果底层硬件未提供此接口,此方案失效。
步骤S706:判断人像距离。
具体地,实际场景中,由于手机的定焦镜头的软件自动对焦能力范围非常有限,当拍摄1米左右的真实人像时,已经是取到了软件变焦范围的极大值了,所以根据第步骤S705中返回的焦距,只要判断该焦距小于手机的变焦范围极大值就可以认定为翻拍了。
具体地,当需要用户拍摄照片的时候,用户点击启动拍摄按钮,在手机应用中打开手机摄像头,并通过调用Camera.open()初始化摄像头。在摄像头初始化成功的情况下,判断手机是否支持自动对焦模式,判断的方式是调用Camear.Parameters.Get Supported Focus Modes(),这个方法返回一个列表(即上述的对焦模式列表),当返回的对焦模式列表中包含FOCUS_MODE_AUTO或FOCUS_MODE_MACRO(即上述的自动对焦模式的标识信息)时,则代表手机支持自动对焦模式。在手机支持自动对焦模式的情况下,启动手机的自动对焦模式,设置手机摄像头对焦模式参数为FOCUS_MODE_AUTO,调用的方法为Camear.Parameters.Set Focus Mode(FOCUS_MODE_AUTO),然后当对焦成功时,系统会自动调用回调函数cb,返回对焦后的焦距。
在上述实施例中,利用安卓系统提供的获取摄像头自动对焦焦距的相关软件接口,返回手机的摄像头对焦后的焦距,根据该焦距可以实现对拍摄对象的对象类型的判断。上述实施例已在Samsung Galaxy Nexus手机中测试并成功实现。
需要说明的是,本申请的方案可以使用在安装有安卓操作系统的终端上,也可以使用在安装有iOS(iphone Operating System的缩写,即苹果的iOS操作系统)操作系统,且具有在拍照时能够获取焦距的接口的终端上。
在安装有安卓操作系统的终端上,可以通过系统接口获取摄像头自动对焦焦距的信息。
从上述实施例可以看出,本申请的拍摄对象的识别方法是基于客户端侧的识别方法,与业务系统无耦合关系,如果有业务系统基于风控需求,需要加入本申请的拍摄对象的识别方法,对翻拍照片进行检测的功能时,只需要在现有的业务系统的流程中嵌入本申请的拍摄对象的识别方法的实现步骤,并将检测数据上报到后台系统分析即可。
下面以淘宝开店身份认证的业务流程为例,详述本申请的上述实施例:
手机应用(比如阿里钱盾)提示用户拍摄人像照片,用户需要点击启动拍摄按钮;当用户在手机应用中打开手机摄像头时,安卓系统的接口开始初始化摄像头,在摄像头初始化成功的情况下,判断手机是否支持自动对焦模式,具体地,通过调取对焦模式列表,并在对焦模式列表中包含FOCUS_MODE_AUTO和FOCUS_MODE_MACRO这两种模 式的情况下,确定手机支持自动对焦模式;在手机自动对焦成功后,系统则自动调用设置的对焦的回调函数,返回对焦后的焦距,用户点击拍照按钮,手机的摄像头采集到图像,手机终端生成对应于该图像的图像数据,该图像数据中包含有对焦后的焦距信息以及与焦距信息对应的物距信息,手机系统将生成的图像数据通过网络传输到手机应用(如阿里钱盾)的服务器,服务器根据终端发送的这些数据,来判断拍摄对象是照片还是真人,从而判断用户的身份是否真实有效。
通过上述实施例,基于光学成像原理和现有手机的摄像头的成像原理推导出自动聚焦后的焦距,并根据该焦距得到手机摄像头与拍摄对象的距离,以此距离来判定拍摄对象是否为非常近距离,也即最终判定是否是真人拍半身照的所必须的最小距离,与现有技术中的识别翻拍照片的方法相比,该方案在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
实施例2
根据本申请实施例,还提供了一种拍摄对象的识别装置的实施例,如图8所示,该识别装置包括:启动模块20、获取模块40和判断模块60。
其中,启动模块20,用于当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦。
获取模块40,用于在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距。
判断模块60,用于基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
采用本申请实施例,利用终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象对焦成功后,基于拍摄设备对焦后的焦距判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
上述终端可以为个人计算机或移动终端,如手机、或平板电脑等具有拍摄功能的移动终端。可选地,本申请的方案可以通过具有定焦镜头的移动终端(如手机)来实现。
上述的对焦是指根据不同物体在镜头后部清晰成像的位置的不同而改变成像面与透镜之间的距离的操作方式,也即通过改变像距以改变所成图像的清晰度。
具体地,当需要用户拍摄照片的时候,启动终端的拍摄设备(如手机摄像头),利用拍摄设备的自动对焦功能,在拍摄设备的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像。由于照片的大小要远远小于真人的大小,因此在拍摄真人、翻拍照片的时候,如果想让终端上的成像照片大小接近,那么照片与拍摄设备的摄像头的距离要远远小于真人与摄像头的距离,反应在成像公式中,也即物距存在差异,因此可以利用这个距离的差异判断出拍摄设备的拍摄对象的对象类型为照片,还是真人。
可选地,上述的拍摄指令可以由服务器生成,也可以由终端生成。如,服务器在接收到终端发送的身份验证请求之后,生成该拍摄指令,以对该终端的使用者进行拍照;或者,用户通过操作终端上的拍摄设备的启动按钮,启动该拍摄设备,以对用户进行拍照,该操作可以为点击操作。
在一种可选的实施方案中,如图9所示,判断模块60包括:判断子模块601,用于基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;第一确定子模块603,用于若拍摄设备与拍摄对象的距离小于预设阈值,则确定拍摄对象的对象类型为照片。
具体地,当需要用户拍摄照片的时候,启动终端的拍摄设备,利用拍摄设备的自动对焦功能,在拍摄设备的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像,当拍摄设备对 拍摄对象对焦成功后,此时可以获得拍摄设备对焦后的焦距,该焦距与物距、和像距之间满足成像公式:1/u(物距)+1/v(像距)=1/f(焦距),因此,可以基于对焦后的焦距得出物距,并通过物距的大小判断出拍摄对象是照片,还是活体对象(真人)。
通过上述实施例,利用拍摄设备的自动对焦后的焦距,结合成像公式,可以得到拍摄设备与拍摄对象的距离,并根据该距离可以直接判断出拍摄对象的对象类别是否为照片,该实施方案的原理简单明了,且算法简单,容易实现。
在一种可选的实施方案中,如图10所示,判断模块60包括:判断子模块601,用于基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;获取子模块605,用于若拍摄设备与拍摄对象的距离小于预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;第一检测子模块607,用于检测图像数据中是否存在预先获取的翻拍照片特征;第二确定子模块609,用于若图像数据中存在预先获取的翻拍照片特征,则确定拍摄对象的对象类型为照片。
通过上述实施例,在判断出拍摄设备拍摄的图像数据中存在预先获取的翻拍照片特征的情况下,即可确定拍摄对象的对象类型为照片,该方案仅需要进行特征对比,不需要复杂的算法,因此简单、易实现。
在本申请的上述实施例中,如图11所示,判断子模块601包括:焦距判断子模块6011,用于判断对焦后的焦距是否在拍摄设备的指定变焦范围内,其中,指定变焦范围与预设阈值相对应;第三确定子模块6013,用于若对焦后的焦距在拍摄设备的指定变焦范围内,则判断出拍摄设备与拍摄对象的距离小于预设阈值。
上述的指定变焦范围是指当拍摄设备的摄像头后成清晰的像时,拍摄设备与拍摄活体之间的距离对应的自动对焦范围。
具体地,当需要用户拍摄照片的时候,用户点击拍摄按钮,启动终端(如手机)的摄像头,并在手机支持自动对焦功能的情况下,手机摄像头进入自动对焦模式,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到自动对焦的目的。由于对焦马达能移动的范围一般为几百微米,因此反应到摄像头的自动对焦范围非常有限。若手机软件返回的焦距在摄像头的指定变焦范围内,则对应拍摄设备与拍摄对象的距离小于预设阈值,也即此时的拍摄对象的对象类型为照片。
在本申请的上述实施例中,如图12所示,启动模块20包括:初始化子模块201,用于当接收到拍摄指令时,初始化终端的拍摄设备;第二检测子模块203,用于在初始 化拍摄设备完成之后,检测终端的拍摄设备是否支持自动对焦模式;启动子模块205,用于在检测出终端的拍摄设备支持自动对焦模式的情况下,启动拍摄设备的自动对焦模式,以使拍摄设备对拍摄对象进行自动对焦。
进一步地,如图13所示,第二检测子模块203包括:调取子模块2031,用于调取拍摄设备的对焦模式列表;标识信息检测子模块2033,用于若对焦模式列表中存在自动对焦模式的标识信息时,检测出终端的拍摄设备支持自动对焦模式。
具体地,当需要用户拍摄照片的时候,用户点击启动拍摄按钮,在手机应用中打开手机摄像头,并通过调用Camera.open()初始化摄像头。在摄像头初始化成功的情况下,判断手机是否支持自动对焦模式,判断的方式是调用Camear.Parameters.Get Supported Focus Modes(),这个方法返回一个列表(即上述的对焦模式列表),当返回的对焦模式列表中包含FOCUS_MODE_AUTO或FOCUS_MODE_MACRO(即上述的自动对焦模式的标识信息)时,则代表手机支持自动对焦模式。在手机支持自动对焦模式的情况下,启动手机的自动对焦模式,设置手机摄像头对焦模式参数为FOCUS_MODE_AUTO,调用的方法为Camear.Parameters.Set Focus Mode(FOCUS_MODE_AUTO),然后当对焦成功时,系统会自动调用回调函数cb,返回对焦后的焦距。
下面以淘宝开店身份认证的业务流程为例,详述本申请的上述实施例:
手机应用(比如阿里钱盾)提示用户拍摄人像照片,用户需要点击启动拍摄按钮;当用户在手机应用中打开手机摄像头时,安卓系统的接口开始初始化摄像头,在摄像头初始化成功的情况下,判断手机是否支持自动对焦模式,具体地,通过调取对焦模式列表,并在对焦模式列表中包含FOCUS_MODE_AUTO和FOCUS_MODE_MACRO这两种模式的情况下,确定手机支持自动对焦模式;在手机自动对焦成功后,系统则自动调用设置的对焦的回调函数,返回对焦后的焦距,用户点击拍照按钮,手机的摄像头采集到图像,手机终端生成对应于该图像的图像数据,该图像数据中包含有对焦后的焦距信息以及与焦距信息对应的物距信息,手机系统将生成的图像数据通过网络传输到手机应用(如阿里钱盾)的服务器,服务器根据终端发送的这些数据,来判断拍摄对象是照片还是真人,从而判断用户的身份是否真实有效。
在上述实施例中,利用安卓系统提供的获取摄像头自动对焦焦距的相关软件接口,返回手机的摄像头对焦后的焦距,根据该焦距可以实现对拍摄对象的对象类型的判断。上述实施例已在Samsung Galaxy Nexus手机中测试并成功实现。
需要说明的是,本申请的方案可以使用在安装有安卓操作系统的终端上,也可以使 用在安装有iOS操作系统,且具有在拍照时能够获取焦距的接口的终端上。
在安装有安卓操作系统的终端上,可以通过系统接口获取摄像头自动对焦焦距的信息。
通过上述实施例,基于光学成像原理和现有手机的摄像头的成像原理推导出自动聚焦后的焦距,并根据该焦距得到手机摄像头与拍摄对象的距离,以此距离来判定拍摄对象是否为非常近距离,也即最终判定是否是真人拍半身照的所必须的最小距离,与现有技术中的识别翻拍照片的方法相比,该方案在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
实施例3
根据本申请实施例,还提供了一种移动终端的实施例,该移动终端包括上述实施例2中的拍摄对象的识别装置。
具体地,如图14所示,该移动终端包括:拍摄设备50和处理器70。其中,拍摄设备50,用于当接收到拍摄指令时进行启动,并对拍摄对象进行自动对焦。处理器70,用于在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距,并基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
采用本申请实施例,利用移动终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象对焦成功后,基于拍摄设备对焦后的焦距通过处理器判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
上述的对焦是指根据不同物体在镜头后部清晰成像的位置的不同而改变成像面与透镜之间的距离的操作方式,也即通过改变像距以改变所成图像的清晰度。
具体地,当需要用户拍摄照片的时候,启动移动终端的拍摄设备(如手机摄像头),利用拍摄设备的自动对焦功能,在拍摄设备的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像。由于照片的大小要远远小于真人的大小,因此在拍摄真人、翻拍照片的时候,如果想让移动终端上的成像照片大小接近,那么照片与拍摄设备的摄像头的距离要远远小于真人与摄像头的距离,反应在成像公式中,也即物距存在差异,因此可以利用这个距 离的差异判断出拍摄设备的拍摄对象的对象类型为照片,还是真人。
实施例4
根据本申请实施例,还提供了一种照相机的实施例,该照相机包括上述实施例2中的拍摄对象的识别装置。
具体地,如图15所示,该照相机包括:摄像头80和处理器90。其中,摄像头80,用于当接收到拍摄指令时进行启动,并对拍摄对象进行自动对焦。处理器90,用于在摄像头对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距,并基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
采用本申请实施例,利用照相机的自动对焦功能,在照相机的摄像头对拍摄对象对焦成功后,基于摄像头对焦后的焦距通过处理器判断拍摄对象的对象类型是否为照片。通过上述实施例,利用照相机的摄像头自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在照相机本身的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的问题,以实现对翻拍照片的高效识别。
上述的对焦是指根据不同物体在镜头后部清晰成像的位置的不同而改变成像面与透镜之间的距离的操作方式,也即通过改变像距以改变所成图像的清晰度。
具体地,当需要用户拍摄照片的时候,启动照相机,利用照相机的自动对焦功能,在照相机的摄像头进入自动对焦模式的情况下,自动对焦的算法会驱动对焦马达前后移动影像传感器,来达到对焦的目的,以拍摄出清晰的图像。由于照片的大小要远远小于真人的大小,因此在拍摄真人、翻拍照片的时候,如果想让照相机上的成像照片大小接近,那么照片与摄像头的距离要远远小于真人与摄像头的距离,反应在成像公式中,也即物距存在差异,因此可以利用这个距离的差异判断出照相机的拍摄对象的对象类型为照片,还是真人。
实施例5
本申请的实施例可以提供一种计算机终端,该计算机终端可以是计算机终端群中的任意一个计算机终端设备。可选地,在本实施例中,上述计算机终端也可以替换为移动终端等终端设备。
可选地,在本实施例中,上述计算机终端可以位于计算机网络的多个网络设备中的至少一个网络设备。
在本实施例中,上述计算机终端可以执行拍摄对象的识别方法中以下步骤的程序代 码:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
可选地,图16是根据本申请实施例的一种计算机终端的结构框图。如图16所示,该计算机终端A可以包括:一个或多个(图中仅示出一个)处理器161、存储器163、以及传输装置165。
其中,存储器可用于存储软件程序以及模块,如本申请实施例中的拍摄对象的识别方法和装置对应的程序指令/模块,处理器通过运行存储在存储器内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的拍摄对象的识别方法。存储器可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至终端A。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
处理器可以通过传输装置调用存储器存储的信息及应用程序,以执行下述步骤:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
可选的,上述处理器还可以执行如下步骤:基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则确定拍摄对象的对象类型为照片。
可选的,上述处理器还可以执行如下步骤:基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;检测图像数据中是否存在预先获取的翻拍照片特征;若图像数据中存在预先获取的翻拍照片特征,则确定拍摄对象的对象类型为照片。
可选的,上述处理器还可以执行如下步骤:基于对焦后的焦距判断拍摄设备与拍摄 对象的距离是否小于预设阈值包括:判断对焦后的焦距是否在拍摄设备的指定变焦范围内,其中,指定变焦范围与预设阈值相对应;若对焦后的焦距在拍摄设备的指定变焦范围内,则判断出拍摄设备与拍摄对象的距离小于预设阈值。
可选的,上述处理器还可以执行如下步骤:启动终端的拍摄设备对拍摄对象进行自动对焦包括:当接收到拍摄指令时,初始化终端的拍摄设备;在初始化拍摄设备完成之后,检测终端的拍摄设备是否支持自动对焦模式;在检测出终端的拍摄设备支持自动对焦模式的情况下,启动拍摄设备的自动对焦模式,以使拍摄设备对拍摄对象进行自动对焦。
可选的,上述处理器还可以执行如下步骤:检测终端的拍摄设备是否支持自动对焦模式包括:调取拍摄设备的对焦模式列表;若对焦模式列表中存在自动对焦模式的标识信息时,检测出终端的拍摄设备支持自动对焦模式。
采用本申请实施例,利用终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象对焦成功后,基于拍摄设备对焦后的焦距判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的技术问题,以实现对翻拍照片的高效识别。
本领域普通技术人员可以理解,图16所示的结构仅为示意,计算机终端也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌声电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图16其并不对上述电子装置的结构造成限定。例如,计算机终端A还可包括比图16中所示更多或者更少的组件(如网络接口、显示装置等),或者具有与图16所示不同的配置。
本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令终端设备相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:闪存盘、只读存储器(Read-Only Memory,ROM)、随机存取器(Random Access Memory,RAM)、磁盘或光盘等。
实施例6
本申请的实施例还提供了一种存储介质。可选地,在本实施例中,上述存储介质可以用于保存上述实施例一所提供的拍摄对象的识别方法所执行的程序代码。
可选地,在本实施例中,上述存储介质可以位于计算机网络中计算机终端群中的任 意一个计算机终端中,或者位于移动终端群中的任意一个移动终端中。
可选地,在本实施例中,存储介质被设置为存储用于执行以下步骤的程序代码:当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;在拍摄设备对拍摄对象对焦成功后,获取拍摄设备的对焦后的焦距;基于对焦后的焦距判断拍摄对象的对象类型是否为照片。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则确定拍摄对象的对象类型为照片。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:基于对焦后的焦距判断拍摄对象的对象类型是否为照片包括:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值,其中,预设阈值用于表示拍摄设备拍摄活体对象所需的最小距离,其中,对象类型包括活体对象和照片;若拍摄设备与拍摄对象的距离小于预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;检测图像数据中是否存在预先获取的翻拍照片特征;若图像数据中存在预先获取的翻拍照片特征,则确定拍摄对象的对象类型为照片。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:基于对焦后的焦距判断拍摄设备与拍摄对象的距离是否小于预设阈值包括:判断对焦后的焦距是否在拍摄设备的指定变焦范围内,其中,指定变焦范围与预设阈值相对应;若对焦后的焦距在拍摄设备的指定变焦范围内,则判断出拍摄设备与拍摄对象的距离小于预设阈值。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:启动终端的拍摄设备对拍摄对象进行自动对焦包括:当接收到拍摄指令时,初始化终端的拍摄设备;在初始化拍摄设备完成之后,检测终端的拍摄设备是否支持自动对焦模式;在检测出终端的拍摄设备支持自动对焦模式的情况下,启动拍摄设备的自动对焦模式,以使拍摄设备对拍摄对象进行自动对焦。
可选地,存储介质还被设置为存储用于执行以下步骤的程序代码:检测终端的拍摄设备是否支持自动对焦模式包括:调取拍摄设备的对焦模式列表;若对焦模式列表中存在自动对焦模式的标识信息时,检测出终端的拍摄设备支持自动对焦模式。
采用本申请实施例,利用终端的拍摄设备的自动对焦功能,在拍摄设备对拍摄对象 对焦成功后,基于拍摄设备对焦后的焦距判断拍摄对象的对象类型是否为照片。通过上述实施例,利用拍摄设备的自动对焦后的焦距即可判断出拍摄对象的对象类型是否为照片,与现有技术中的识别翻拍照片的方法相比,在拍摄设备的基础上无需增加额外的硬件,且软件流程相对简单,简化了识别翻拍照片的过程,解决了现有技术中识别翻拍照片的方案复杂程度高的技术问题,以实现对翻拍照片的高效识别。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员 来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (14)

  1. 一种拍摄对象的识别方法,其特征在于,包括:
    当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;
    在所述拍摄设备对所述拍摄对象对焦成功后,获取所述拍摄设备的对焦后的焦距;
    基于所述对焦后的焦距判断所述拍摄对象的对象类型是否为照片。
  2. 根据权利要求1所述的识别方法,其特征在于,基于所述对焦后的焦距判断所述拍摄对象的对象类型是否为照片包括:
    基于所述对焦后的焦距判断所述拍摄设备与所述拍摄对象的距离是否小于预设阈值,其中,所述预设阈值用于表示所述拍摄设备拍摄活体对象所需的最小距离,其中,所述对象类型包括所述活体对象和所述照片;
    若所述拍摄设备与所述拍摄对象的距离小于所述预设阈值,则确定所述拍摄对象的对象类型为所述照片。
  3. 根据权利要求1所述的识别方法,其特征在于,基于所述对焦后的焦距判断所述拍摄对象的对象类型是否为照片包括:
    基于所述对焦后的焦距判断所述拍摄设备与所述拍摄对象的距离是否小于预设阈值,其中,所述预设阈值用于表示所述拍摄设备拍摄活体对象所需的最小距离,其中,所述对象类型包括所述活体对象和所述照片;
    若所述拍摄设备与所述拍摄对象的距离小于所述预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;
    检测所述图像数据中是否存在预先获取的翻拍照片特征;
    若所述图像数据中存在所述预先获取的翻拍照片特征,则确定所述拍摄对象的对象类型为所述照片。
  4. 根据权利要求2或3所述的识别方法,其特征在于,基于所述对焦后的焦距判断所述拍摄设备与所述拍摄对象的距离是否小于预设阈值包括:
    判断所述对焦后的焦距是否在所述拍摄设备的指定变焦范围内,其中,所述指定变焦范围与所述预设阈值相对应;
    若所述对焦后的焦距在所述拍摄设备的指定变焦范围内,则判断出所述拍摄设备与所述拍摄对象的距离小于所述预设阈值。
  5. 根据权利要求1至4中任意一项所述的识别方法,其特征在于,启动终端的拍摄设备对拍摄对象进行自动对焦包括:
    当接收到拍摄指令时,初始化所述终端的拍摄设备;
    在初始化所述拍摄设备完成之后,检测所述终端的拍摄设备是否支持自动对焦模式;
    在检测出所述终端的拍摄设备支持所述自动对焦模式的情况下,启动所述拍摄设备的自动对焦模式,以使所述拍摄设备对拍摄对象进行自动对焦。
  6. 根据权利要求5所述的识别方法,其特征在于,检测所述终端的拍摄设备是否支持自动对焦模式包括:
    调取所述拍摄设备的对焦模式列表;
    若所述对焦模式列表中存在自动对焦模式的标识信息时,检测出所述终端的拍摄设备支持所述自动对焦模式。
  7. 一种拍摄对象的识别装置,其特征在于,包括:
    启动模块,用于当接收到拍摄指令时,启动终端的拍摄设备对拍摄对象进行自动对焦;
    获取模块,用于在所述拍摄设备对所述拍摄对象对焦成功后,获取所述拍摄设备的对焦后的焦距;
    判断模块,用于基于所述对焦后的焦距判断所述拍摄对象的对象类型是否为照片。
  8. 根据权利要求7所述的识别装置,其特征在于,所述判断模块包括:
    判断子模块,用于基于所述对焦后的焦距判断所述拍摄设备与所述拍摄对象的距离是否小于预设阈值,其中,所述预设阈值用于表示所述拍摄设备拍摄活体对象所需的最小距离,其中,所述对象类型包括所述活体对象和所述照片;
    第一确定子模块,用于若所述拍摄设备与所述拍摄对象的距离小于所述预设阈值,则确定所述拍摄对象的对象类型为所述照片。
  9. 根据权利要求8所述的识别装置,其特征在于,所述判断模块包括:
    判断子模块,用于基于所述对焦后的焦距判断所述拍摄设备与所述拍摄对象的距离是否小于预设阈值,其中,所述预设阈值用于表示所述拍摄设备拍摄活体对象所需的最小距离,其中,所述对象类型包括所述活体对象和所述照片;
    获取子模块,用于若所述拍摄设备与所述拍摄对象的距离小于所述预设阈值,则获取基于拍摄指令生成的拍摄对象的图像数据;
    第一检测子模块,用于检测所述图像数据中是否存在预先获取的翻拍照片特征;
    第二确定子模块,用于若所述图像数据中存在所述预先获取的翻拍照片特征,则确 定所述拍摄对象的对象类型为所述照片。
  10. 根据权利要求8或9所述的识别装置,其特征在于,所述判断子模块包括:
    焦距判断子模块,用于判断所述对焦后的焦距是否在所述拍摄设备的指定变焦范围内,其中,所述指定变焦范围与所述预设阈值相对应;
    第三确定子模块,用于若所述对焦后的焦距在所述拍摄设备的指定变焦范围内,则判断出所述拍摄设备与所述拍摄对象的距离小于所述预设阈值。
  11. 根据权利要求7至10中任意一项所述的识别装置,其特征在于,所述启动模块包括:
    初始化子模块,用于当接收到拍摄指令时,初始化所述终端的拍摄设备;
    第二检测子模块,用于在初始化所述拍摄设备完成之后,检测所述终端的拍摄设备是否支持自动对焦模式;
    启动子模块,用于在检测出所述终端的拍摄设备支持所述自动对焦模式的情况下,启动所述拍摄设备的自动对焦模式,以使所述拍摄设备对拍摄对象进行自动对焦。
  12. 根据权利要求11所述的识别装置,其特征在于,所述第二检测子模块包括:
    调取子模块,用于调取所述拍摄设备的对焦模式列表;
    标识信息检测子模块,用于若所述对焦模式列表中存在自动对焦模式的标识信息时,检测出所述终端的拍摄设备支持所述自动对焦模式。
  13. 一种移动终端,其特征在于,包括:权利要求7至12中任意一项所述的拍摄对象的识别装置。
  14. 一种照相机,其特征在于,包括:权利要求7至12中任意一项所述的拍摄对象的识别装置。
PCT/CN2017/073582 2016-02-26 2017-02-15 拍摄对象的识别方法、装置、移动终端和照相机 WO2017143933A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
JP2018544870A JP7109368B2 (ja) 2016-02-26 2017-02-15 被撮影物体の認識方法、装置、携帯端末及びカメラ
EP17755762.6A EP3422698B1 (en) 2016-02-26 2017-02-15 Method, device, mobile terminal, and camera for identifying photograph subject
KR1020187024358A KR20180116286A (ko) 2016-02-26 2017-02-15 피사체 인식 방법, 장치, 모바일 단말기 및 카메라
US16/112,240 US11050920B2 (en) 2016-02-26 2018-08-24 Photographed object recognition method, apparatus, mobile terminal and camera

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610109132.7A CN107135348A (zh) 2016-02-26 2016-02-26 拍摄对象的识别方法、装置、移动终端和照相机
CN201610109132.7 2016-02-26

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/112,240 Continuation US11050920B2 (en) 2016-02-26 2018-08-24 Photographed object recognition method, apparatus, mobile terminal and camera

Publications (1)

Publication Number Publication Date
WO2017143933A1 true WO2017143933A1 (zh) 2017-08-31

Family

ID=59685795

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/073582 WO2017143933A1 (zh) 2016-02-26 2017-02-15 拍摄对象的识别方法、装置、移动终端和照相机

Country Status (7)

Country Link
US (1) US11050920B2 (zh)
EP (1) EP3422698B1 (zh)
JP (1) JP7109368B2 (zh)
KR (1) KR20180116286A (zh)
CN (1) CN107135348A (zh)
TW (1) TWI752937B (zh)
WO (1) WO2017143933A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020098291A (ja) * 2018-12-19 2020-06-25 カシオ計算機株式会社 表示装置、表示方法およびプログラム
CN115499581A (zh) * 2022-08-16 2022-12-20 北京五八信息技术有限公司 一种拍摄方法、装置、终端设备及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106871906B (zh) * 2017-03-03 2020-08-28 西南大学 一种盲人导航方法、装置及终端设备
CN109583287B (zh) * 2017-09-29 2024-04-12 浙江莲荷科技有限公司 实物识别方法及验证方法
CN107491775A (zh) * 2017-10-13 2017-12-19 理光图像技术(上海)有限公司 人脸活体检测方法、装置、存储介质及设备
CN111460859A (zh) * 2019-01-21 2020-07-28 北京京东尚科信息技术有限公司 用户识别方法、装置、电子设备及计算机可读介质
US20230012098A1 (en) * 2019-12-20 2023-01-12 Inventio Ag Building system for private user communication
CN116264601A (zh) * 2021-12-15 2023-06-16 广州视源电子科技股份有限公司 高拍仪对焦方法、装置、高拍仪和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968357A (zh) * 2005-11-14 2007-05-23 欧姆龙株式会社 认证装置和认证方法
CN104767937A (zh) * 2015-03-27 2015-07-08 深圳市艾优尼科技有限公司 一种拍照方法
CN105117729A (zh) * 2015-05-11 2015-12-02 杭州金培科技有限公司 一种识别翻拍图像的方法和装置

Family Cites Families (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4085470B2 (ja) * 1998-05-29 2008-05-14 オムロン株式会社 個人識別装置、個人識別方法および個人識別プログラムを記録した記録媒体
JP2005269604A (ja) * 2004-02-20 2005-09-29 Fuji Photo Film Co Ltd 撮像装置、撮像方法、及び撮像プログラム
JP4734980B2 (ja) * 2005-03-15 2011-07-27 オムロン株式会社 顔認証装置およびその制御方法、顔認証装置を備えた電子機器、顔認証装置制御プログラム、ならびに該プログラムを記録した記録媒体
JP4793179B2 (ja) * 2005-11-14 2011-10-12 オムロン株式会社 認証装置及び携帯端末
JP5076563B2 (ja) * 2006-03-14 2012-11-21 オムロン株式会社 顔照合装置
JP4747894B2 (ja) * 2006-03-15 2011-08-17 オムロン株式会社 認証装置、認証方法、認証プログラムおよびコンピュータ読み取り可能な記録媒体
JP4624947B2 (ja) * 2006-03-22 2011-02-02 富士フイルム株式会社 画像のトリミング方法および装置並びにプログラム
JP2008283258A (ja) * 2007-05-08 2008-11-20 Nikon Corp 電子カメラおよび情報処理システム
JP2009187130A (ja) * 2008-02-04 2009-08-20 Panasonic Electric Works Co Ltd 顔認証装置
JP5582743B2 (ja) * 2009-08-07 2014-09-03 キヤノン株式会社 撮像装置及び撮像装置の制御方法
KR20110029002A (ko) * 2009-09-14 2011-03-22 삼성전자주식회사 얼굴 판단 장치 및 방법
US8675926B2 (en) * 2010-06-08 2014-03-18 Microsoft Corporation Distinguishing live faces from flat surfaces
TWI502980B (zh) * 2011-06-10 2015-10-01 Htc Corp 以物件偵測技術為基礎之影像擷取方法及系統,及其電腦程式產品
US9082235B2 (en) * 2011-07-12 2015-07-14 Microsoft Technology Licensing, Llc Using facial data for device authentication or subject identification
DE102011054658A1 (de) 2011-10-20 2013-04-25 Bioid Ag Verfahren zur Unterscheidung zwischen einem realen Gesicht und einer zweidimensionalen Abbildung des Gesichts in einem biometrischen Erfassungsprozess
EP2713307B1 (en) * 2012-09-28 2018-05-16 Accenture Global Services Limited Liveness detection
US9058519B2 (en) * 2012-12-17 2015-06-16 Qualcomm Incorporated System and method for passive live person verification using real-time eye reflection
US20140270404A1 (en) * 2013-03-15 2014-09-18 Eyelock, Inc. Efficient prevention of fraud
JP2015173327A (ja) * 2014-03-11 2015-10-01 ソニー株式会社 撮像装置、投光装置、およびビームライト制御方法、並びにプログラム
IL231789A0 (en) * 2014-03-27 2014-08-31 Fst21 Ltd System and method for detecting fraud attempts of an access control system
US9679212B2 (en) * 2014-05-09 2017-06-13 Samsung Electronics Co., Ltd. Liveness testing methods and apparatuses and image processing methods and apparatuses
TWI530747B (zh) * 2014-05-13 2016-04-21 宏碁股份有限公司 可攜式電子裝置以及影像擷取方法
US9786030B1 (en) * 2014-06-16 2017-10-10 Google Inc. Providing focal length adjustments
US9396537B2 (en) 2014-09-09 2016-07-19 EyeVerify, Inc. Systems and methods for liveness analysis
CN104613930B (zh) * 2015-01-04 2017-05-17 宇龙计算机通信科技(深圳)有限公司 一种测距的方法、装置及移动终端
US10678897B2 (en) * 2015-04-16 2020-06-09 Tobii Ab Identification, authentication, and/or guiding of a user using gaze information
CN104931957B (zh) * 2015-06-01 2018-05-11 广东欧珀移动通信有限公司 一种基于移动终端的测距方法和装置
MY182294A (en) * 2015-06-16 2021-01-18 Eyeverify Inc Systems and methods for spoof detection and liveness analysis
JP2019522949A (ja) * 2016-07-05 2019-08-15 ウー・イーチェンWu, Yecheng ライブ画像キャプチャ中のなりすまし攻撃検出

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1968357A (zh) * 2005-11-14 2007-05-23 欧姆龙株式会社 认证装置和认证方法
CN104767937A (zh) * 2015-03-27 2015-07-08 深圳市艾优尼科技有限公司 一种拍照方法
CN105117729A (zh) * 2015-05-11 2015-12-02 杭州金培科技有限公司 一种识别翻拍图像的方法和装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3422698A4 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020098291A (ja) * 2018-12-19 2020-06-25 カシオ計算機株式会社 表示装置、表示方法およびプログラム
CN115499581A (zh) * 2022-08-16 2022-12-20 北京五八信息技术有限公司 一种拍摄方法、装置、终端设备及存储介质
CN115499581B (zh) * 2022-08-16 2023-11-21 北京五八信息技术有限公司 一种拍摄方法、装置、终端设备及存储介质

Also Published As

Publication number Publication date
US11050920B2 (en) 2021-06-29
JP7109368B2 (ja) 2022-07-29
KR20180116286A (ko) 2018-10-24
EP3422698A4 (en) 2019-08-21
EP3422698A1 (en) 2019-01-02
TW201734889A (zh) 2017-10-01
JP2019515519A (ja) 2019-06-06
CN107135348A (zh) 2017-09-05
US20180367727A1 (en) 2018-12-20
EP3422698B1 (en) 2024-03-27
TWI752937B (zh) 2022-01-21

Similar Documents

Publication Publication Date Title
WO2017143933A1 (zh) 拍摄对象的识别方法、装置、移动终端和照相机
JP7026225B2 (ja) 生体検出方法、装置及びシステム、電子機器並びに記憶媒体
CN103795934B (zh) 一种图像处理方法及电子设备
WO2017008353A1 (zh) 一种拍摄方法及用户终端
CN105868677B (zh) 一种活体人脸检测方法及装置
ES2768252T3 (es) Aparato y procedimiento de reconocimiento de imagen
TW202109358A (zh) 活體檢測方法、電子設備和儲存介質
CN109409895A (zh) 一种融合虹膜识别和人脸识别的支付装置及支付方法
CN108510274B (zh) 一种可视觉识别图像及二维码结合验证的方法、装置
JP2019515519A5 (zh)
TW200822715A (en) Imaging apparatus, control method of imaging apparatus, and computer program
KR101534808B1 (ko) 얼굴 인식 기술을 이용한 전자 앨범 관리 방법 및 시스템
CN107657245A (zh) 一种人脸识别方法和终端设备
TWI752105B (zh) 特徵圖像的獲取方法及獲取裝置、使用者認證方法
CN206595991U (zh) 一种双摄像头移动终端
EP3979629A1 (en) Image processing method and apparatus based on video conference
WO2017219515A1 (zh) 一种拍照对焦的方法及电子设备
CN106954019A (zh) 智能调整拍摄位置的方法及智能拍摄设备
JP4747894B2 (ja) 認証装置、認証方法、認証プログラムおよびコンピュータ読み取り可能な記録媒体
WO2009110323A1 (ja) 生体判定システム、生体判定方法および生体判定用プログラム
JP2011009898A (ja) 画像配布システム、撮像装置、受信装置、サーバ
JP7509995B2 (ja) オブジェクト撮影装置およびオブジェクト撮影方法
JP2007249530A (ja) 認証装置、認証方法および認証プログラム
TWM419956U (en) Ultra-wide-angle camera with function of intelligent identification
JP2019186914A (ja) 通信端末、通信システム、通信方法、及びプログラム

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 20187024358

Country of ref document: KR

Kind code of ref document: A

ENP Entry into the national phase

Ref document number: 2018544870

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2017755762

Country of ref document: EP

ENP Entry into the national phase

Ref document number: 2017755762

Country of ref document: EP

Effective date: 20180926

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17755762

Country of ref document: EP

Kind code of ref document: A1