CN109118448A - It takes pictures processing method, device and electronic equipment - Google Patents

It takes pictures processing method, device and electronic equipment Download PDF

Info

Publication number
CN109118448A
CN109118448A CN201810875963.4A CN201810875963A CN109118448A CN 109118448 A CN109118448 A CN 109118448A CN 201810875963 A CN201810875963 A CN 201810875963A CN 109118448 A CN109118448 A CN 109118448A
Authority
CN
China
Prior art keywords
image
anything
photographing module
target
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810875963.4A
Other languages
Chinese (zh)
Inventor
王春雷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
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 Beijing Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201810875963.4A priority Critical patent/CN109118448A/en
Publication of CN109118448A publication Critical patent/CN109118448A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • 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/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • G06V40/165Detection; Localisation; Normalisation using facial parts and geometric relationships
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30168Image quality inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Signal Processing (AREA)
  • Geometry (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Image Processing (AREA)

Abstract

The present invention relates to field of photographing technology, take pictures processing method, device and electronic equipment in particular to one kind.The processing method of taking pictures, comprising: monitor to operate in apply attending to anything else in sandbox and the photographing module in electronic equipment whether is called to carry out image taking;If attending to anything else described in listening to using calling the photographing module to carry out image taking, then the first image applied and call the photographing module shooting of attending to anything else described in interception;The first image is handled, the second image is obtained;Second image is sent to the application of attending to anything else, so that the application of attending to anything else is shown second image.Processing method of taking pictures, device and the electronic equipment that the present invention discloses embodiment offer can be improved the picture quality of image captured by the photographing module in the application call electronic equipment with camera function.

Description

It takes pictures processing method, device and electronic equipment
Technical field
The present invention relates to field of photographing technology, take pictures processing method, device and electronic equipment in particular to one kind.
Background technique
With the development of science and technology, electronic equipment of the more and more users using included camera function, such as mobile phone peace Plate computer, user can take pictures whenever and wherever possible.The application program with camera function based on this, applied to electronic equipment Also it emerges one after another.
Currently, the application program with camera function when shooting image, is all the photographing module called in electronic equipment It takes pictures.And the preset function of application program with camera function is all relatively simple, user can only be helped simply to record Image in life, and the problems such as due to shooting angle, shooting environmental, second-rate image may be taken.So such as Manage the technical problem that second-rate image is current urgent need to resolve in where.
Summary of the invention
In view of this, take pictures processing method, device and the electronics of one kind that be designed to provide that the present invention discloses embodiment is set It is standby, to be effectively improved the above problem.
Processing method provided in an embodiment of the present invention of taking pictures, comprising:
Whether monitor to operate in apply attending to anything else in sandbox calls the photographing module in electronic equipment to carry out image taking;
Image taking is carried out using the calling photographing module if attending to anything else described in listening to, then application of attending to anything else described in interception Call the first image of the photographing module shooting;
The first image is handled, the second image is obtained;
Second image is sent to the application of attending to anything else, so that second image is opened up in the application of attending to anything else Show.
Further, described that the first image is handled, obtain the second image, comprising:
Target image is chosen from the pattern library of the photographing module;
The first image is replaced using the target image, and using replaced image as second figure Picture.
It is further, described to choose target image from the pattern library of the photographing module, comprising:
The maximum image of similarity with the first image is chosen from the pattern library of the photographing module, as Target image.
Further, described to be chosen from the pattern library of the photographing module with the similarity of the first image most Big image, as target image, comprising:
Feature identification is carried out to the first image, to obtain the fisrt feature collection of the first image;
Feature identification is carried out to each image in the pattern library of the photographing module, it is special with obtain each image second Collection;
Calculate separately the second feature collection and the fisrt feature collection of each image in the pattern library of the photographing module Similarity;
Using image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection as target image.
Further, described to be chosen from the pattern library of the photographing module with the similarity of the first image most Big image, as target image, further includes:
Quality coefficient assessment is carried out to image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection;
If quality coefficient assessment result reaches preset requirement, execution will be maximum with the similarity of the fisrt feature collection The step of corresponding image of second feature collection is as target image.
It is further, described to choose target image from the pattern library of the photographing module, comprising:
The image different from the picture material of the first image is chosen from the pattern library of the photographing module, is made For target image.
Further, the picture material chosen from the pattern library of the photographing module with the first image Different image, as target image, comprising:
One is randomly selected from the pattern library of the photographing module to contrast images;
It is compared described to the picture material of hard image and the picture material of the first image, described in judgement Whether the picture material to contrast images is different from the picture material of the first image;
If the picture material to contrast images is different from the picture material of the first image, by described wait compare Image is determined as the target image.
Further, described the first image to be replaced using the target image, and by replaced image As second image, comprising:
The first image is split, area image to be replaced is obtained and retains area image;
The target image is split, target area image is obtained;
The area image to be replaced is replaced using the target area image, obtaining includes the target area Image and second image for retaining area image.
Further, described that the first image is handled, obtain the second image, comprising:
Landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, as the second image.
Further, described that landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, As the second image, comprising:
When the first image is character image, the portrait area for including in the character image is determined, and from described Locating human face's image in portrait area;
U.S. face processing is carried out to the facial image.
It is further, described that U.S. face processing is carried out to the facial image, comprising:
Determine the personal characteristics of the facial image;
It chooses U.S. face corresponding with the personal characteristics and handles logic;
U.S. face processing is carried out to the facial image according to the U.S. face processing logic of selection.
Further, described that landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, As the second image, further includes:
When the first image is character image, the non-portrait area that the character image includes is determined;
Processing is optimized to the picture quality of the non-portrait area.
Further, described that landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, As the second image, further includes:
The picture quality of the non-portrait area is assessed;
If quality coefficient assessment result is not up to preset requirement, executes and the picture quality of the non-portrait area is carried out The step of optimization processing.
Further, described that landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, As the second image, comprising:
When the first image is non-character image, processing is optimized to the picture quality of the first image.
Further, described that landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, As the second image, further includes:
Quality coefficient is carried out to the first image to assess;
If quality coefficient assessment result is not up to preset requirement, the picture quality progress executed to the first image is excellent The step of changing processing.
Further, described that the first image is handled, before obtaining the second image, the method also includes:
To it is described attend to anything else using send image processing requests so that it is described attend to anything else using according to described image handle request or The instruction of user's triggering generates request and generates process instruction, and returns;
Attend to anything else described in reception using return process instruction, with according to the process instruction execute to the first image into The step of row processing, the second image of acquisition.
Further, the monitoring operate in sandbox attending to anything else using whether call photographing module in electronic equipment into Row image taking, comprising:
By Hook Function monitor described in attend to anything else using whether using image taking instruction calling the photographing module;
Attend to anything else described in being listened to when the Hook Function and calls the photographing module using using described image shooting instruction When, expression listens to described attend to anything else using the calling photographing module progress image taking.
Processing unit provided in an embodiment of the present invention of taking pictures, comprising:
Attend to anything else using module is monitored, applies whether call taking the photograph in electronic equipment attending to anything else in sandbox for monitoring to operate in As module carries out image taking;
Image blocking module, for when listening to described attend to anything else using calling the photographing module to carry out image taking, Attend to anything else described in then intercepting using the first image for calling the photographing module shooting;
Image processing module obtains the second image for handling the first image;
Image sending module, for second image to be sent to the application of attending to anything else, so that the application pair of attending to anything else Second image is shown.
Further, described image processing module, comprising:
Target image chooses submodule, for choosing target image from the pattern library of the photographing module;
First image procossing submodule for being replaced using the target image to the first image, and will replace Image after changing is as second image.
Further, the target image chooses submodule, comprising:
First object image selection unit, for being chosen and first figure from the pattern library of the photographing module The maximum image of the similarity of picture, as target image.
Further, the first object image is chosen single, as target image, comprising:
Fisrt feature collection chooses subelement, for carrying out feature identification to the first image, to obtain first figure The fisrt feature collection of picture;
Second feature collection chooses subelement, carries out feature for each image in the pattern library to the photographing module Identification, to obtain the second feature collection of each image;
Similarity calculation subelement, the second of each image is special in the pattern library for calculating separately the photographing module The similarity of collection and the fisrt feature collection;
First object image determines subelement, for by with the maximum second feature collection of the similarity of the fisrt feature collection Corresponding image is as target image.
Further, the first object image selection unit, further includes:
First quality coefficient assess subelement, for the maximum second feature collection of the similarity of the fisrt feature collection Corresponding image carries out quality coefficient assessment;
First assessment result judgment sub-unit, for when quality coefficient assessment result reaches preset requirement, making described One target image determines that subelement is then executed figure corresponding with the maximum second feature collection of the similarity of the fisrt feature collection As the movement as target image.
Further, the target image chooses submodule, comprising:
Second target image selection unit, for being chosen and first figure from the pattern library of the photographing module The different image of the picture material of picture, as target image.
Further, the second target image selection unit, comprising:
Subelement is chosen to contrast images, for randomly selecting one from the pattern library of the photographing module to right Compare image;
Picture material contrast subunit, for by the image of the picture material to hard image and the first image Content compares, to judge whether the picture material to contrast images is different from the picture material of the first image;
Second target image determines subelement, in the picture material to contrast images and the first image When picture material difference, then it is determined as the target image to contrast images for described.
Further, the first image handles submodule, comprising:
First image segmentation unit obtains area image to be replaced and reservation for being split to the first image Area image;
Second image segmentation unit obtains target area image for being split to the target image;
Image replacing unit is obtained for being replaced using the target area image to the area image to be replaced It obtains including the target area image and second image for retaining area image.
Further, described image processing module, comprising:
Second image procossing submodule, for carrying out landscaping treatment to the first image, by the institute Jing Guo landscaping treatment The first image is stated, as the second image.
Further, the second image procossing submodule, comprising:
Facial image positioning unit, for determining and being wrapped in the character image when the first image is character image The portrait area included, and locating human face's image from the portrait area;
U.S. face processing unit, for carrying out U.S. face processing to the facial image.
Further, the U.S. face processing unit, comprising:
Personal characteristics determines subelement, for determining the personal characteristics of the facial image;
U.S. face processing logic chooses subelement, handles logic for choosing U.S. face corresponding with the personal characteristics;
U.S. face handles subelement, for being carried out at U.S. face according to the U.S. face processing logic of selection to the facial image Reason.
Further, the second image procossing submodule, further includes:
Non- portrait area determines subelement, for determining the character image when the first image is character image Including non-portrait area;
First image quality optimization subelement optimizes processing for the picture quality to the non-portrait area.
Further, the second image procossing submodule, further includes:
Second quality coefficient assesses subelement, assesses for the picture quality to the non-portrait area;
Second assessment result judgment sub-unit makes described for being not up to preset requirement in quality coefficient assessment result The step of execution of one image quality optimization subelement optimizes processing to the picture quality of the non-portrait area.
Further, the second image procossing submodule, comprising:
Image quality optimization unit is used for when the first image is non-character image, to the figure of the first image Image quality amount optimizes processing.
Further, the second image procossing submodule, further includes:
Quality coefficient assessment unit is assessed for carrying out quality coefficient to the first image;
Assessment result judging unit makes described image quality for being not up to preset requirement in quality coefficient assessment result The step of optimization unit execution optimizes processing to the picture quality of the first image.
Further, the processing unit of taking pictures, further includes:
Image processing requests sending module, for attending to anything else to described using image processing requests are sent, so that described attend to anything else Process instruction is generated using the instruction generation request for handling request or user's triggering according to described image, and is returned;
Process instruction receiving module, for receiving the process instruction attended to anything else using return, so that described image is handled Module is handled the first image according to process instruction execution, obtains the movement of the second image.
It is further, described to attend to anything else using monitoring module, comprising:
Attend to anything else using monitoring submodule, whether is referred to using image taking for application of attending to anything else described in being monitored by Hook Function It enables and calls the photographing module;
Acquisition, which acts, determines submodule, for when the Hook Function listen to it is described attend to anything else clapped using using described image When taking the photograph instruction and calling the photographing module, expression listens to described attend to anything else using calling the photographing module to carry out image taking.
Electronic equipment provided in an embodiment of the present invention, including processor, memory and above-mentioned processing unit of taking pictures, the bat It include one or more software function modules for being stored in the memory and being executed by the processor according to processing unit.
The embodiment of the invention also provides a kind of computer readable storage mediums, are stored thereon with computer program, special Sign is that the computer program is performed, it can be achieved that above-mentioned processing method of taking pictures.
The present invention discloses processing method of taking pictures, device and the electronic equipment of embodiment offer, operates in sandbox listening to In attend to anything else using call photographing module carry out image taking when, can intercept attend to anything else using call photographing module shooting first Image obtains the second image, and the second image is sent to application of attending to anything else, answers so as to attend to anything else to handle the first image It is shown with to the second image.In this way, even attending to anything else using ropy image (for example, first image) is had taken, lead to First image can also be intercepted by crossing the processing method and processing device of taking pictures of the invention for disclosing embodiment offer, will not be directly by first Image, which is sent to, attends to anything else using displaying, but is handled it to obtain the preferable image of quality (for example, second image), then It is sent to and attends to anything else using displaying.So processing method of taking pictures, device and electronic equipment that the present invention discloses embodiment offer can Improve the picture quality of image captured by the photographing module in the application call electronic equipment with camera function.
The above description is only an overview of the technical scheme of the present invention, in order to better understand the technical means of the present invention, And it can be implemented in accordance with the contents of the specification, and in order to allow above and other objects of the present invention, feature and advantage can It is clearer and more comprehensible, the followings are specific embodiments of the present invention.
Detailed description of the invention
The technical solution that embodiment is disclosed in order to illustrate more clearly of the present invention, below will be to use required in embodiment Attached drawing be briefly described, it should be understood that the following drawings illustrates only some embodiments of the disclosure, therefore is not to be seen as It is the restriction to range, it for those of ordinary skill in the art, without creative efforts, can be with root Other relevant attached drawings are obtained according to these attached drawings.
Fig. 1 is the schematic block diagram of electronic equipment provided in an embodiment of the present invention.
Fig. 2 is the flow diagram of processing method provided in an embodiment of the present invention of taking pictures.
Fig. 3 is the seed step flow diagram of step S300 in processing method of taking pictures shown in Fig. 2.
Fig. 4 is the schematic block diagram of processing unit provided in an embodiment of the present invention of taking pictures.
Icon: 100- electronic equipment;110- takes pictures processing unit;111- attends to anything else using monitoring module;112- image intercepts Module;113- image processing module;114- image sending module;120- processor;130- memory.
Specific embodiment
The attached drawing in embodiment is disclosed below in conjunction with the present invention, the technical solution in embodiment is disclosed to the present invention and is carried out It clearly and completely describes, it is clear that described embodiment is only disclosure a part of the embodiment, rather than whole implementation Example.The component that the present invention being usually described and illustrated herein in the accompanying drawings discloses embodiment can carry out cloth with a variety of different configurations It sets and designs.Therefore, requirement is not intended to limit to the detailed description of the embodiment of the disclosure provided in the accompanying drawings below to protect The scope of the present disclosure of shield, but it is merely representative of the selected embodiment of the disclosure.Based on embodiment of the disclosure, art technology Personnel's every other embodiment obtained without making creative work belongs to the model of disclosure protection It encloses.
It should also be noted that similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined in a attached drawing, does not then need that it is further defined and explained in subsequent attached drawing.
Referring to Fig. 1, taking pictures the electronic equipment 100 of processing method and processing device for a kind of application provided in an embodiment of the present invention Schematic block diagram.Wherein, electronic equipment 100 may be, but not limited to, mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant) etc..Further, in the embodiment of the present invention, which includes clapping According to processing unit 110, processor 120 and memory 130.
It is directly or indirectly electrically connected between processor 120 and memory 130, to realize the transmission or interaction of data, It is electrically connected for example, these elements can be realized between each other by one or more communication bus or signal wire.Processing of taking pictures fills Setting 110 includes that at least one can store in memory 130 or be solidificated in electronics in the form of software or firmware (Firmware) Software module in the operating system (Operating System, OS) of equipment 100.Processor 120 is for executing memory 130 The executable module of middle storage, for example, take pictures software function module included by processing unit 110 and computer program etc..Place Reason device 120 can execute computer program after receiving and executing instruction.
Wherein, processor 120 can be a kind of IC chip, have signal handling capacity.Processor 120 can also be with It is general processor, for example, it may be digital signal processor (DSP), specific integrated circuit (ASIC), discrete gate or transistor Logical device, discrete hardware components may be implemented or execute disclosed each method, step and logic in the embodiment of the present invention Block diagram.In addition, general processor can be microprocessor or any conventional processors etc..
Memory 130 may be, but not limited to, random access memory (Random Access Memory, RAM), only It reads memory (Read Only Memory, ROM), programmable read only memory (Programmable Read-Only Memory, PROM), erasable programmable read only memory (Erasable Programmable Read-Only Memory, EPROM), electrically erasable programming read-only memory Electric Erasable Programmable Read-Only Memory, EEPROM) etc..For memory 130 for storing program, processor 120 executes the program after receiving and executing instruction.
It should be appreciated that structure shown in FIG. 1 is only to illustrate, electronic equipment 100 provided in an embodiment of the present invention can also have There is component more less or more than Fig. 1, or with the configuration different from shown in Fig. 1.In addition, each component shown in FIG. 1 can be with It is realized by software, hardware or combinations thereof.
Referring to Fig. 2, Fig. 2 is the flow diagram of processing method provided in an embodiment of the present invention of taking pictures, the processing of taking pictures Method is applied to electronic equipment shown in FIG. 1, carries out below with reference to detailed process and step of the Fig. 2 to the processing method of taking pictures detailed It is thin to illustrate.It should be noted that the implementation process of processing method provided in an embodiment of the present invention of taking pictures is realized in sandbox 's.
Whether step S100 monitors to operate in apply attending to anything else in sandbox and calls the photographing module in electronic equipment to carry out figure As shooting.
Sandbox, which is one, allows to run browser or other applications in its environment (for example, monitored attending to anything else is answered With) virtual system program.Attend to anything else attending to anything else using the native applications program for being then mounted to electronic equipment, is to utilize skill of attending to anything else Art attends to anything else to native applications program, and the institute for having native applications program is functional, is capable of providing and native applications journey The identical service of sequence.In the embodiment of the present invention, attending to anything else to apply can be QQ, wechat, follows closely nail, the communication of 263 clouds etc. and can adjust The application program taken pictures with the photographing module in electronic equipment is attended to anything else.
Whether, in actual implementation, sandbox can use Hook Function and monitor application of attending to anything else, attend to anything else to apply with judgement and call Photographing module in electronic equipment carries out image taking.
Herein, term " hook " cover for by intercept transmitted between component software function call, message or Event changes or increases the technology of the behavior of operating system, application program or other software component, and handles this intercepted Function call, event or message code be thus referred to as Hook Function, i.e. hook function.Hook is commonly used in various targets, Including debug and be extended function to function, example may include being transmitted to target in keyboard or mouse event to answer They or hooking system service call (system call), system function behavior, function implementing result etc. are intercepted before with program, with Monitor or modify application program or the function of other assemblies etc..
Further, in the embodiment of the present invention, it can be monitored by Hook Function and attend to anything else to apply whether utilize image taking The photographing module in electronic equipment is called in instruction, calls camera shooting using using image taking instruction when Hook Function listens to attend to anything else When module, expression, which listens to attend to anything else, carries out image taking using calling photographing module.Wherein, image taking instruction can be camera shooting Jni method corresponding with taking pictures, specially android.hardware.Camera method native_ in module takePicture。
Step S200 attends to anything else if listening to using calling photographing module to carry out image taking, then intercepts to attend to anything else to apply and adjust The first image shot with photographing module.
In actual implementation, it again may be by Hook Function interception and attend to anything else using calling photographing module progress image taking The first captured image.For example, can be taken over by callback interface of the Hook Function to photographing module, so that sandbox can It, specifically, can be with so as to intercept the first image captured by photographing module to obtain the administration authority to photographing module Callback interface mJpegCallback is modified into MyPictureCallback.Hereafter, by photographing module the first image collected It calls to sandbox, specific code is accomplished by
MyPictureCallback onPicture Taken (byte [] data, Camera camera), wherein data Array is the first image.
Step S300 handles the first image, obtains the second image.
First image is to attend to anything else to carry out image captured by image taking using the photographing module called in electronic equipment, by In the shooting angle, shooting environmental the problems such as, the quality of the first image may be poor, therefore, can after handling the first image To obtain preferable second image of quality.
In actual implementation, it can use other images and the first image line replaced, and using replaced image as Two images directly can also carry out quality optimization processing to the first image, and will be by quality optimization treated the first image As the second image.
Therefore, incorporated by reference to Fig. 3, in the embodiment of the present invention, as the first embodiment, step S300 may include step Two sub-steps of S310 and step S320.
Step S310 chooses target image from the pattern library of photographing module.
The image stored in the pattern library of photographing module includes all application programs (packet applied to the electronic equipment Include monitored application of attending to anything else) call history image captured by the photographing module.In the embodiment of the present invention, from photographing module The target image chosen in pattern library may include, but be not limited to image similar with the first image, and with the first figure The different image etc. of the picture material of picture.
Based on above description, step S310 can be specifically, choose and the first figure from the pattern library of photographing module The maximum image of the similarity of picture, as target image.
To realize above scheme, it is possible, firstly, to feature identification is carried out to the first image, it is special with obtain the first image first Collection.For example, can to the first image carry out edge detection, according to the edge of closure determine the first image at least one first Characteristic area, the fisrt feature collection as the first image.In addition, being carried out to each image in the pattern library of photographing module special Sign identification, to obtain the second feature collection of each image.Equally, each image being directed in pattern library, can be to the image Edge detection is carried out, determines at least one second feature region of the image according to the edge of closure, second as the image Feature set.The second feature collection of each image in the pattern library of the fisrt feature collection and photographing module that obtain the first image Afterwards, the second feature collection of each image in the pattern library of photographing module and the similarity of fisrt feature collection are calculated separately, it will be with The corresponding image of the maximum second feature collection of the similarity of fisrt feature collection is as target image.
Further, it when it includes a fisrt feature region that fisrt feature, which is concentrated, calculates separately each in pattern library The second feature of image concentrates the similarity in each the second feature region and fisrt feature region that include, determining and fisrt feature area The maximum second feature region of the similarity in domain, and image corresponding with second feature collection belonging to the second feature region is made For target image.When it includes multiple fisrt feature regions that fisrt feature, which is concentrated, it is directed in the pattern library of photographing module Each image, the second feature of the image is concentrated into each second feature region for including respectively and that fisrt feature concentration includes is each Fisrt feature region carries out similarity mode, to determine that the second feature of the image concentrates the with each fisrt feature Region Matching Two characteristic areas, then be directed to fisrt feature concentrate include each fisrt feature region, calculate the fisrt feature region with match Second feature region similarity, hereafter, according to fisrt feature concentrate include each fisrt feature region and matched second The similarity of characteristic area obtains the similarity of fisrt feature collection and the second feature collection of the image, finally, will be with fisrt feature The corresponding image of the maximum second feature collection of the similarity of collection is as target image.
It, can also be in advance to the in the embodiment of the present invention in order to guarantee that the target image chosen has preferable quality The corresponding image of the maximum second feature collection of the similarity of one feature set carries out quality coefficient assessment, if quality coefficient assessment result Reach preset requirement, then using image corresponding with the maximum second feature collection of the similarity of fisrt feature collection as target image. Wherein, quality coefficient assessment can formulate the picture appraisal factor by edge strength, noise rate, uniform brightness distribution etc., this Inventive embodiments are not specifically limited this.
Step S310 can be specifically, choose the picture material with the first image from the pattern library of photographing module Different image, as target image.
To realize above scheme, it is possible, firstly, to randomly select one from the pattern library of photographing module to comparison diagram Picture, then will be compared to the picture material of hard image and the picture material of the first image, to judge the figure to contrast images As whether content is different from the picture material of the first image, if to the picture material of contrast images and the picture material of the first image Difference then will be determined as target image to contrast images.
It equally,, can also be right in advance in the embodiment of the present invention in order to guarantee that the target image chosen has preferable quality What is randomly selected carries out quality coefficient assessment to contrast images, if quality coefficient assessment result reaches preset requirement, then will be to right It is compared than the picture material of image and the picture material of the first image.Wherein, quality coefficient assessment can be strong by edge The picture appraisal factor is formulated in degree, the distribution of noise rate, uniform brightness etc., and the embodiment of the present invention is not specifically limited this.
Step S320 is replaced the first image using target image, and using replaced image as the second image.
In actual implementation, binarization processing first can be carried out to target image, after recycling binarization to handle Target image the first image is replaced.
In addition, in actual implementation, being carried out using target image to the first image to meet diversified application demand Replacement, which can be, carries out whole replacement to the first image using target image, be also possible to using target image to the first image into The replacement of row part.
When carrying out part replacement to the first image using target image, it is possible, firstly, to be split to the first image, obtain It obtains area image to be replaced and retains area image, then target image is split, obtain target area image, hereafter, benefit Replacement area image is treated with target area image to be replaced, and is obtained and is included target area image and retain the of area image Two images.In this way, can carry out portrait area replacement to the first image when the first image is character image or background is replaced Operation, wherein portrait area replacement again can be portrait area integrally replace or portrait area in facial image individually replace Change, then or portrait area in torso portion independent replacement.
In the embodiment of the present invention, as second of embodiment, step S300 can be specifically, carry out the first image Landscaping treatment, by the first image Jing Guo landscaping treatment, as the second image.
In actual implementation, different types of image can take different landscaping treatment modes, to guarantee preferable beauty Change treatment effect.For example, U.S. face processing can be carried out to the facial image for including in character image when handling character image, It is also possible to quality optimization processing is carried out to the non-portrait area for including in character image, in another example, handling non-figure map When picture, quality optimization processing directly can be carried out to non-character image.
Based on above description, when the first image is character image, it is possible, firstly, to determine the portrait for including in character image Region, and locating human face's image from portrait area, then U.S. face processing is carried out to facial image.
The face structure of face is closely similar, but have apparent personal characteristics, including, gender, shape of face, eye-shaped, Fat or thin degree, the colour of skin and texture etc., the face with different personal characteristics, generally require to take different U.S. face handle logic into Row processing, to guarantee preferable U.S. face treatment effect.In consideration of it, in the embodiment of the present invention, for each individual character of facial image Feature has all done specific division, for example, gender can be divided into male and female, shape of face can be divided into round face, oval face, Elongated face, rectangular face, diamond shape face, positive triangle face and inverted triangle face, eye-shaped can be divided into standard eye, slim eye, loser, willow leaf Eye, copper bell eye, fat or thin degree can be divided into fat, micro- fat, normal, partially thin and excessively thin, and the colour of skin can be by color from deep to shallow Be in turn divided into colour of skin grade 1, colour of skin grade 2, colour of skin grade 3, colour of skin class 4, colour of skin class 5 and colour of skin class 6, texture can With by readability from being clearly in turn divided into texture level 1, texture level 2, texture level 3, texture level 4, line to fuzzy Manage class 5 and texture level 6.Further, in the embodiment of the present invention, each type of face characteristic has all been formulated corresponding U.S. face handles logic, for example, different genders and shape of face corresponds to different cambers, different genders and eye-shaped correspond to different eyes Adornment effect, different fat or thin degree correspond to different thin face ranks, and the different colours of skin corresponds to different whitening ranks, different lines The corresponding different mill skin rank of reason.
Therefore, in the embodiment of the present invention, when carrying out U.S. face processing to facial image, the individual character of facial image can be first determined Feature, then U.S. face processing logic corresponding with personal characteristics is chosen, hereafter, logic is handled to facial image according to the U.S. face of selection Carry out U.S. face processing.
It further,, can also be really while the portrait area for including in determining character image in the embodiment of the present invention The non-portrait area that the fixed character image includes, and processing is optimized to the picture quality of non-portrait area.Wherein, to inhuman As the picture quality in region optimize processing may include non-portrait area is carried out enhancing edge strength, reduce noise rate, The operations such as Luminance Distribution correction.
In order to improve the landscaping treatment efficiency to the first image, the picture quality to non-portrait area can also carry out in advance Assessment, if quality coefficient assessment result is not up to preset requirement, then optimizes processing to the picture quality of non-portrait area.Its In, quality coefficient assessment can formulate the picture appraisal factor, this hair by edge strength, noise rate, uniform brightness distribution etc. Bright embodiment is not specifically limited this.
When the first image be non-character image when, can the picture quality directly to the first image optimize processing.Its In, to the picture quality of the first image optimize processing may include the first image is carried out enhancing edge strength, reduce make an uproar The operations such as sound rate, Luminance Distribution correction.
Equally, in order to improve the landscaping treatment efficiency to the first image, quality system can also be carried out to the first image in advance Number is assessed, if quality coefficient assessment result is not up to preset requirement, then optimizes place to the picture quality of the first image Reason.Wherein, quality coefficient assessment can formulate the picture appraisal factor by edge strength, noise rate, uniform brightness distribution etc., The embodiment of the present invention is not specifically limited this.
In the embodiment of the present invention, before step S300, processing method of taking pictures can also include sending image to attending to anything else to apply Processing request generates process instruction so as to attend to anything else and generate request using the instruction triggered according to image processing requests or user, and Sandbox is returned to, further, sandbox can receive the process instruction attended to anything else using returning, to execute step according to process instruction S300.Wherein, process instruction may include indicating whether to need to handle the first image, obtain the order of the second image. When needing to handle the first image, when obtaining the second image, process instruction can also include that instruction carries out the first image Processing obtains the order of the specific processing mode of the second image.For example, the first image is replaced using other images, and Using replaced image as the second image, or quality optimization processing directly is carried out to the first image, and quality optimization will be passed through Treated the first image is as the second image.
Second image is sent to application of attending to anything else by step S400, is shown so as to attend to anything else and apply to the second image.
Referring to Fig. 4, Fig. 4 is the schematic block diagram of processing unit provided in an embodiment of the present invention of taking pictures, this is taken pictures Processing unit 110 includes attending to anything else to send using monitoring module 111, image blocking module 112, image processing module 113 and image Module 114.It should be noted that processing unit 110 provided in an embodiment of the present invention of taking pictures is executed in sandbox.
Attend to anything else to be used to monitor using monitoring module to operate in and applies whether call taking the photograph in electronic equipment attending to anything else in sandbox As module carries out image taking.
Sandbox, which is one, allows to run browser or other applications in its environment (for example, monitored attending to anything else is answered With) virtual system program.Attend to anything else attending to anything else using the native applications program for being then mounted to electronic equipment, is to utilize skill of attending to anything else Art attends to anything else to native applications program, and the institute for having native applications program is functional, is capable of providing and native applications journey The identical service of sequence.In the embodiment of the present invention, attending to anything else to apply can be QQ, wechat, follows closely nail, the communication of 263 clouds etc. and can adjust The application program taken pictures with the photographing module in electronic equipment is attended to anything else.
Whether, in actual implementation, sandbox can use Hook Function and monitor application of attending to anything else, attend to anything else to apply with judgement and call Photographing module in electronic equipment carries out image taking.
Herein, term " hook " cover for by intercept transmitted between component software function call, message or Event changes or increases the technology of the behavior of operating system, application program or other software component, and handles this intercepted Function call, event or message code be thus referred to as Hook Function, i.e. hook function.Hook is commonly used in various targets, Including debug and be extended function to function, example may include being transmitted to target in keyboard or mouse event to answer They or hooking system service call (system call), system function behavior, function implementing result etc. are intercepted before with program, with Monitor or modify application program or the function of other assemblies etc..
Further, in the embodiment of the present invention, attend to anything else using monitor module may include attend to anything else using monitor submodule and Acquisition, which acts, determines submodule.
Attend to anything else to be used to attend to anything else to apply whether to instruct using image taking by Hook Function monitoring using monitoring submodule and adjust Use photographing module.Acquisition, which acts, determines that submodule is used to call when Hook Function listens to attend to anything else using using image taking instruction When photographing module, expression, which listens to attend to anything else, carries out image taking using calling photographing module.Wherein, image taking, which instructs, to be Jni method corresponding with taking pictures, specially android.hardware.Camera method native_ in photographing module takePicture。
Image blocking module 112 be used for attend to anything else using monitor module 111 listen to attend to anything else using call photographing module into When row image taking, the first image attended to anything else using photographing module shooting is called is intercepted.
In actual implementation, image blocking module 112 again may be by Hook Function interception and attend to anything else using calling camera shooting Module carries out the first image captured by image taking.For example, can by Hook Function to the callback interface of photographing module into Row adapter tube, so that the available administration authority to photographing module of sandbox, so as to intercept captured by photographing module the Callback interface mJpegCallback specifically can be modified MyPictureCallback by one image.Hereafter, mould will be imaged To sandbox, specific code is accomplished by block the first image call collected
MyPictureCallback onPicture Taken (byte [] data, Camera camera), wherein array Data is the first image.
Image processing module 113 obtains the second image for handling the first image.
First image is to attend to anything else to carry out image captured by image taking using the photographing module called in electronic equipment, by In the shooting angle, shooting environmental the problems such as, the quality of the first image may be poor, therefore, can after handling the first image To obtain preferable second image of quality.
In actual implementation, it can use other images and the first image line replaced, and using replaced image as Two images directly can also carry out quality optimization processing to the first image, and will be by quality optimization treated the first image As the second image.
Therefore, incorporated by reference to Fig. 3, in the embodiment of the present invention, as the first embodiment, image processing module 113 can be with Submodule and the first image procossing submodule are chosen including target image.
Target image chooses submodule for choosing target image from the pattern library of photographing module.
The image stored in the pattern library of photographing module includes all application programs (packet applied to the electronic equipment Include monitored application of attending to anything else) call history image captured by the photographing module.In the embodiment of the present invention, from photographing module The target image chosen in pattern library may include, but be not limited to image similar with the first image, and with the first figure The different image etc. of the picture material of picture.
Based on above description, it may include first object image selection unit that target image, which chooses submodule,.
First object image selection unit is used to choose from the pattern library of photographing module similar to the first image Maximum image is spent, as target image.
To realize above scheme, first object image selection unit may include fisrt feature collection selection subelement, the again Two feature sets choose subelement, similarity calculation subelement and first object image and determine subelement.
Fisrt feature collection chooses subelement and is used to carry out feature identification to the first image, special with obtain the first image first Collection.For example, can to the first image carry out edge detection, according to the edge of closure determine the first image at least one first Characteristic area, the fisrt feature collection as the first image.Second feature collection chooses subelement for depositing to the image of photographing module Each image in storage cavern carries out feature identification, to obtain the second feature collection of each image.Equally, it is directed in pattern library Each image can carry out edge detection to the image, at least one second feature area of the image is determined according to the edge of closure Domain, the second feature collection as the image.Similarity calculation subelement is used to calculate separately in the pattern library of photographing module The second feature collection of each image and the similarity of fisrt feature collection.First object image determines subelement for will be with fisrt feature The corresponding image of the maximum second feature collection of the similarity of collection is as target image.
Further, when it includes a fisrt feature region that fisrt feature, which is concentrated, similarity calculation subelement can divide The second feature of each image the phase in each the second feature region and fisrt feature region that include Ji Suan not be concentrated in pattern library Like degree, the determining maximum second feature region of similarity with fisrt feature region, so that first object image determines subelement Using image corresponding with second feature collection belonging to the second feature region as target image.It includes more for concentrating when fisrt feature When a fisrt feature region, similarity calculation subelement can be directed to each image in the pattern library of photographing module, point Each second feature region for including and fisrt feature is not concentrated to concentrate each fisrt feature area for including the second feature of the image Domain carries out similarity mode, to determine that the second feature of the image concentrates the second feature area with each fisrt feature Region Matching Domain, then be directed to fisrt feature and concentrate each fisrt feature region for including, calculate the fisrt feature region and matched second spy The similarity in region is levied, hereafter, each fisrt feature region and matched second feature region for including are concentrated according to fisrt feature Similarity obtain fisrt feature collection and the image second feature collection similarity, finally, first object image is made to determine son Unit is using image corresponding with the maximum second feature collection of the similarity of fisrt feature collection as target image.
In order to guarantee that the target image chosen has preferable quality, in the embodiment of the present invention, first object image is chosen Unit can also include the first quality coefficient assessment subelement and the first assessment result judgment sub-unit.
First quality coefficient is assessed subelement and is used for corresponding with the maximum second feature collection of the similarity of fisrt feature collection Image carry out quality coefficient assessment.First assessment result judgment sub-unit is used to reach default in quality coefficient assessment result and want It asks, first object image is made to determine that subelement is executed figure corresponding with the maximum second feature collection of the similarity of fisrt feature collection As the movement as target image.Wherein, quality coefficient assessment can pass through edge strength, noise rate, uniform brightness distribution etc. The picture appraisal factor is formulated, the embodiment of the present invention is not specifically limited this.
It can also include the second target image selection unit that target image, which chooses submodule,.
Second target image selection unit from the pattern library of photographing module for choosing the image with the first image The different image of content, as target image.
To realize that above scheme, the second target image selection unit may include choosing subelement, figure to contrast images again As content contrast subunit and the second target image determine subelement.
Subelement is chosen to contrast images to be used to randomly select one to comparison diagram from the pattern library of photographing module Picture.Picture material contrast subunit is used to compare to the picture material of hard image and the picture material of the first image, To judge whether the picture material to contrast images is different from the picture material of the first image.Second target image determines subelement For different from the picture material of the first image in the picture material to contrast images, target figure will be determined as to contrast images Picture.
First image procossing submodule is for being replaced the first image using target image, and by replaced image As the second image.
In actual implementation, the first image procossing submodule first can carry out binarization processing, then benefit to target image Target image after being handled with binarization is replaced the first image.
In addition, in actual implementation, the first image procossing submodule utilizes target in order to meet diversified application demand Image, which is replaced the first image can be, carries out whole replacement to the first image using target image, is also possible to utilize mesh Logo image carries out local replacement to the first image.
To realize the scheme locally replaced using target image to the first image, the first image procossing submodule again may be used To include the first image segmentation unit, the second image segmentation unit and image replacing unit.
First image segmentation unit is for being split the first image, obtaining area image to be replaced and retaining administrative division map Picture.Second image segmentation unit obtains target area image for being split to target image.Image replacing unit is for benefit Replacement area image is treated with target area image to be replaced, and is obtained and is included target area image and retain the of area image Two images.In this way, can carry out portrait area replacement to the first image when the first image is character image or background is replaced Operation, wherein portrait area replacement again can be portrait area integrally replace or portrait area in facial image individually replace Change, then or portrait area in torso portion independent replacement.
In the embodiment of the present invention, as second of embodiment, image processing module 113 may include the second image procossing Submodule.
Second image procossing submodule is used to carry out landscaping treatment to the first image, by the first figure Jing Guo landscaping treatment Picture, as the second image.
In actual implementation, different types of image can take different landscaping treatment modes, to guarantee preferable beauty Change treatment effect.For example, U.S. face processing can be carried out to the facial image for including in character image when handling character image, It is also possible to quality optimization processing is carried out to the non-portrait area for including in character image, in another example, handling non-figure map When picture, quality optimization processing directly can be carried out to non-character image.
Based on above description, the second image procossing submodule may include that facial image positioning unit and U.S. face processing are single again Member.
Facial image positioning unit is used to determine the portrait area for including in character image when the first image is character image Domain, and locating human face's image from portrait area.U.S. face processing unit is used to carry out facial image U.S. face processing.
The face structure of face is closely similar, but have apparent personal characteristics, including, gender, shape of face, eye-shaped, Fat or thin degree, the colour of skin and texture etc., the face with different personal characteristics, generally require to take different U.S. face handle logic into Row processing, to guarantee preferable U.S. face treatment effect.In consideration of it, in the embodiment of the present invention, for each individual character of facial image Feature has all done specific division, for example, gender can be divided into male and female, shape of face can be divided into round face, oval face, Elongated face, rectangular face, diamond shape face, positive triangle face and inverted triangle face, eye-shaped can be divided into standard eye, slim eye, loser, willow leaf Eye, copper bell eye, fat or thin degree can be divided into fat, micro- fat, normal, partially thin and excessively thin, and the colour of skin can be by color from deep to shallow Be in turn divided into colour of skin grade 1, colour of skin grade 2, colour of skin grade 3, colour of skin class 4, colour of skin class 5 and colour of skin class 6, texture can With by readability from being clearly in turn divided into texture level 1, texture level 2, texture level 3, texture level 4, line to fuzzy Manage class 5 and texture level 6.Further, in the embodiment of the present invention, each type of face characteristic has all been formulated corresponding U.S. face handles logic, for example, different genders and shape of face corresponds to different cambers, different genders and eye-shaped correspond to different eyes Adornment effect, different fat or thin degree correspond to different thin face ranks, and the different colours of skin corresponds to different whitening ranks, different lines The corresponding different mill skin rank of reason.
Therefore, in the embodiment of the present invention, U.S. face processing unit may include that personal characteristics determines subelement, U.S. face processing again Logic chooses subelement and U.S. face handles subelement.
Personal characteristics determines subelement for determining the personal characteristics of facial image.U.S. face processing logic is chosen subelement and is used Logic is handled in choosing U.S. face corresponding with personal characteristics.U.S. face processing subelement is in handling logic to people according to the U.S. face of selection Face image carries out U.S. face processing.
Further, the second image procossing submodule further includes that non-portrait area determines that subelement and the first picture quality are excellent Beggar's unit.
Non- portrait area determine subelement for when determination character image in include portrait area while, determine the people The non-portrait area that object image includes.First image quality optimization subelement is used to carry out the picture quality of non-portrait area excellent Change processing.Wherein, optimizing processing to the picture quality of non-portrait area may include carrying out enhancing side to non-portrait area Edge intensity reduces the operations such as noise rate, Luminance Distribution correction.
In order to improve the landscaping treatment efficiency to the first image, the second image procossing submodule can also include the second mass Coefficient assesses subelement and the second assessment result judgment sub-unit.
Second quality coefficient assessment subelement is for assessing the picture quality of non-portrait area.Second assessment result Judgment sub-unit is used for when quality coefficient assessment result is not up to preset requirement, executes the first image quality optimization subelement The step of processing is optimized to the picture quality of non-portrait area.Wherein, quality coefficient assessment can by edge strength, make an uproar The picture appraisal factor is formulated in sound rate, uniform brightness distribution etc., and the embodiment of the present invention is not specifically limited this.
Further, the second image procossing submodule can also include image quality optimization unit.
Image quality optimization unit is used to carry out the picture quality of the first image when the first image is non-character image Optimization processing.Wherein, optimizing processing to the picture quality of the first image may include carrying out enhancing edge to the first image Intensity reduces the operations such as noise rate, Luminance Distribution correction.
Equally, in order to improve the landscaping treatment efficiency to the first image, the second image procossing submodule further includes quality system Number assessment list and assessment result judging unit.
Quality coefficient assessment unit is used to carry out quality coefficient to the first image to assess.Assessment result judging unit is used In executing image quality optimization unit to the image matter of the first image Amount optimizes processing.Wherein, quality coefficient assessment can be formulated by edge strength, noise rate, uniform brightness distribution etc. The picture appraisal factor, the embodiment of the present invention are not specifically limited this.
Image sending module 114 is used to the second image being sent to application of attending to anything else so that attend to anything else application to the second image into Row is shown.
Further, in the embodiment of the present invention, processing unit of taking pictures 110 can also include image processing requests sending module With process instruction receiving module.
Image processing requests sending module is used to apply so as to attend to anything else according to figure to attending to anything else using image processing requests are sent Process instruction is generated as the instruction of processing request or user's triggering generates request, and returns to sandbox.Process instruction receiving module The process instruction attended to anything else for receiving sandbox using returning, so that image processing module 113 is executed according to process instruction to the One image is handled, and the movement of the second image is obtained.Wherein, process instruction may include indicating whether to need to the first image It is handled, obtains the order of the second image.When needing to handle the first image, when obtaining the second image, process instruction It can also include that instruction handles the first image, obtain the order of the specific processing mode of the second image.For example, utilizing it He is replaced the first image image, and using replaced image as the second image, or directly carries out matter to the first image Optimization processing is measured, and will be by quality optimization treated the first image as the second image.
In conclusion the present invention discloses processing method of taking pictures, device and the electronic equipment of embodiment offer, fortune is being listened to Row in sandbox attending to anything else using call photographing module carry out image taking when, can intercept attend to anything else using call photographing module clap The first image taken the photograph obtains the second image, and the second image is sent to application of attending to anything else to handle the first image, with Make to attend to anything else using being shown to the second image, therefore, even attending to anything else to apply has taken ropy image (for example, first Image), the processing method and processing device of taking pictures for disclosing embodiment offer through the invention can also intercept first image, Bu Huizhi It connects for the first image to be sent to and attend to anything else using displaying, but handled it to obtain the preferable image of quality (for example, the second figure Picture), it is then sent to and attends to anything else using displaying.So the present invention discloses processing method of taking pictures, device and the electronics of embodiment offer Equipment can be improved the image of image captured by the photographing module in the application call electronic equipment with camera function Quality.
In several embodiments provided by the embodiment of the present disclosure, it should be understood that disclosed device and method, it can also To realize by another way.Device and method embodiment described above is only schematical, for example, in attached drawing Flow chart and block diagram show that the devices of multiple embodiments according to the disclosure, method and computer program product are able to achieve Architecture, function and operation.In this regard, each box in flowchart or block diagram can represent module, a program A part of section or code, a part of module, section or code include one or more for realizing defined logic function The executable instruction of energy.It should also be noted that function marked in the box can also be in some implementations as replacement Occur in a different order than that indicated in the drawings.For example, two continuous boxes can actually be basically executed in parallel, it Can also execute in the opposite order sometimes, this depends on the function involved.It is also noted that block diagram and/or process The combination of each box in figure and the box in block diagram and or flow chart, can as defined in executing function or movement Dedicated hardware based system is realized, or can be realized using a combination of dedicated hardware and computer instructions.
In addition, each functional module in each embodiment of the disclosure can integrate one independent portion of formation together Point, it is also possible to modules individualism, an independent part can also be integrated to form with two or more modules.
If function is realized and when sold or used as an independent product in the form of software function module, can store In a computer readable storage medium.Based on this understanding, the technical solution of the disclosure is substantially in other words to existing Having the part for the part or the technical solution that technology contributes can be embodied in the form of software products, the computer Software product is stored in a storage medium, including some instructions are used so that a computer equipment (can be personal meter Calculation machine, electronic equipment or network equipment etc.) execute each embodiment method of the disclosure all or part of the steps.And it is aforementioned Storage medium include: USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory The various media that can store program code such as (RAM, RandomAccess Memory), magnetic or disk.It needs to illustrate It is, herein, the terms "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, to make Obtaining the process, method, article or equipment including a series of elements not only includes those elements, but also including not arranging clearly Other element out, or further include for elements inherent to such a process, method, article, or device.Not more In the case where limitation, the element that is limited by sentence " including one ... ", it is not excluded that include element process, method, There is also other identical elements in article or equipment.
The above is only the alternative embodiments of the disclosure, are not limited to the disclosure, for those skilled in the art For member, the disclosure can have various modifications and variations.It is all the disclosure spirit and principle within, it is made it is any modification, Equivalent replacement, improvement etc., should be included within the protection scope of the disclosure.
It takes pictures processing method the present invention provides, A1. one kind, comprising:
Whether monitor to operate in apply attending to anything else in sandbox calls the photographing module in electronic equipment to carry out image taking;
Image taking is carried out using the calling photographing module if attending to anything else described in listening to, then application of attending to anything else described in interception Call the first image of the photographing module shooting;
The first image is handled, the second image is obtained;
Second image is sent to the application of attending to anything else, so that second image is opened up in the application of attending to anything else Show.
A2. processing method according to a1 of taking pictures, it is described that the first image is handled, the second image is obtained, Include:
Target image is chosen from the pattern library of the photographing module;
The first image is replaced using the target image, and using replaced image as second figure Picture.
A3. it takes pictures according to A2 processing method, it is described to choose target from the pattern library of the photographing module Image, comprising:
The maximum image of similarity with the first image is chosen from the pattern library of the photographing module, as Target image.
A4. processing method according to a3 of taking pictures, selection and the institute from the pattern library of the photographing module The maximum image of similarity for stating the first image, as target image, comprising:
Feature identification is carried out to the first image, to obtain the fisrt feature collection of the first image;
Feature identification is carried out to each image in the pattern library of the photographing module, it is special with obtain each image second Collection;
Calculate separately the second feature collection and the fisrt feature collection of each image in the pattern library of the photographing module Similarity;
Using image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection as target image.
A5. processing method according to a4 of taking pictures, selection and the institute from the pattern library of the photographing module The maximum image of similarity for stating the first image, as target image, further includes:
Quality coefficient assessment is carried out to image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection;
If quality coefficient assessment result reaches preset requirement, execution will be maximum with the similarity of the fisrt feature collection The step of corresponding image of second feature collection is as target image.
A6. it takes pictures according to A2 processing method, it is described to choose target from the pattern library of the photographing module Image, comprising:
The image different from the picture material of the first image is chosen from the pattern library of the photographing module, is made For target image.
A7. it takes pictures according to A6 processing method, it is described to be chosen from the pattern library of the photographing module and institute The different image of the picture material of the first image is stated, as target image, comprising:
One is randomly selected from the pattern library of the photographing module to contrast images;
It is compared described to the picture material of hard image and the picture material of the first image, described in judgement Whether the picture material to contrast images is different from the picture material of the first image;
If the picture material to contrast images is different from the picture material of the first image, by described wait compare Image is determined as the target image.
A8. it takes pictures according to A2 processing method, it is described that the first image is replaced using the target image It changes, and using replaced image as second image, comprising:
The first image is split, area image to be replaced is obtained and retains area image;
The target image is split, target area image is obtained;
The area image to be replaced is replaced using the target area image, obtaining includes the target area Image and second image for retaining area image.
A9. processing method according to a1 of taking pictures, it is described that the first image is handled, the second image is obtained, Include:
Landscaping treatment is carried out to the first image, by the first image Jing Guo landscaping treatment, as the second image.
A10. it takes pictures according to A9 processing method, it is described that landscaping treatment is carried out to the first image, it will be by beauty The first image for changing processing, as the second image, comprising:
When the first image is character image, the portrait area for including in the character image is determined, and from described Locating human face's image in portrait area;
U.S. face processing is carried out to the facial image.
A11. it takes pictures according to A10 processing method, it is described that U.S. face processing is carried out to the facial image, comprising:
Determine the personal characteristics of the facial image;
It chooses U.S. face corresponding with the personal characteristics and handles logic;
U.S. face processing is carried out to the facial image according to the U.S. face processing logic of selection.
A12. it takes pictures according to A10 or A11 processing method, it is described that landscaping treatment is carried out to the first image, it will By the first image of landscaping treatment, as the second image, further includes:
When the first image is character image, the non-portrait area that the character image includes is determined;
Processing is optimized to the picture quality of the non-portrait area.
A13. it takes pictures according to A12 processing method, it is described that landscaping treatment is carried out to the first image, it will be by beauty The first image for changing processing, as the second image, further includes:
The picture quality of the non-portrait area is assessed;
If quality coefficient assessment result is not up to preset requirement, executes and the picture quality of the non-portrait area is carried out The step of optimization processing.
A14. it takes pictures according to A9 processing method, it is described that landscaping treatment is carried out to the first image, it will be by beauty The first image for changing processing, as the second image, comprising:
When the first image is non-character image, processing is optimized to the picture quality of the first image.
A15. it takes pictures according to A14 processing method, it is described that landscaping treatment is carried out to the first image, it will be by beauty The first image for changing processing, as the second image, further includes:
Quality coefficient is carried out to the first image to assess;
If quality coefficient assessment result is not up to preset requirement, the picture quality progress executed to the first image is excellent The step of changing processing.
A16. processing method according to a1 of taking pictures, it is described that the first image is handled, obtain the second image Before, the method also includes:
To it is described attend to anything else using send image processing requests so that it is described attend to anything else using according to described image handle request or The instruction of user's triggering generates request and generates process instruction, and returns;
Attend to anything else described in reception using return process instruction, with according to the process instruction execute to the first image into The step of row processing, the second image of acquisition.
A17. processing method according to a1 of taking pictures, the monitoring, which operates in, applies whether call electricity attending to anything else in sandbox Photographing module in sub- equipment carries out image taking, comprising:
By Hook Function monitor described in attend to anything else using whether using image taking instruction calling the photographing module:
Attend to anything else described in being listened to when the Hook Function and calls the photographing module using using described image shooting instruction When, expression listens to described attend to anything else using the calling photographing module progress image taking.
B18. one kind is taken pictures processing unit, comprising:
Attend to anything else using module is monitored, applies whether call taking the photograph in electronic equipment attending to anything else in sandbox for monitoring to operate in As module carries out image taking;
Image blocking module, for when listening to described attend to anything else using calling the photographing module to carry out image taking, Attend to anything else described in then intercepting using the first image for calling the photographing module shooting;
Image processing module obtains the second image for handling the first image;
Image sending module, for second image to be sent to the application of attending to anything else, so that the application pair of attending to anything else Second image is shown.
B19. it takes pictures according to B18 processing unit, described image processing module, comprising:
Target image chooses submodule, for choosing target image from the pattern library of the photographing module;
First image procossing submodule for being replaced using the target image to the first image, and will replace Image after changing is as second image.
B20. it takes pictures according to B19 processing unit, the target image chooses submodule, comprising:
First object image selection unit, for being chosen and first figure from the pattern library of the photographing module The maximum image of the similarity of picture, as target image.
B21. take pictures according to B20 processing unit, the first object image choose it is single, as target image, packet It includes:
Fisrt feature collection chooses subelement, for carrying out feature identification to the first image, to obtain first figure The fisrt feature collection of picture;
Second feature collection chooses subelement, carries out feature for each image in the pattern library to the photographing module Identification, to obtain the second feature collection of each image;
Similarity calculation subelement, the second of each image is special in the pattern library for calculating separately the photographing module The similarity of collection and the fisrt feature collection;
First object image determines subelement, for by with the maximum second feature collection of the similarity of the fisrt feature collection Corresponding image is as target image.
B22. it takes pictures according to B21 processing unit, the first object image selection unit, further includes:
First quality coefficient assess subelement, for the maximum second feature collection of the similarity of the fisrt feature collection Corresponding image carries out quality coefficient assessment;
First assessment result judgment sub-unit, for when quality coefficient assessment result reaches preset requirement, making described One target image determines that subelement is then executed figure corresponding with the maximum second feature collection of the similarity of the fisrt feature collection As the movement as target image.
B23. it takes pictures according to B19 processing unit, the target image chooses submodule, comprising:
Second target image selection unit, for being chosen and first figure from the pattern library of the photographing module The different image of the picture material of picture, as target image.
B24. it takes pictures according to B23 processing unit, the second target image selection unit, comprising:
Subelement is chosen to contrast images, for randomly selecting one from the pattern library of the photographing module to right Compare image;
Picture material contrast subunit, for by the image of the picture material to hard image and the first image Content compares, to judge whether the picture material to contrast images is different from the picture material of the first image;
Second target image determines subelement, in the picture material to contrast images and the first image When picture material difference, then it is determined as the target image to contrast images for described.
B25. it takes pictures according to B19 processing unit, the first image handles submodule, comprising:
First image segmentation unit obtains area image to be replaced and reservation for being split to the first image Area image;
Second image segmentation unit obtains target area image for being split to the target image;
Image replacing unit is obtained for being replaced using the target area image to the area image to be replaced It obtains including the target area image and second image for retaining area image.
B26. it takes pictures according to B18 processing unit, described image processing module, comprising:
Second image procossing submodule, for carrying out landscaping treatment to the first image, by the institute Jing Guo landscaping treatment The first image is stated, as the second image.
B27. it takes pictures according to B26 processing unit, the second image procossing submodule, comprising:
Facial image positioning unit, for determining and being wrapped in the character image when the first image is character image The portrait area included, and locating human face's image from the portrait area;
U.S. face processing unit, for carrying out U.S. face processing to the facial image.
B28. it takes pictures according to B27 processing unit, the U.S. face processing unit, comprising:
Personal characteristics determines subelement, for determining the personal characteristics of the facial image;
U.S. face processing logic chooses subelement, handles logic for choosing U.S. face corresponding with the personal characteristics;
U.S. face handles subelement, for being carried out at U.S. face according to the U.S. face processing logic of selection to the facial image Reason.
B29. it takes pictures according to B27 or B28 processing unit, the second image procossing submodule, further includes:
Non- portrait area determines subelement, for determining the character image when the first image is character image Including non-portrait area;
First image quality optimization subelement optimizes processing for the picture quality to the non-portrait area.
B30. it takes pictures according to B29 processing unit, the second image procossing submodule, further includes:
Second quality coefficient assesses subelement, assesses for the picture quality to the non-portrait area;
Second assessment result judgment sub-unit makes described for being not up to preset requirement in quality coefficient assessment result The step of execution of one image quality optimization subelement optimizes processing to the picture quality of the non-portrait area.
B31. it takes pictures according to B26 processing unit, the second image procossing submodule, comprising:
Image quality optimization unit is used for when the first image is non-character image, to the figure of the first image Image quality amount optimizes processing.
B32. it takes pictures according to B31 processing unit, the second image procossing submodule, further includes:
Quality coefficient assessment unit is assessed for carrying out quality coefficient to the first image;
Assessment result judging unit makes described image quality for being not up to preset requirement in quality coefficient assessment result The step of optimization unit execution optimizes processing to the picture quality of the first image.
B33. it takes pictures according to B18 processing unit, the processing unit of taking pictures, further includes:
Image processing requests sending module, for attending to anything else to described using image processing requests are sent, so that described attend to anything else Process instruction is generated using the instruction generation request for handling request or user's triggering according to described image, and is returned;
Process instruction receiving module, for receiving the process instruction attended to anything else using return, so that described image is handled Module is handled the first image according to process instruction execution, obtains the movement of the second image.
B34. it takes pictures according to B18 processing unit, it is described to attend to anything else using monitoring module, comprising:
Attend to anything else using monitoring submodule, whether is referred to using image taking for application of attending to anything else described in being monitored by Hook Function It enables and calls the photographing module;
Acquisition, which acts, determines submodule, for when the Hook Function listen to it is described attend to anything else clapped using using described image When taking the photograph instruction and calling the photographing module, expression listens to described attend to anything else using calling the photographing module to carry out image taking.
C35. a kind of electronic equipment, including processing dress of taking pictures described in any one of processor, memory and B18-B34 It sets, the processing unit of taking pictures includes one or more software functions for being stored in the memory and being executed by the processor Module.
D36. a kind of computer readable storage medium, is stored thereon with computer program, and the computer program is performed When, it can be achieved that processing method of taking pictures described in any one of A1-A17.

Claims (10)

  1. The processing method 1. one kind is taken pictures characterized by comprising
    Whether monitor to operate in apply attending to anything else in sandbox calls the photographing module in electronic equipment to carry out image taking;
    If attending to anything else described in listening to using calling the photographing module to carry out image taking, then attends to anything else to apply described in interception and call First image of the photographing module shooting;
    The first image is handled, the second image is obtained;
    Second image is sent to the application of attending to anything else, so that the application of attending to anything else is shown second image.
  2. 2. processing method according to claim 1 of taking pictures, which is characterized in that it is described that the first image is handled, Obtain the second image, comprising:
    Target image is chosen from the pattern library of the photographing module;
    The first image is replaced using the target image, and using replaced image as second image.
  3. 3. processing method according to claim 2 of taking pictures, which is characterized in that described to be stored from the image of the photographing module Target image is chosen in library, comprising:
    The maximum image of similarity with the first image is chosen from the pattern library of the photographing module, as target Image.
  4. 4. processing method according to claim 3 of taking pictures, which is characterized in that described to be stored from the image of the photographing module The maximum image of similarity with the first image is chosen in library, as target image, comprising:
    Feature identification is carried out to the first image, to obtain the fisrt feature collection of the first image;
    Feature identification is carried out to each image in the pattern library of the photographing module, to obtain the second feature of each image Collection;
    Calculate separately the phase of the second feature collection and the fisrt feature collection of each image in the pattern library of the photographing module Like degree;
    Using image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection as target image.
  5. 5. processing method according to claim 4 of taking pictures, which is characterized in that described to be stored from the image of the photographing module The maximum image of similarity with the first image is chosen in library, as target image, further includes:
    Quality coefficient assessment is carried out to image corresponding with the maximum second feature collection of the similarity of the fisrt feature collection;
    If quality coefficient assessment result reaches preset requirement, execute the similarity maximum second with the fisrt feature collection The step of corresponding image of feature set is as target image.
  6. 6. processing method according to claim 2 of taking pictures, which is characterized in that described to be stored from the image of the photographing module Target image is chosen in library, comprising:
    The image different from the picture material of the first image is chosen from the pattern library of the photographing module, as mesh Logo image.
  7. 7. processing method according to claim 6 of taking pictures, which is characterized in that described to be stored from the image of the photographing module The image different from the picture material of the first image is chosen in library, as target image, comprising:
    One is randomly selected from the pattern library of the photographing module to contrast images;
    It is compared described to the picture material of hard image and the picture material of the first image, it is described to right to judge It is whether more different from the picture material of the first image than the picture material of image;
    It, will be described to contrast images if the picture material to contrast images is different from the picture material of the first image It is determined as the target image.
  8. The processing unit 8. one kind is taken pictures characterized by comprising
    Attend to anything else using module is monitored, for monitoring the camera shooting mould applied and whether called in electronic equipment of attending to anything else operated in sandbox Block carries out image taking;
    Image blocking module, for when listening to described attend to anything else using calling the photographing module to carry out image taking, then blocking Cut described attend to anything else using the first image for calling the photographing module shooting;
    Image processing module obtains the second image for handling the first image;
    Image sending module, for second image to be sent to the application of attending to anything else, so that described attend to anything else using to described Second image is shown.
  9. 9. a kind of electronic equipment, which is characterized in that including processor, memory and processing unit according to any one of claims 8 of taking pictures, The processing unit of taking pictures includes one or more software function moulds for being stored in the memory and being executed by the processor Block.
  10. 10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program It is performed, it can be achieved that processing method of any of claims 1-7 of taking pictures.
CN201810875963.4A 2018-08-02 2018-08-02 It takes pictures processing method, device and electronic equipment Pending CN109118448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810875963.4A CN109118448A (en) 2018-08-02 2018-08-02 It takes pictures processing method, device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810875963.4A CN109118448A (en) 2018-08-02 2018-08-02 It takes pictures processing method, device and electronic equipment

Publications (1)

Publication Number Publication Date
CN109118448A true CN109118448A (en) 2019-01-01

Family

ID=64852035

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810875963.4A Pending CN109118448A (en) 2018-08-02 2018-08-02 It takes pictures processing method, device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109118448A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532188A (en) * 2019-08-30 2019-12-03 北京三快在线科技有限公司 The method and apparatus of page presentation test
WO2024055867A1 (en) * 2022-09-15 2024-03-21 荣耀终端有限公司 Application cloning-based interface display method and related apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349045A (en) * 2013-08-09 2015-02-11 联想(北京)有限公司 Image collecting method and electronic equipment
CN106454093A (en) * 2016-10-18 2017-02-22 北京小米移动软件有限公司 Image processing method, image processing device and electronic equipment
CN106775902A (en) * 2017-01-25 2017-05-31 北京奇虎科技有限公司 A kind of method and apparatus of image procossing, mobile terminal
CN106897610A (en) * 2017-01-19 2017-06-27 北京奇虎科技有限公司 A kind of method and apparatus for positioning protection
CN107507159A (en) * 2017-08-10 2017-12-22 珠海市魅族科技有限公司 Image processing method and device, computer installation and readable storage medium storing program for executing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104349045A (en) * 2013-08-09 2015-02-11 联想(北京)有限公司 Image collecting method and electronic equipment
CN106454093A (en) * 2016-10-18 2017-02-22 北京小米移动软件有限公司 Image processing method, image processing device and electronic equipment
CN106897610A (en) * 2017-01-19 2017-06-27 北京奇虎科技有限公司 A kind of method and apparatus for positioning protection
CN106775902A (en) * 2017-01-25 2017-05-31 北京奇虎科技有限公司 A kind of method and apparatus of image procossing, mobile terminal
CN107507159A (en) * 2017-08-10 2017-12-22 珠海市魅族科技有限公司 Image processing method and device, computer installation and readable storage medium storing program for executing

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532188A (en) * 2019-08-30 2019-12-03 北京三快在线科技有限公司 The method and apparatus of page presentation test
WO2024055867A1 (en) * 2022-09-15 2024-03-21 荣耀终端有限公司 Application cloning-based interface display method and related apparatus

Similar Documents

Publication Publication Date Title
CN108696514B (en) Resource collection task management method, device, storage medium and system
CN109951627B (en) Image processing method, image processing device, storage medium and electronic equipment
CN106873863B (en) Method and device for setting interface switching animation
CN108304265A (en) EMS memory management process, device and storage medium
CN108769634B (en) Image processing method, image processing device and terminal equipment
CN108683720A (en) A kind of container cluster service configuration method and device
CN108924440B (en) Sticker display method, device, terminal and computer-readable storage medium
CN109086742A (en) scene recognition method, scene recognition device and mobile terminal
CN109120862A (en) High-dynamic-range image acquisition method, device and mobile terminal
CN109614902A (en) Face image processing process, device, electronic equipment and computer storage medium
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN106096391B (en) A kind of course control method and user terminal
CN107622483A (en) A kind of image combining method and terminal
CN107222790A (en) A kind of method, terminal and computer-readable recording medium for sending barrage
CN110796600A (en) Image super-resolution reconstruction method, image super-resolution reconstruction device and electronic equipment
CN111489290A (en) Face image super-resolution reconstruction method and device and terminal equipment
CN109118448A (en) It takes pictures processing method, device and electronic equipment
CN107302666A (en) Photographic method, mobile terminal and computer-readable recording medium
CN108848312A (en) It takes pictures method for previewing, device and electronic equipment
CN108494996A (en) Image processing method, device, storage medium and mobile terminal
CN110248165B (en) Label display method, device, equipment and storage medium
CN108600644A (en) Photographing method and device and wearable device
CN108595211A (en) Method and apparatus for output data
CN109035191A (en) Image processing method, picture processing unit and terminal device
CN112184540A (en) Image processing method, image processing device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190101