CN108550105A - Image processing method, image processing apparatus, electronic device, and medium - Google Patents

Image processing method, image processing apparatus, electronic device, and medium Download PDF

Info

Publication number
CN108550105A
CN108550105A CN201810277075.2A CN201810277075A CN108550105A CN 108550105 A CN108550105 A CN 108550105A CN 201810277075 A CN201810277075 A CN 201810277075A CN 108550105 A CN108550105 A CN 108550105A
Authority
CN
China
Prior art keywords
image
area
target
pending image
growth
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
CN201810277075.2A
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 Lemi Technology Co ltd
Original Assignee
Beijing Kingsoft Internet Security Software 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 Kingsoft Internet Security Software Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201810277075.2A priority Critical patent/CN108550105A/en
Publication of CN108550105A publication Critical patent/CN108550105A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • 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/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20092Interactive image processing based on input by user
    • G06T2207/20101Interactive definition of point of interest, landmark or seed
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20112Image segmentation details
    • G06T2207/20116Active contour; Active surface; Snakes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The application provides an image processing method, an image processing device, an electronic device and a medium, wherein the method comprises the following steps: determining a target area in the image to be processed currently; determining a static image currently corresponding to the image to be processed according to a known foreground region and the target region in the image to be processed; processing the static image by using an automatic segmentation algorithm, and determining a target growth area corresponding to the target area; and updating the known foreground region in the image to be processed according to the target growth region. By the method, the user can accurately segment the image desired by the user without drawing the boundary of the region of interest carefully, so that the convenience and flexibility of user operation can be improved, and the user experience is improved.

Description

Image processing method, device, electronic equipment and medium
Technical field
This application involves technical field of image processing more particularly to a kind of image processing method, device, electronic equipment and Jie Matter.
Background technology
Image procossing (image processing), analyzes image with computer, to reach the skill of required result Art.Common method includes in image procossing:Image transformation, image compression, image enhancement and recovery, image segmentation, image Classify (identification) etc..Wherein, image segmentation is one of the key technology in Digital Image Processing.Image segmentation is that will have in image The characteristic of meaning extracts, and significant feature has edge, region in image etc., this is further progress image Identification, analysis and the basis understood.
Currently, image Segmentation Technology, prospect background segmentation is usually applied in computer vision field, stereoscopic vision, is scratched Figure etc..For example user can replace the background of a certain pictures by foreground, background segment, alternatively, by scratching figure, by two Personage in picture is spliced into a pictures.
In the related technology, when carrying out image segmentation, need the boundary that user accurately describes target to be chosen that could scratch Customer satisfaction system image is taken out, this image partition method is higher to the rendering request of user so that the operating process of user is not Enough conveniently and flexibly.
Invention content
The application is intended to solve at least some of the technical problems in related technologies.
For this purpose, first purpose of the application is to propose a kind of image processing method, according to current target area and Known foreground area determines corresponding still image, and mesh is obtained after recycling automatic segmentation algorithm to handle still image Mark growth district, and then according to foreground area known to target growth area update, finally selected for user meet it is desired Image, the image that user wants, Neng Gouti can be accurately partitioned by making the user do not need carefully to depict the boundary of area-of-interest The convenience of high user's operation and flexibility promote user experience.
Second purpose of the application is to propose a kind of image processing apparatus.
The third purpose of the application is to propose a kind of electronic equipment.
The 4th purpose of the application is to propose a kind of non-transitorycomputer readable storage medium.
The 5th purpose of the application is to propose a kind of computer program product.
In order to achieve the above object, the application first aspect embodiment proposes a kind of image processing method, including:
Determine the target area in currently pending image;
According to known foreground area and the target area in the pending image, determine that the pending image is worked as Preceding corresponding still image;
Using automatic segmentation algorithm, the still image is handled, determines target corresponding with the target area Growth district;
According to the target growth region, known foreground area in the pending image is updated.
As the optional realization method of another kind of the application first aspect embodiment, the current still image of the determination Before, further include:
Main body identification is carried out to the pending image, determines the known foreground area;
Alternatively,
It is updated according to a preceding foreground area as a result, determining the known foreground area.
As the optional realization method of another kind of the application first aspect embodiment, the determination pending image Current corresponding still image, including:
According to the size of the pending image, reference block size corresponding with the pending image is determined;
According to the position of the target area and the reference block size, current reference zone is determined;
According to the known foreground area, the target area and the current reference zone, the static state is determined The foreground area that image includes.
As the optional realization method of another kind of the application first aspect embodiment, the determination pending image Current corresponding still image, including:
According to the complete area of the pending image, the known foreground area and the target area, institute is determined State the background area that still image includes.
As the optional realization method of another kind of the application first aspect embodiment, the determination pending image Current corresponding still image, including:
According to the size of the pending image, growth area size corresponding with the pending image is determined;
According to the position of the target area and the growth area size, current growth region is determined;
According to the known foreground area, target area and the current growth region, the still image is determined The zone of ignorance for including.
As the optional realization method of another kind of the application first aspect embodiment, the determination and the target area Corresponding target growth region, including:
Determine N number of growth district corresponding with the target area, wherein N is the positive integer more than 1;
According to N number of growth district respectively between the target area at a distance from, determine the target growth region.
The image processing method of the embodiment of the present application, by determining the currently target area in pending image, then root Pending image currently corresponding still image, and profit are determined according to known foreground area in pending image and target area Still image is handled with automatic segmentation algorithm, determines target growth corresponding with target area region, finally, according to Target growth region is updated known foreground area in pending image.Hereby it is achieved that according to user pending The target area of real-time selection in image automatically updates the known foreground area in pending image, so that with Family is not necessarily to carefully depict the boundary of area-of-interest, you can is accurately partitioned into the image that user wants, improves user's operation Convenience and flexibility promote user experience.
In order to achieve the above object, the application second aspect embodiment proposes a kind of image processing apparatus, including:
First determining module, for determining the currently target area in pending image;
Second determining module is used for according to known foreground area and the target area in the pending image, really Determine the pending image currently corresponding still image;
Processing module handles the still image, determines and the target area for utilizing automatic segmentation algorithm The corresponding target growth region in domain;
Update module, for according to the target growth region, to known foreground area in the pending image into Row update.
As the optional realization method of another kind of the application second aspect embodiment, described device further includes:
Known region determining module determines the known foreground for carrying out main body identification to the pending image Region;Alternatively, being updated according to a preceding foreground area as a result, determining the known foreground area.
As the optional realization method of another kind of the application second aspect embodiment, second determining module is specifically used In:
According to the size of the pending image, reference block size corresponding with the pending image is determined;
According to the position of the target area and the reference block size, current reference zone is determined;
According to the known foreground area, the target area and the current reference zone, wait locating described in determination Manage the image foreground area that currently corresponding still image includes.
As the optional realization method of another kind of the application second aspect embodiment, second determining module is specifically used In:
According to the complete area of the pending image, the known foreground area and the target area, institute is determined State the background area that still image includes.
As the optional realization method of another kind of the application second aspect embodiment, second determining module is specifically gone back For:
According to the size of the pending image, growth area size corresponding with the pending image is determined;
According to the position of the target area and the growth area size, current growth region is determined;
According to the known foreground area, target area and the current growth region, the still image is determined The zone of ignorance for including.
As the optional realization method of another kind of the application second aspect embodiment, the processing module, including:
Determination unit, for determining N number of growth district corresponding with the target area, wherein N is just whole more than 1 Number;
Screening unit, for according to N number of growth district respectively between the target area at a distance from, determine the mesh Mark growth district.
The image processing apparatus of the embodiment of the present application, by determining the currently target area in pending image, then root Pending image currently corresponding still image, and profit are determined according to known foreground area in pending image and target area Still image is handled with automatic segmentation algorithm, determines target growth corresponding with target area region, finally, according to Target growth region is updated known foreground area in pending image.Hereby it is achieved that according to user pending The target area of real-time selection in image automatically updates the known foreground area in pending image, so that with Family is not necessarily to carefully depict the boundary of area-of-interest, you can is accurately partitioned into the image that user wants, improves user's operation Convenience and flexibility promote user experience.
In order to achieve the above object, the application third aspect embodiment proposes a kind of electronic equipment, including:Shell, processor, Memory, circuit board and power circuit, wherein circuit board is placed in the space interior that shell surrounds, and processor and memory are set It sets on circuit boards;Power circuit, for being each circuit or the device power supply of above-mentioned electronic equipment;Memory can for storing Execute program code;Processor is run by reading the executable program code stored in memory and executable program code Corresponding program, for realizing the image processing method as described in first aspect embodiment.
In order to achieve the above object, the application fourth aspect embodiment proposes a kind of non-transitory computer-readable storage medium Matter is stored thereon with computer program, is realized when which is executed by processor at the image as described in first aspect embodiment Reason method.
In order to achieve the above object, the 5th aspect embodiment of the application proposes a kind of computer program product, when the calculating The image processing method as described in first aspect embodiment is realized when instruction in machine program product is executed by processor.
The additional aspect of the application and advantage will be set forth in part in the description, and will partly become from the following description It obtains obviously, or recognized by the practice of the application.
Description of the drawings
The application is above-mentioned and/or additional aspect and advantage will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, wherein:
A kind of flow diagram for image processing method that Fig. 1 is provided by the embodiment of the present application;
Fig. 2 is the exemplary plot of Trimap images;
The flow diagram for another image processing method that Fig. 3 is provided by the embodiment of the present application;
Fig. 4 is the determination process example figure of Trimap images;
Fig. 5 is the exemplary plot for determining target growth region;
Fig. 6 (a) is that the image processing method of the embodiment of the present application carries out the schematic diagram one of image procossing;
Fig. 6 (b) is that the image processing method of the embodiment of the present application carries out the schematic diagram two of image procossing;
Fig. 6 (c) is that the image processing method of the embodiment of the present application carries out the schematic diagram three of image procossing;
Fig. 6 (d) is that the image processing method of the embodiment of the present application carries out the schematic diagram four of image procossing;
A kind of structural schematic diagram for image processing apparatus that Fig. 7 is provided by the embodiment of the present application;
The structural schematic diagram for another image processing apparatus that Fig. 8 is provided by the embodiment of the present application;And
The structural schematic diagram for a kind of electronic equipment that Fig. 9 is provided by the embodiment of the present application.
Specific implementation mode
Embodiments herein is described below in detail, examples of the embodiments are shown in the accompanying drawings, wherein from beginning to end Same or similar label indicates same or similar element or element with the same or similar functions.Below with reference to attached The embodiment of figure description is exemplary, it is intended to for explaining the application, and should not be understood as the limitation to the application.
Below with reference to the accompanying drawings the image processing method, device, electronic equipment and medium of the embodiment of the present application are described.
A kind of flow diagram for image processing method that Fig. 1 is provided by the embodiment of the present application, this method can be applied In the electronic equipments such as smart mobile phone, tablet computer, laptop, so that user is passed through operation electronic equipment and extracted from image Go out interested region.
As shown in Figure 1, the image processing method includes the following steps:
Step 101, the currently target area in pending image is determined.
Wherein, pending image can be the image that current time user is shot by the camera of electronic equipment, also may be used To be image that user is locally loaded into from electronic equipment, for example, user can select one from the photograph album of electronic equipment includes The image of user's area-of-interest is as pending image.
In the present embodiment, target area can be the area that the part of user's area-of-interest in pending image is smeared The region that domain, i.e. user are selected in pending image, can also be the pending image by electronic equipment according to displaying, according to The region that certain rule determines, for example, electronic equipment can extend outwardly 10 since the foreground area edge having determined that The region of extension is determined as target area etc. by a pixel.The present embodiment does not limit this.
It should be noted that the foreground area in the embodiment of the present application refers to the region where main body in image, or refer to The lower region of depth of field value in image, correspondingly, background area, refers to the region in addition to main body region in image, or refer to The higher region of depth of field value.
As an example, when user want extract area-of-interest from an image when, for example, user want from The character image of oneself is extracted in one image, user can use the camera function of electronic equipment to shoot a photograph of oneself Piece selects the photo of oneself of shooting before one as pending image as pending image, or from photograph album.Then, User can utilize the brush that electronic equipment provides, or using finger as brush, to the area-of-interest in pending image It is smeared, so that electronic equipment determines the target area that user selects according to the smearing operation of user.
Herein it should be noted that user is when area-of-interest is smeared, can optionally be smeared, for example use Interested family is character image, then user can apply human face region in the pending image comprising the character image It smears, the body part of character image can also be smeared, without accurately drawing out the boundary of area-of-interest.This Outside, the mode of smearing can be picture point, can also be setting-out etc., the application is not restricted this.
Step 102, according to known foreground area and target area in pending image, determine that pending image is currently right The still image answered.
Wherein, known foreground area can be by carrying out main body identification institute really to pending image in pending image Region where fixed foreground image, for example when in pending image including personage, face recognition technology may be used from waiting for Face is identified in processing image as known foreground image, position of the face in pending image is known foreground Region.
It is operated, is carried out according to the smearing once executed before user alternatively, known foreground image can also be electronic equipment The foreground area determined after processing.That is, the process of area-of-interest is extracted for user from pending image In may include that the operation in user's selection target region more than once determines as user often selects a target area The foreground area known constantly is expanded.Then, it can determine to work as according to known foreground area and the target area currently selected Preceding still image.
Step 103, using automatic segmentation algorithm, still image is handled, determines target corresponding with target area Growth district.
In the present embodiment, after determining still image, still image can be handled using automatic segmentation algorithm, To determine target growth corresponding with target area region.
Wherein, automatic segmentation algorithm can be chosen as needed, such as can determine that target is given birth to using GrabCut algorithms Long region.GrabCut algorithms are a kind of common algorithm of image segmentation field, can be to the still image of input at Reason, determines target growth corresponding with target area region.Wherein, target growth region includes the target area of user's selection Domain.
Step 104, according to target growth region, known foreground area in pending image is updated.
It, can be according to target growth area after determining target growth region using automatic segmentation algorithm in the present embodiment Domain is updated known foreground area, obtains new known foreground area.
Further, when updated known foreground area, which does not meet user still, it is expected, user can reselect New target area, and then aforementioned step 101- steps 104 are continued to execute, until updated known foreground area meets The demand of user, user can preserve updated known foreground area, and can be that the foreground area preserved is taken With new background.
The image processing method of the present embodiment, by determining the current target area in pending image, further according to waiting for Pending image currently corresponding still image is determined in known foreground area and target area in processing image, and using certainly Dynamic partitioning algorithm handles still image, target growth corresponding with target area region is determined, finally, according to target Growth district is updated known foreground area in pending image.Hereby it is achieved that according to user in pending image The target area of middle real-time selection automatically updates the known foreground area in pending image so that user without The boundary of area-of-interest need to carefully be depicted, you can be accurately partitioned into the image that user wants, improve the convenient of user's operation Property and flexibility, promoted user experience.
In actual use, it due to generally including three pixel values in still image, according to different pixel values, can incite somebody to action Still image is divided into three foreground area, background area and zone of ignorance regions.Trimap images are a kind of common three It is worth image, the still image of the present embodiment can be Trimap images, and Fig. 2 is the exemplary plot of Trimap images.As shown in Fig. 2, Trimap images include black, white, grey three parts, wherein black portions are background area, and white portion is known foreground zone Domain, grey parts are zone of ignorance.It, can be according to certain rule, really in the embodiment of the present application after target area is determined The zone of ignorance in Trimap images is determined, with reference to Fig. 3, to determining that pending image is currently corresponding in the embodiment of the present application The specific implementation process of still image is described in detail.Another image processing method that Fig. 3 is provided by the embodiment of the present application The flow diagram of method.
As shown in figure 3, the image processing method may comprise steps of:
Step 201, the currently target area in pending image is determined.
It should be noted that may refer in previous embodiment the description of step 201 to step 101 in the present embodiment Description, details are not described herein again.
Step 202, according to known foreground area and target area in pending image, determine that pending image is currently right Foreground area, background area and the zone of ignorance that the still image answered includes.
It specifically, can be first according to the ruler of pending image when determining pending image currently corresponding foreground area It is very little, reference block size corresponding with pending image is determined, for example, can be by the size of pending image according to a certain percentage It is compressed, using the length of pending image and the wide size obtained after certain multiple that reduces as with reference to frame size.Then, according to The position of target area and reference block size, determine current reference zone.
When specific implementation, it can around extend from the position where target area and do rectangle, it is ginseng to make the size of rectangle Examine frame size.Herein it should be noted that should include target area in reference zone, cannot complete to include mesh when reference zone Region is marked when interior, allows to be adjusted reference block size so that target area can be completely contained in reference zone.Most Afterwards, according to known foreground area, target area and current reference zone, pending image currently corresponding static state is determined The foreground area that image includes.For example, the intersection of known foreground area and reference zone and target area can be determined For foreground area.
When determining pending image currently corresponding background area, can according to the complete area of pending image, The foreground area known and target area determine the pending image background area that currently corresponding still image includes.For example, It can be using the region in the complete area of pending image in addition to target area and known foreground area as background area.
When determining pending image currently corresponding zone of ignorance, can be determined first according to the size of pending image Growth corresponding with pending image area size, for example, can half will be reduced the size reduction half of pending image It is sized to growth area size afterwards.
Herein it should be noted that growth area size can be adjusted according to different needs, for example, can basis The size for the main body for including in pending image is adjusted, including so that growth region is completely included main body.Then, according to mesh Position and the growth area size for marking region, determine current growth region, wherein include target area in growth region.Most Afterwards, according to known foreground area, target area and current growth region, pending image currently corresponding static map is determined As the zone of ignorance for including.For example, can be by the region in region of growing up in addition to target area and known foreground area As zone of ignorance.By defining a growth region, determined according to known foreground area, target area and growth region Zone of ignorance can limit the conduct range of GrabCut algorithms, only carry out image segmentation in growth region, improve processing Efficiency.
Fig. 4 is the determination process example figure of Trimap images.In Fig. 4, the regions U indicate the complete area of pending image, F Region indicates that known foreground area, the regions F ' indicate that target area, Zone R domain are reference zone, and the regions S are growth region, then Foreground area is (intersection in the regions F '+Zone R domain and the regions F), and background area is (regions the U regions-F regions-F '), zone of ignorance For (regions the S regions-F regions-F ').
By the above-mentioned means, after pending image is divided into foreground area, background area and zone of ignorance, you can The pending image arrived currently corresponding still image, i.e. Trimap images.
Step 203, using automatic segmentation algorithm, to pending image, currently corresponding still image is handled, and is determined Target growth corresponding with target area region.
In the present embodiment, using the still image including foreground area, background area and zone of ignorance as GrabCut algorithms Input, utilize GrabCut algorithms, it may be determined that go out target growth corresponding with target area region.Wherein it is determined that target The range of growth district is no more than the range of zone of ignorance.Herein it should be noted that GrabCut algorithms are according to the static state of input Image determines that the process in target growth region realizes that this is not described in detail in the application automatically.
GrabCut algorithms are to carry out region division according to the pixel distribution of input picture, and GrabCut algorithms are by unknown area When domain is determined as foreground area or background area, it is understood that there may be the case where discontinuous N number of region is confirmed as same area, When the pixel in N number of discontinuous region and foreground area is same or similar, it is determined that the growth corresponding with target area gone out Region is N number of, wherein N is the positive integer more than 1.Since this N number of growth district is not all connected with target area, at this point, can To be screened to N number of growth district.Wherein, growth district be still image in it is identical as the pixel of known foreground area or Similar region, the growth district that growth district is targeted in growth district are used to carry out area to known foreground area Domain extends.
To in a kind of possible realization method of the embodiment of the present application, when determining growth corresponding with target area Region be it is N number of when, can according to N number of growth district respectively between target area at a distance from, N number of growth district is screened, Therefrom determine target growth region.For example, the minimum pixel being spaced between each growth district and target area can be counted The corresponding growth district of minimum value in N number of minimum pixel number is determined as target growth region by number.
Herein it should be noted that when determining growth district is 1, identified growth district is target growth Region.
Fig. 5 is the exemplary plot for determining target growth region.As shown in figure 5, after handling still image, determining and target There are two the corresponding growth districts in region, i.e. growth district 1 and growth district 2, wherein growth district 1 and target area F ' phases Even, the spacing between growth district 2 and target area F ' is larger, then growth district 1 is determined as target growth region.
By when there are multiple growth districts according to growth district at a distance from target area to multiple growth districts into Row screening, with determine one with target area apart from shortest target growth region, enable to the target growth area retained Spacing between domain and target area is smaller, and the growth district larger with the spacing of target area is avoided to be stranded caused by user It is puzzled, the consciousness during user's use is improved, user experience is promoted.
Step 204, according to target growth region, known foreground area in pending image is updated.
In the present embodiment, it is determined that behind target growth region, target growth region can be utilized to known foreground area It is updated, obtains updated foreground area, updated foreground area extends mesh compared to the foreground area before update Mark the range of growth district.
The image processing method of the present embodiment, by according to target area determine include foreground area, background area and The still image of zone of ignorance recycles automatic segmentation algorithm to be handled still image to obtain target growth region, in turn Known foreground area is updated using target growth region, can constantly be expanded according to the target area that user selects Foreground area reduces operation difficulty, improves without accurately depicting the boundary of target area when user selection target region Simple operation, the user experience is improved.
The image processing method that the embodiment of the present application is provided can be applied in the application program of image processing, for example, It can be applied in arbitrary image processing software, so that the image processing software can realize the functions such as the back of the body, U.S. face, filter. After the image processing method for applying the embodiment of the present application, user can only select area-of-interest by going back of the body function Partial content in the case of, rapidly extract complete area-of-interest.Fig. 6 (a)~Fig. 6 (d) is the embodiment of the present application Image processing method carry out image procossing schematic diagram.User locally can be loaded into one from electronic equipment and handle Image, or an image is shot by the camera function of electronic equipment, and after selecting " going to carry on the back " function, into such as Fig. 6 (a) Shown in interface.If user wishes to extract beauty's image in image, can be applied in the arbitrary region of beauty's image It smears, for example is smeared on the head of beauty, as shown in Fig. 6 (b), then after user smears, pass through the image of the embodiment of the present application Processing method automatically extracts out beauty's image, as shown in Fig. 6 (c).User can be that the beauty's image extracted replaces background, A new image is obtained, as shown in Fig. 6 (d).By extracting interested region and being compiled for the image extracted Volume, personalized image can be obtained, the usage experience of user is promoted.
In order to realize that above-described embodiment, the application also propose a kind of image processing apparatus.
A kind of structural schematic diagram for image processing apparatus that Fig. 7 is provided by the embodiment of the present application.
As shown in fig. 7, the image processing apparatus 80 includes:First determining module 810, the second determining module 820, processing mould Block 830 and update module 840.Wherein,
First determining module 810, for determining the currently target area in pending image.
Second determining module 820, for according to known foreground area and target area in pending image, determination to wait locating Manage image currently corresponding still image.
Processing module 830, for utilizing automatic segmentation algorithm, at pending image currently corresponding still image Reason determines target growth corresponding with target area region.
Update module 840, for according to target growth region, being carried out more to known foreground area in pending image Newly.
Further, in a kind of possible realization method of the embodiment of the present application, as shown in figure 8, implementing as shown in Figure 7 On the basis of example, which further includes:
Known region determining module 800 determines known foreground area for carrying out main body identification to pending image; Alternatively, being updated according to a preceding foreground area as a result, determining known foreground area.
Second determining module 820 is specifically used for the size according to pending image, determines ginseng corresponding with pending image Frame size is examined, and according to the position of target area and reference block size, determines current reference zone, in turn, according to known Foreground area, target area and current reference zone, before determining pending image currently corresponding still image including Scene area;And complete area, known foreground area and target area according to pending image, determine pending image The background area that current corresponding still image includes;And the size according to pending image, it determines and pending image Corresponding growth area size, and according to the position of target area and growth area size, determine current growth region, in turn According to known foreground area, target area and current growth region, pending image currently corresponding still image is determined The zone of ignorance for including.
Second determining module 820 determines the mistake for foreground area, background area and the zone of ignorance that still image includes Journey is referring to the description in relation to Fig. 4 in previous embodiment, and to avoid repeating, details are not described herein again.
GrabCut algorithms are to carry out region division according to the pixel distribution of input picture, and GrabCut algorithms are by unknown area When domain is determined as foreground area or background area, it is understood that there may be the case where discontinuous N number of region is confirmed as same area, When the pixel in N number of discontinuous region and foreground area is same or similar, it is determined that the growth corresponding with target area gone out Region is N number of, wherein N is the positive integer more than 1.There may be not connected with foreground area in determining N number of growth district Growth district may make user feel confused if will be determined as foreground area with the disjunct growth district of foreground area.To keep away Exempt from this problem, in a kind of possible realization method of the embodiment of the present application, as shown in figure 8, processing module 830 may include:
Determination unit 831, for determining N number of growth district corresponding with target area, wherein N is just whole more than 1 Number.
Screening unit 832, for according to N number of growth district respectively between target area at a distance from, determine target growth area Domain.
For example, screening unit 832 can count the minimum pixel number being spaced between each growth district and target area, The corresponding growth district of minimum value in N number of minimum pixel number is determined as target growth region.
By when there are multiple growth districts according to growth district at a distance from target area to multiple growth districts into Row screening, with determine one with target area apart from shortest target growth region, enable to the target growth area retained Spacing between domain and target area is smaller, and the growth district larger with the spacing of target area is avoided to be stranded caused by user It is puzzled, the consciousness during user's use is improved, user experience is promoted.
It should be noted that the aforementioned image for being also applied for the embodiment to the explanation of image processing method embodiment Processing unit, realization principle is similar, and details are not described herein again.
The image processing apparatus of the present embodiment, by determining the current target area in pending image, further according to waiting for Pending image currently corresponding still image is determined in known foreground area and target area in processing image, and using certainly To pending image, currently corresponding still image is handled dynamic partitioning algorithm, determines target life corresponding with target area Long region is finally updated known foreground area in pending image according to target growth region.Hereby it is achieved that According to the target area of user's real-time selection in pending image, the known foreground area in pending image is carried out automatic Update, so that user is not necessarily to carefully depict the boundary of area-of-interest, you can it accurately is partitioned into the image that user wants, Convenience and the flexibility for improving user's operation, promote user experience.
In order to realize that above-described embodiment, the application also propose a kind of electronic equipment.
The structural schematic diagram for a kind of electronic equipment that Fig. 9 is provided by the embodiment of the present application.
As shown in figure 9, the electronic equipment 100 includes:Shell 110, processor 120, memory 130, circuit board 140 and electricity Source circuit 150, wherein circuit board 140 is placed in the space interior that shell 110 surrounds, and processor 120 and memory 130 are arranged On circuit board 140;Power circuit 150, for being each circuit or the device power supply of above-mentioned electronic equipment 100;Memory 130 For storing executable program code;Processor 120 is run by reading the executable program code stored in memory 130 Program corresponding with executable program code, for realizing the image processing method as described in above-described embodiment.
It should be noted that the aforementioned electronics for being also applied for the embodiment to the explanation of image processing method embodiment Equipment, realization principle is similar, and details are not described herein again.
The electronic equipment of the present embodiment, by determining the currently target area in pending image, further according to pending Pending image currently corresponding still image is determined in known foreground area and target area in image, and utilizes automatic point Cutting algorithm, currently corresponding still image is handled to pending image, determines target growth corresponding with target area area Domain is finally updated known foreground area in pending image according to target growth region.Hereby it is achieved that according to The target area of user's real-time selection in pending image carries out automatically the more known foreground area in pending image Newly, so that user is not necessarily to carefully depict the boundary of area-of-interest, you can be accurately partitioned into the image that user wants, carry The convenience of high user's operation and flexibility promote user experience.
In order to realize that above-described embodiment, the application also propose a kind of non-transitorycomputer readable storage medium, deposit thereon Computer program is contained, which realizes image processing method as in the foregoing embodiment when being executed by processor.
In order to realize above-described embodiment, the application also proposes a kind of computer program product, when in computer program product Instruction realize image processing method as in the foregoing embodiment when being executed by processor.
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example Point is contained at least one embodiment or example of the application.In the present specification, schematic expression of the above terms are not It must be directed to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be in office It can be combined in any suitable manner in one or more embodiments or example.In addition, without conflicting with each other, the skill of this field Art personnel can tie the feature of different embodiments or examples described in this specification and different embodiments or examples It closes and combines.
In addition, term " first ", " second " are used for description purposes only, it is not understood to indicate or imply relative importance Or implicitly indicate the quantity of indicated technical characteristic.Define " first " as a result, the feature of " second " can be expressed or Implicitly include at least one this feature.In the description of the present application, the meaning of " plurality " is at least two, such as two, three It is a etc., unless otherwise restricted clearly.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes It is one or more for realizing custom logic function or process the step of executable instruction code module, segment or portion Point, and the range of the preferred embodiment of the application includes other realization, wherein can not press shown or discuss suitable Sequence, include according to involved function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be by the application Embodiment person of ordinary skill in the field understood.
Expression or logic and/or step described otherwise above herein in flow charts, for example, being considered use In the order list for the executable instruction for realizing logic function, may be embodied in any computer-readable medium, for Instruction execution system, device or equipment (system of such as computer based system including processor or other can be held from instruction The instruction fetch of row system, device or equipment and the system executed instruction) it uses, or combine these instruction execution systems, device or set It is standby and use.For the purpose of this specification, " computer-readable medium " can any can be included, store, communicating, propagating or passing Defeated program is for instruction execution system, device or equipment or the dress used in conjunction with these instruction execution systems, device or equipment It sets.The more specific example (non-exhaustive list) of computer-readable medium includes following:Electricity with one or more wiring Interconnecting piece (electronic device), portable computer diskette box (magnetic device), random access memory (RAM), read-only memory (ROM), erasable edit read-only storage (EPROM or flash memory), fiber device and portable optic disk is read-only deposits Reservoir (CDROM).In addition, computer-readable medium can even is that the paper that can print described program on it or other are suitable Medium, because can be for example by carrying out optical scanner to paper or other media, then into edlin, interpretation or when necessary with it His suitable method is handled electronically to obtain described program, is then stored in computer storage.
It should be appreciated that each section of the application can be realized with hardware, software, firmware or combination thereof.Above-mentioned In embodiment, software that multiple steps or method can in memory and by suitable instruction execution system be executed with storage Or firmware is realized.Such as, if realized in another embodiment with hardware, following skill well known in the art can be used Any one of art or their combination are realized:With for data-signal realize logic function logic gates from Logic circuit is dissipated, the application-specific integrated circuit with suitable combinational logic gate circuit, programmable gate array (PGA), scene can compile Journey gate array (FPGA) etc..
Those skilled in the art are appreciated that realize all or part of step that above-described embodiment method carries Suddenly it is that relevant hardware can be instructed to complete by program, the program can be stored in a kind of computer-readable storage medium In matter, which includes the steps that one or a combination set of embodiment of the method when being executed.
In addition, each functional unit in each embodiment of the application can be integrated in a processing module, it can also That each unit physically exists alone, can also two or more units be integrated in a module.Above-mentioned integrated mould The form that hardware had both may be used in block is realized, can also be realized in the form of software function module.The integrated module is such as Fruit is realized in the form of software function module and when sold or used as an independent product, can also be stored in a computer In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..Although having been shown and retouching above Embodiments herein is stated, it is to be understood that above-described embodiment is exemplary, and should not be understood as the limit to the application System, those skilled in the art can be changed above-described embodiment, change, replace and become within the scope of application Type.

Claims (10)

1. a kind of image processing method, which is characterized in that including:
Determine the currently target area in pending image;
According to known foreground area and the target area in the pending image, determine that the pending image is currently right The still image answered;
Using automatic segmentation algorithm, the still image is handled, determines target growth corresponding with the target area Region;
According to the target growth region, known foreground area in the pending image is updated.
2. the method as described in claim 1, which is characterized in that before the current still image of the determination, further include:
Main body identification is carried out to the pending image, determines the known foreground area;
Alternatively,
It is updated according to a preceding foreground area as a result, determining the known foreground area.
3. method as claimed in claim 2, which is characterized in that the current corresponding static map of the determination pending image Picture, including:
According to the size of the pending image, reference block size corresponding with the pending image is determined;
According to the position of the target area and the reference block size, current reference zone is determined;
According to the known foreground area, the target area and the current reference zone, the still image is determined The foreground area for including.
4. method as claimed in claim 2, which is characterized in that the current corresponding static map of the determination pending image Picture, including:
According to the complete area of the pending image, the known foreground area and the target area, determine described quiet The background area that state image includes.
5. such as claim 2-4 any one of them methods, which is characterized in that the determination pending image currently corresponds to Still image, including:
According to the size of the pending image, growth area size corresponding with the pending image is determined;
According to the position of the target area and the growth area size, current growth region is determined;
According to the known foreground area, target area and the current growth region, determines and wrapped in the still image The zone of ignorance included.
6. method as claimed in claim 5, which is characterized in that determination target growth corresponding with target area area Domain, including:
Determine N number of growth district corresponding with the target area, wherein N is the positive integer more than 1;
According to N number of growth district respectively between the target area at a distance from, determine the target growth region.
7. a kind of image processing apparatus, which is characterized in that including:
First determining module, for determining the currently target area in pending image;
Second determining module, for according to known foreground area and the target area in the pending image, determining institute State pending image currently corresponding still image;
Processing module handles the still image, determines and the target area pair for utilizing automatic segmentation algorithm The target growth region answered;
Update module, for according to the target growth region, being carried out more to known foreground area in the pending image Newly.
8. device as claimed in claim 7, which is characterized in that further include:
Known region determining module determines the known foreground area for carrying out main body identification to the pending image; Alternatively, being updated according to a preceding foreground area as a result, determining the known foreground area.
9. a kind of electronic equipment, which is characterized in that including:Shell, processor, memory, circuit board and power circuit, wherein Circuit board is placed in the space interior that shell surrounds, and processor and memory setting are on circuit boards;Power circuit, for being State each circuit or the device power supply of electronic equipment;Memory is for storing executable program code;Processor is deposited by reading The executable program code stored in reservoir runs program corresponding with executable program code, for realizing that such as right is wanted Seek the image processing method described in any one of 1-6.
10. a kind of non-transitorycomputer readable storage medium, is stored thereon with computer program, which is characterized in that the program The image processing method as described in any one of claim 1-6 is realized when being executed by processor.
CN201810277075.2A 2018-03-30 2018-03-30 Image processing method, image processing apparatus, electronic device, and medium Pending CN108550105A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810277075.2A CN108550105A (en) 2018-03-30 2018-03-30 Image processing method, image processing apparatus, electronic device, and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810277075.2A CN108550105A (en) 2018-03-30 2018-03-30 Image processing method, image processing apparatus, electronic device, and medium

Publications (1)

Publication Number Publication Date
CN108550105A true CN108550105A (en) 2018-09-18

Family

ID=63517536

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810277075.2A Pending CN108550105A (en) 2018-03-30 2018-03-30 Image processing method, image processing apparatus, electronic device, and medium

Country Status (1)

Country Link
CN (1) CN108550105A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559719A (en) * 2013-11-20 2014-02-05 电子科技大学 Interactive graph cutting method
CN105139415A (en) * 2015-09-29 2015-12-09 小米科技有限责任公司 Foreground and background segmentation method and apparatus of image, and terminal
US20170124717A1 (en) * 2015-10-28 2017-05-04 Intel Corporation Method and system of background-foreground segmentation for image processing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103559719A (en) * 2013-11-20 2014-02-05 电子科技大学 Interactive graph cutting method
CN105139415A (en) * 2015-09-29 2015-12-09 小米科技有限责任公司 Foreground and background segmentation method and apparatus of image, and terminal
US20170124717A1 (en) * 2015-10-28 2017-05-04 Intel Corporation Method and system of background-foreground segmentation for image processing

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张展鹏等: "数字抠像的最新研究进展", 《自动化学报》 *
胡亮等: "快速图像分割和抠图技术研究", 《吉林大学学报》 *

Similar Documents

Publication Publication Date Title
Chen et al. Robust image and video dehazing with visual artifact suppression via gradient residual minimization
Pu et al. A fractional-order variational framework for retinex: fractional-order partial differential equation-based formulation for multi-scale nonlocal contrast enhancement with texture preserving
Singh et al. Dehazing of remote sensing images using improved restoration model based dark channel prior
JP5508435B2 (en) Image segmentation
CN110188760A (en) A kind of image processing model training method, image processing method and electronic equipment
CN108174099A (en) Method for displaying image, device and computer readable storage medium
CN108509846A (en) Image processing method, device, computer equipment and storage medium
EP2863362B1 (en) Method and apparatus for scene segmentation from focal stack images
CN107393459A (en) Method for displaying image and device
CN107610206A (en) Dynamic picture processing method and device, storage medium and electronic equipment
CN106339993A (en) Human face image polishing method and device and terminal device
CN106447620B (en) Facial image grinds skin method, apparatus and terminal device
CN111145308A (en) Paster obtaining method and device
CN107341762A (en) Take pictures processing method, device and terminal device
CN107730461A (en) Image processing method, apparatus, device and medium
CN107665482A (en) Realize the video data real-time processing method and device, computing device of double exposure
CN110189341A (en) A kind of method, the method and device of image segmentation of Image Segmentation Model training
CN109636730A (en) Method for the dummy pixel in filter depth figure
CN107766803B (en) Video character decorating method and device based on scene segmentation and computing equipment
CN107808404A (en) Image processing method, system, readable storage medium and mobile camera equipment
CN109345536A (en) Image super-pixel segmentation method and device
EP2765555A1 (en) Image evaluation device, image selection device, image evaluation method, recording medium, and program
CN109241930B (en) Method and apparatus for processing eyebrow image
CN107341774A (en) Facial image U.S. face processing method and processing device
EP2930687B1 (en) Image segmentation using blur and color

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201123

Address after: Room 115, area C, 1 / F, building 8, yard 1, yaojiayuan South Road, Chaoyang District, Beijing 100025

Applicant after: Beijing LEMI Technology Co.,Ltd.

Address before: 100085 Beijing City, Haidian District Road 33, two floor East Xiaoying

Applicant before: BEIJING KINGSOFT INTERNET SECURITY SOFTWARE Co.,Ltd.

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20180918