CN109801252A - Picture processing method and device and electronic equipment - Google Patents

Picture processing method and device and electronic equipment Download PDF

Info

Publication number
CN109801252A
CN109801252A CN201910094113.5A CN201910094113A CN109801252A CN 109801252 A CN109801252 A CN 109801252A CN 201910094113 A CN201910094113 A CN 201910094113A CN 109801252 A CN109801252 A CN 109801252A
Authority
CN
China
Prior art keywords
picture
color
pixel
conversion treatment
binary conversion
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
CN201910094113.5A
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 CN201910094113.5A priority Critical patent/CN109801252A/en
Publication of CN109801252A publication Critical patent/CN109801252A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a picture processing method, a picture processing device and electronic equipment, wherein the method comprises the following steps: acquiring a source picture to be processed and a target color background picture; carrying out binarization processing on the source picture to obtain a first target picture; mixing the colors of the first target picture and the target color background picture according to a preset color filtering algorithm to obtain a second target picture; and displaying the second target picture. Therefore, the mode capable of automatically processing the pictures into the silhouette effect is provided, the image processing mode is high in practicability, support is provided for complex image processing at the side of the mobile terminal, and the application prospect is good.

Description

Image processing method, device and electronic equipment
Technical field
This application involves technical field of image processing more particularly to a kind of image processing methods, device and electronic equipment.
Background technique
With universal, the also more diversification of the user demand based on mobile terminal of the mobile terminals such as smart phone, for example, Picture, which is carried out, based on mobile terminal is treated as widespread demand, as shown in Figure 1, user wishes to handle in picture for outline mode, For example, the photo processing shot is outline mode, to meet the needs of its personalization etc..
In the related technology, it needs picture importing computer terminal for outline mode if user handles picture, at computer end Manual operation in end by user in picture editors' tool such as photoshop realizes, operate it is sufficiently complex, and due to upper It states picture editting and is transplanted in mobile terminal the speed that will obviously drag slow mobile terminal, thus, needing one kind can be applied to move The efficient process mode that picture can be handled as outline mode of dynamic terminal.
Apply for content
The application proposes a kind of image processing method, device and electronic equipment, to solve in the prior art to handle picture It needs to rely on the photo-editing software of computer terminal for outline mode, causes to operate the low technology of impetuous treatment effeciency and ask Topic.
The application one side embodiment proposes a kind of image processing method, comprising the following steps: obtains source to be processed Picture and targeted color background picture;Binary conversion treatment is carried out to the source picture, obtains first object picture;According to default Colour filter algorithm color mixing is carried out to the first object picture and the targeted color background picture, obtain the second target figure Piece;Show second Target Photo.
The image processing method of the embodiment of the present application obtains source picture to be processed, carries out binary conversion treatment to source picture Obtain first object picture, in turn, obtain targeted color background picture, according to preset colour filter algorithm to first object picture and Targeted color background picture carries out color mixing and obtains the second Target Photo, and the second Target Photo is shown.It provides as a result, A kind of mode that can be automatically processed picture as silhouette effect, the image procossing mode practicability is stronger, is mobile terminal side Complicated image processing provides support, and application prospect is preferable.
In addition, the image processing method of the embodiment of the present application, further includes following additional technical characteristic:
Optionally, it is described to the source picture carry out binary conversion treatment, obtain first object picture before, further includes: Obtain frame material picture, wherein the frame material picture is black and white picture;The size for detecting the frame material picture is The no corresponding frame fill conditions for meeting the source picture, if the frame fill conditions is unsatisfactory for, according to the frame Fill conditions adjusts the size of the frame material picture;According to preset colour filter algorithm to the source picture and after adjusting size Frame material picture carry out color mixing.
Optionally, display second Target Photo, comprising: obtain frame material picture, wherein the frame object Material picture is black and white picture;Whether the size for detecting the frame material picture meets the corresponding frame filling of the source picture Condition adjusts the ruler of the frame material picture according to the frame fill conditions if being unsatisfactory for the frame fill conditions It is very little;Color mixing is carried out to the frame material picture after second Target Photo and adjustment size according to preset colour filter algorithm After export.
Optionally, binary conversion treatment is carried out to the source picture, obtains first object picture, comprising: obtained for described The binary conversion treatment intensity of source picture;Binary conversion treatment is carried out to the source picture according to the binary conversion treatment intensity and obtains two Value treated the first object picture.
Optionally, described that binary conversion treatment is carried out to the source picture, obtain first object picture, comprising: described in extraction The pixel brightness value of each pixel of source picture;According to pixel brightness value determination and each pixel corresponding two Value handles intensity;Two-value is carried out to each pixel according to binary conversion treatment intensity corresponding with each pixel Change processing to obtain the first object picture after binary conversion treatment.
Optionally, it is described according to preset colour filter algorithm to the first object picture and the targeted color background picture Color mixing is carried out, the second Target Photo is obtained, comprising: default equilibrium treatment is carried out to the targeted color background picture;Root The targeted color background picture after the first object picture and the default equilibrium treatment is carried out according to preset colour filter algorithm Color mixing;Obtain second Target Photo.
Optionally, it is described according to preset colour filter algorithm to the first object picture and the targeted color background picture Color mixing is carried out, obtains the second Target Photo, comprising: the black picture element in the first object picture is converted into transparent picture Element, and the transparent pixels are superimposed with the pixel of the targeted color background picture, obtain second Target Photo.
Optionally, it is described according to preset colour filter algorithm to the first object picture and the targeted color background picture Color mixing is carried out, the second Target Photo is obtained, comprising: obtains in the first object picture transparency of each pixel and the The of pixel corresponding with pixel each in the first object picture in one color-values and the targeted color background picture Two color-values;According to the preset colour filter algorithm to the corresponding transparency of each pixel, first color-values It is calculated with second color-values, obtains the color mixing value of each pixel in the first object picture;According to described each The color mixing value of pixel generates second Target Photo.
The application another aspect embodiment proposes a kind of picture processing unit, comprising: first obtains module, for obtaining Source picture and targeted color background picture to be processed;Binary processing module, for carrying out binaryzation to the source picture Processing obtains first object picture;Color mixing module, for according to preset colour filter algorithm to the first object picture and The targeted color background picture carries out color mixing, obtains the second Target Photo;Display module, for showing second mesh It marks on a map piece.
The picture processing unit of the embodiment of the present application obtains source picture to be processed, carries out binary conversion treatment to source picture Obtain first object picture, in turn, obtain targeted color background picture, according to preset colour filter algorithm to first object picture and Targeted color background picture carries out color mixing and obtains the second Target Photo, and the second Target Photo is shown.It provides as a result, A kind of mode that can be automatically processed picture as silhouette effect, the image procossing mode practicability is stronger, is mobile terminal side Complicated image processing provides support, and application prospect is preferable.
In addition, the picture processing unit of the embodiment of the present application, further includes following additional technical characteristic:
Optionally, second module is obtained, for obtaining frame material picture, wherein the frame material picture is black and white Picture;Detection module, the corresponding the frame whether size for detecting the frame material picture meets the source picture are filled out Fill condition;Module is adjusted, for adjusting the side according to the frame fill conditions when being unsatisfactory for the frame fill conditions The size of frame material picture;The color mixing module is also used to according to preset colour filter algorithm to the source picture and adjustment Frame material picture after size carries out color mixing.
Optionally, the display module, comprising: first acquisition unit, for obtaining frame material picture, wherein described Frame material picture is black and white picture;Whether detection unit, the size for detecting the frame material picture meet the source The corresponding frame fill conditions of picture;Adjustment unit, for when being unsatisfactory for the frame fill conditions, according to the frame Fill conditions adjusts the size of the frame material picture;Display unit is used for according to preset colour filter algorithm to described second Frame material picture after Target Photo and adjustment size carries out color mixing, and the mixed picture of display color.
Optionally, the binary processing module includes: second acquisition unit, is directed to the two of the source picture for obtaining Value handles intensity;First binary conversion treatment unit, for carrying out two to the source picture according to the binary conversion treatment intensity Value processing obtains the first object picture after binary conversion treatment.
Optionally, the binary processing module includes: extraction unit, for extracting each pixel of the source picture Pixel brightness value;Determination unit, for according to the determining binaryzation corresponding with each pixel of the pixel brightness value Handle intensity;Second binary conversion treatment unit, for according to binary conversion treatment intensity corresponding with each pixel to institute It states each pixel and carries out binary conversion treatment to obtain the first object picture after binary conversion treatment.
Optionally, the color mixing module, comprising: balanced unit, for being carried out to the targeted color background picture Default equilibrium treatment;First color mixing unit, for according to preset colour filter algorithm to the first object picture and described Targeted color background picture after default equilibrium treatment carries out color mixing;Third acquiring unit, for obtaining second mesh It marks on a map piece.
Optionally, the color mixing module, comprising: converting unit, for by the black in the first object picture Pixel is converted to transparent pixels;Superpositing unit, for folding the pixel of the transparent pixels and the targeted color background picture Add, obtains second Target Photo.
Optionally, the color mixing module, comprising: the 4th acquiring unit, for obtaining in the first object picture In the transparency of each pixel and the first color-values and the targeted color background picture with it is every in the first object picture Second color-values of the corresponding pixel of a pixel;Computing unit is used for according to the preset colour filter algorithm to each picture The corresponding transparency of element, first color-values and second color-values calculate, and obtain in the first object picture The color mixing value of each pixel;Second color mixing unit, for raw according to the color mixing value of each pixel At second Target Photo.
The application another aspect embodiment proposes a kind of electronic equipment, including processor and memory;Wherein, the place Reason device is corresponding with the executable program code to run by reading the executable program code stored in the memory Program, for realizing the image processing method as described in above-described embodiment.
The application another aspect embodiment proposes a kind of non-transitorycomputer readable storage medium, is stored thereon with meter Calculation machine program realizes the image processing method as described in above-described embodiment when the computer program is executed by processor.
The additional aspect of the present invention and advantage will be set forth in part in the description, and will partially become from the following description Obviously, or practice through the invention is recognized.
Detailed description of the invention
Above-mentioned and/or additional aspect and advantage of the invention will become from the following description of the accompanying drawings of embodiments Obviously and it is readily appreciated that, in which:
Fig. 1 is the picture schematic diagram according to the silhouette effect of the application one embodiment;
Fig. 2 is the flow chart according to the image processing method of the application one embodiment;
Fig. 3 is the binary conversion treatment interface schematic diagram to source picture according to the application one embodiment;
Fig. 4 is the application scenarios schematic diagram according to the image processing method of the application one embodiment;
Fig. 5 is the flow chart according to the image processing method of the application another embodiment;
Fig. 6 is the flow chart according to the image processing method of the application another embodiment;
Fig. 7 is the structural schematic diagram according to the picture processing unit of the application one embodiment;
Fig. 8 is the structural schematic diagram according to the picture processing unit of second embodiment of the application;
Fig. 9 is the structural schematic diagram according to the picture processing unit of the application third embodiment;
Figure 10 is the structural schematic diagram according to the picture processing unit of the 4th embodiment of the application;
Figure 11 is the structural schematic diagram according to the picture processing unit of the 5th embodiment of the application;
Figure 12 is the structural schematic diagram according to the picture processing unit of the 6th embodiment of the application;
Figure 13 is the structural schematic diagram according to the picture processing unit of the 7th embodiment of the application;
Figure 14 is the structural schematic diagram according to the picture processing unit of the 8th embodiment of the application;
Figure 15 shows the block diagram for being suitable for the example electronic device for being used to realize the application embodiment.
Specific embodiment
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 and electronic equipment of the embodiment of the present application are described.Wherein, the application The image processing method of embodiment, which can be applied, has various operating systems in mobile phone, personal digital assistant, wearable device etc. Portable hardware device, which can be Intelligent bracelet, smartwatch, intelligent glasses etc..
It is complicated for operation whens on computers handling picture for silhouette effect etc. to ask for what is mentioned in above-mentioned background technique Topic, this application provides one kind, and picture can be automatically processed to the mode for silhouette effect, which can apply On the mobile terminals such as mobile phone, operate convenient and quick.
Specifically, Fig. 2 is according to the flow chart of the image processing method of the application one embodiment, as shown in Fig. 2, should Method includes:
Step 101, source picture and targeted color background picture to be processed are obtained.
Step 102, binary conversion treatment is carried out to source picture, obtains first object picture.
Wherein, source picture to be processed can be user and select its picture to be processed, for example, be its favorite picture or Person is the photo etc. of shooting, which determines that final process is the profile of the global pattern of the picture of silhouette effect, for example, With continued reference to Fig. 1, when source picture is personage, the profile of the pattern of obtained silhouette effect is corresponding personage's pattern.
Specifically, source picture to be processed is obtained, binary conversion treatment is carried out to source picture first and obtains first object picture, In order to remove source picture itself color interference etc., wherein the mode of above-mentioned acquisition source picture to be processed can be use Householder is dynamic determining, is also possible to be automatically determined according to preset condition, for example, presetting the photo in specified photograph album A For source picture to be processed, then after having the photo of update in detecting photograph album A, directly using the photo newly updated as source picture It is handled.
In the present embodiment, binary conversion treatment is carried out to source picture to obtain in first object picture, remain source picture Pattern contour, wherein in view of that in some scenes, may have the different of reservation source picture detail degree to require, in this Shen In one embodiment please, the intensity of binaryzation can also be adjusted, i.e. acquisition is strong for the binary conversion treatment of source picture Degree carries out the first object picture after binary conversion treatment obtains binary conversion treatment to source picture according to binary conversion treatment intensity.
In the present embodiment, the mode for obtaining the intensity of binaryzation is different, as a kind of possible implementation, such as Fig. 3 It is shown, the binaryzation intensity adjustment control for source picture is provided, user can see correspondence for the operation of the control in real time First object picture effect, according to user adjust control position determine two-value handle intensity.
It, can be according to the adaptive matching of the pixel intensity of source picture corresponding two as alternatively possible implementation Value intensity, the i.e. pixel brightness value of each pixel of extraction source picture, for example, according to pixel brightness value determination and each picture The corresponding binary conversion treatment intensity of vegetarian refreshments, such as pixel intensity are higher, then binaryzation intensity is higher, thin to retain more pictures Section carries out binary conversion treatment to each pixel according to binary conversion treatment intensity corresponding with each pixel in turn to obtain First object picture after binary conversion treatment.
Certainly, it is contemplated that the calculating and processing that binaryzation intensity is carried out based on each pixel cause processing pressure larger, In the present embodiment, region division can also be carried out to source picture, source picture is divided into the region of predetermined number, according to each stroke Subregional pixel intensity average value determines the binary conversion treatment intensity for being directed to the region, is directed to as a result, to each region Property binary conversion treatment, mitigate system processing pressure while, remain more image details.
In addition, in embodiments herein, when obtaining source picture to be processed, targeted color background can also be obtained Picture, in embodiments herein, by targeted color background picture as the corresponding background colour of first object picture, thus The effect of outline is realized, for example, with continued reference to Fig. 1, it is corresponding to cut when targeted color background is building landscape color image In shadow effect, the background colour of personage's pattern is the corresponding color image of building landscape (color effect is not shown in figure).
Step 103, color is carried out to first object picture and targeted color background picture according to preset colour filter algorithm to mix It closes, obtains the second Target Photo.
Specifically, targeted color background picture is obtained, it is color to first object picture and target according to preset colour filter algorithm Color background picture carries out color mixing and obtains the second Target Photo, and the profile of second Target Photo is the figure of first object picture Case profile, filling content are the image content of targeted color background picture.
It is emphasized that the profile of the second Target Photo in the application reflects the profile of source picture, targeted color Background picture does not change original profile, thus, in some possible examples, after obtaining targeted color background picture, also Preset equilibrium treatment can be carried out to color background picture, so that it is adapted to first object picture, for example, to color background figure Piece carries out center crop processing etc., so that the targeted color background picture after equilibrium treatment can cover complete first mesh It marks on a map piece.
It should be noted that the mode for obtaining targeted color background picture is different, and example is such as under different application scenarios Under:
The first example:
In this example, as shown in figure 4, the preset color background picture 1-5 of custom system is previously provided to, according to user Selection, determine targeted color background picture.
Second of example:
In this example, the color background picture for obtaining user's input, using the targeted color background of user's input as mesh Mark color background picture.
The third example:
In this example, it is handled and is liked according to user's history outline, be that user matches corresponding mesh according to the preference information Mark color background picture.
4th kind of example:
In this example, user's outline demand is obtained, which corresponds to user and wish outline treated picture Application scenarios, for example apply in advertising or medium in title, it is color that corresponding target matched according to outline demand Color background picture, for example, same first object picture is directed to, if outline demand is the figure of tourism magazine, matched correspondence Targeted color background picture be background scenery picture, if outline demand be emotion magazine figure, matched corresponding mesh Marking color background picture is lovers' pattern etc..
In addition, according to the difference of application scenarios, according to preset colour filter algorithm to the first object picture and the mesh It marks color background picture and carries out color mixing, the mode for obtaining the second Target Photo is different, and example is as follows:
The first example:
In this example, the black picture element in first object picture is converted into transparent pixels, and by transparent pixels and mesh The pixel superposition of color background picture is marked, thus, it is clear that originally the black picture element position in image is by targeted color background picture Pixel filling, the pixel value of originally white pixel position remains unchanged, and forms silhouette effect, wherein every time thoroughly with one The pixel of the targeted color background picture of bright pixel superposition, can be an optional picture in targeted color background picture Element, be also possible to first object picture and targeted color background picture are carried out position in advance it is corresponding, such as by first object figure Piece is superimposed up and down with targeted color background picture, selects corresponding pixel etc. according to the corresponding relationship of upper and lower position.
Second of example:
In this example, it is color that the transparency of each pixel and the first color-values and target in first object picture are obtained Second color-values of pixel corresponding with pixel each in first object picture in color background picture, wherein with the first color-values Corresponding second color-values can be the color-values of an optional pixel in targeted color background picture, can also be with It is in advance that first object picture is corresponding with targeted color background picture progress position, such as first object picture and target is color Color background picture is superimposed up and down, selects corresponding pixel to obtain the second color-values according to the corresponding relationship of upper and lower position, according to pre- If colour filter algorithm to the corresponding transparency of each pixel, the first color-values and the second color-values calculate, obtain first object figure The color mixing value of each pixel in piece generates the second Target Photo, second mesh by the color mixing value of each pixel in turn Piece of marking on a map is the mixing figure layer for generate after color mixing by first object picture and targeted color background picture.
In this example, if preset colour filter algorithm is corresponding colour filter formula, i.e., each picture is calculated according to colour filter formula The color mixing value of element, wherein A is the first color-values in colour filter formula, and B is the second color-values, and C is and color mixing value, d It is transparency, colour filter formula are as follows:
C=d × A+ (1-d) × B;
After the color mixing value for calculating each pixel based on above-mentioned formula, second is generated by the color mixing value of each pixel Target Photo.
Step 104, the second Target Photo is shown.
For example, the second Target Photo can be inputted to the positions such as the photograph album of mobile terminal and is shown to user, it can also be real When show for selection by the user be which kind of operation the second Target Photo is carried out to, for example carry out sharing behaviour on current screen Make, save operation etc..
Further, in order to improve silhouette effect, corresponding frame can also be set for the second target image, for example set Set " frosted glass " frame, " lines " frame etc..In practical implementation, the sequence of border effect processing is different.
As a kind of possible implementation, before carrying out binary conversion treatment to source picture and obtaining first object picture, Obtain frame material picture, wherein frame material picture is black and white picture, for example is the picture of filled black, in turn, detects side Whether the size of frame material picture meets the corresponding frame fill conditions of source picture, i.e., whether meets the ratio of width to height of source picture, If conditions are not met, then adjusting the size of the frame material picture according to frame fill conditions, that is to say, that by frame material figure The size adjusting of piece is that can change the size of the frame of source picture, for example, frame material picture width is slightly larger than source figure The width of piece, for example, frame material picture height is slightly larger than the height of source picture, for another example, frame material picture width and height Degree is slightly larger than the width of source picture and height etc., in turn, according to preset colour filter algorithm to source picture and after adjusting size Frame material picture carries out color mixing, and mixed picture has border effect corresponding with frame material picture.
For example, as shown in figure 5, when the group photo that source picture is lovers and landscape, targeted color background picture is geometry (color effect is not shown in the figure) in color background picture, and frame material picture is the picture with " fluffy lines ", then first will Color mixing is carried out to the frame material picture after source picture and adjustment size according to preset colour filter algorithm, and then to source picture Binary conversion treatment is carried out, the binary conversion treatment picture with " fluffy lines " frame as shown in the rightmost side Fig. 5 is obtained, in turn, By geometry color background picture with the binary conversion treatment picture with " fluffy lines " frame according to preset colour filter algorithm process Afterwards, obtain the picture with silhouette effect in figure, should treated picture there is " fluffy lines " border effect, and remain The pattern of the group photo of lovers and landscape, filling background patterns are geometry color background picture.
As alternatively possible implementation, to source picture carry out binary conversion treatment obtain first object picture it Afterwards, frame material picture is obtained, wherein frame material picture is black and white picture, for example is the picture of filled black, in turn, inspection Whether the size for surveying frame material picture meets the corresponding frame fill conditions of the source picture, i.e., whether meets source picture The ratio of width to height, if conditions are not met, then adjusting the size of the frame material picture according to frame fill conditions, that is to say, that by side The size adjusting of frame material picture is that can change the size of the frame of source picture, for example, frame material picture width omits Greater than the width of source picture, for example, frame material picture height is slightly larger than the height of source picture, for another example, frame material picture Width and height are slightly larger than width and height of source picture etc., in turn, according to preset colour filter algorithm to the second Target Photo Color mixing is carried out with the frame material picture after adjustment size, mixed picture has side corresponding with frame material picture Frame effect.
For example, as shown in fig. 6, when the group photo that source picture is lovers and landscape, targeted color background picture is geometry (color effect is not shown in the figure) in color background picture, and frame material picture is the picture with " fluffy lines ", then obtains first Source picture to be processed is taken, binary conversion treatment is carried out to source picture and obtains first object picture, obtains targeted color background picture, Color mixing is carried out to first object picture and the targeted color background picture according to preset colour filter algorithm and obtains the second mesh It marks on a map piece, color will be carried out to the frame material picture after the second Target Photo and adjustment size according to preset colour filter algorithm and mixed It closes, obtains the picture as shown on the right side of Fig. 6 with silhouette effect, it should treated that picture has " fluffy lines " frame effect Fruit, and the pattern of the group photo of lovers and landscape is remained, filling background patterns are geometry color background picture.
It should be understood that the mode of above-mentioned realization picture silhouette effect can develop a special application program, from And fast implementing to the silhouette effect of picture can be realized in mobile phone terminal in the application program.
To sum up, the image processing method of the embodiment of the present application obtains source picture to be processed, carries out binaryzation to source picture Processing obtains first object picture, in turn, targeted color background picture is obtained, according to preset colour filter algorithm to first object figure Piece and targeted color background picture carry out color mixing and obtain the second Target Photo, and the second Target Photo is shown.It mentions as a result, A kind of mode that picture can be automatically processed as silhouette effect is supplied, the image procossing mode practicability is stronger, is mobile terminal The complicated image processing of side provides support, and application prospect is preferable.
In order to realize above-described embodiment, the embodiment of the present application proposes a kind of picture processing unit.
Fig. 7 is according to the structural schematic diagram of the picture processing unit of the application one embodiment, as shown in fig. 7, the picture Processing unit includes: the first acquisition module 10, binary processing module 20, color mixing module 30 and display module 40, wherein
First obtains module 10, for obtaining source picture and targeted color background picture to be processed.
Binary processing module 20 obtains first object picture for carrying out binary conversion treatment to source picture.
Color mixing module 30 is used for according to preset colour filter algorithm to first object picture and targeted color background picture Color mixing is carried out, the second Target Photo is obtained.
Display module 40, for showing the second Target Photo.
In one embodiment of the application, as shown in figure 8, the device further includes second on the basis of as shown in Figure 7 Obtain module 50, detection module 60, adjustment module 70, wherein
Second obtains module 50, for obtaining frame material picture, wherein frame material picture is black and white picture.
Whether detection module 60, the size for detecting frame material picture meet the corresponding frame packing of source picture Part.
Module 70 is adjusted, for adjusting frame material figure according to frame fill conditions when being unsatisfactory for frame fill conditions The size of piece.
Color mixing module 30 is also used to according to preset colour filter algorithm to the frame material after source picture and adjustment size Picture carries out color mixing.
In one embodiment of the application, as shown in figure 9, display module 40 includes the on the basis of as shown in Figure 7 One acquiring unit 41, detection unit 42, adjustment unit 43 and display unit 44, wherein
First acquisition unit 41, for obtaining frame material picture, wherein frame material picture is black and white picture.
Whether detection unit 42, the size for detecting frame material picture meet the corresponding frame packing of source picture Part.
Adjustment unit 43, for adjusting frame material figure according to frame fill conditions when being unsatisfactory for frame fill conditions The size of piece.
Output unit 44, for according to preset colour filter algorithm to the second Target Photo and adjustment size after frame material After picture carries out color mixing, and the mixed picture of display color.
In one embodiment of the application, as shown in Figure 10, on the basis of as shown in Figure 7, binary processing module 20 include second acquisition unit 21 and the first binary conversion treatment unit 22, wherein
Second acquisition unit 21, for obtaining the binary conversion treatment intensity for being directed to source picture.
First binary conversion treatment unit 22, for carrying out binary conversion treatment acquisition to source picture according to binary conversion treatment intensity First object picture after binary conversion treatment.
In one embodiment of the application, as shown in figure 11, on the basis of as shown in Figure 7, binary processing module 20 include extraction unit 23, determination unit 24 and the second binary conversion treatment unit 25, wherein
Extraction unit 23, the pixel brightness value of each pixel for extraction source picture.
Determination unit 24, for determining binary conversion treatment intensity corresponding with each pixel according to pixel brightness value.
Second binary conversion treatment unit 25, for basis binary conversion treatment intensity corresponding with each pixel to each picture Vegetarian refreshments carries out binary conversion treatment to obtain the first object picture after binary conversion treatment.
In one embodiment of the application, as shown in figure 12, on the basis of as shown in Figure 7, color mixing module 30 Including balanced unit 31, the first color mixing unit 32 and third acquiring unit 33, wherein
Balanced unit 31, for carrying out default equilibrium treatment to targeted color background picture.
First color mixing unit 32 is used for according to preset colour filter algorithm to first object picture and default equilibrium treatment Targeted color background picture afterwards carries out color mixing.
Third acquiring unit 33, for obtaining the second Target Photo.
In one embodiment of the application, as shown in figure 13, on the basis of as shown in Figure 7, color mixing module 30 Including converting unit 34 and superpositing unit 35, wherein
Converting unit 34, for the black picture element in first object picture to be converted to transparent pixels.
Superpositing unit 35 obtains the second target figure for being superimposed transparent pixels with the pixel of targeted color background picture Piece.
In one embodiment of the application, as shown in figure 14, on the basis of as shown in Figure 7, color mixing module 30 Including the 4th acquiring unit 36, computing unit 37 and the second color mixing unit 38, wherein
4th acquiring unit 36, for obtaining the transparency of each pixel and the first color-values in first object picture, with And in targeted color background picture pixel corresponding with pixel each in first object picture the second color-values.
Computing unit 37, for according to preset colour filter algorithm to the corresponding transparency of each pixel, the first color-values and Second color-values calculate, and obtain the color mixing value of each pixel in first object picture.
Second color mixing unit 38, for generating the second Target Photo according to the color mixing value of each pixel.
It should be noted that the aforementioned explanation to image processing method embodiment, is also applied for the figure of the embodiment Piece treating apparatus, therefore details are not described herein.
To sum up, the picture processing unit of the embodiment of the present application obtains source picture to be processed, carries out binaryzation to source picture Processing obtains first object picture, in turn, targeted color background picture is obtained, according to preset colour filter algorithm to first object figure Piece and targeted color background picture carry out color mixing and obtain the second Target Photo, and the second Target Photo is shown.It mentions as a result, A kind of mode that picture can be automatically processed as silhouette effect is supplied, the image procossing mode practicability is stronger, is mobile terminal The complicated image processing of side provides support, and application prospect is preferable.
In order to realize above-described embodiment, the embodiment of the present application also proposes a kind of electronic equipment, including processor and memory;
Wherein, processor is run and executable program code by reading in memory the executable program code that stores Corresponding program, for realizing the image processing method as described in above-described embodiment.
Figure 15 shows the block diagram for being suitable for the example electronic device for being used to realize the application embodiment.What Figure 15 was shown Electronic equipment 12 is only an example, should not function to the embodiment of the present application and use scope bring any restrictions.
As shown in figure 15, electronic equipment 12 is showed in the form of universal computing device.The component of electronic equipment 12 can wrap Include but be not limited to: one or more processor or processing unit 16, system storage 28 connect different system component (packets Include system storage 28 and processing unit 16) bus 18.
Bus 18 indicates one of a few class bus structures or a variety of, including memory bus or Memory Controller, Peripheral bus, graphics acceleration port, processor or the local bus using any bus structures in a variety of bus structures.It lifts For example, these architectures include but is not limited to industry standard architecture (Industry Standard Architecture;Hereinafter referred to as: ISA) bus, microchannel architecture (Micro Channel Architecture;Below Referred to as: MAC) bus, enhanced isa bus, Video Electronics Standards Association (Video Electronics Standards Association;Hereinafter referred to as: VESA) local bus and peripheral component interconnection (Peripheral Component Interconnection;Hereinafter referred to as: PCI) bus.
Electronic equipment 12 typically comprises a variety of computer system readable media.These media can be it is any can be electric The usable medium that sub- equipment 12 accesses, including volatile and non-volatile media, moveable and immovable medium.
Memory 28 may include the computer system readable media of form of volatile memory, such as random access memory Device (Random Access Memory;Hereinafter referred to as: RAM) 30 and/or cache memory 32.Electronic equipment 12 can be into One step includes other removable/nonremovable, volatile/non-volatile computer system storage mediums.Only as an example, it deposits Storage system 34 can be used for reading and writing immovable, non-volatile magnetic media, and (Figure 15 do not show, commonly referred to as " hard drive Device ").Although being not shown in Figure 15, the disk for reading and writing to removable non-volatile magnetic disk (such as " floppy disk ") can be provided Driver, and to removable anonvolatile optical disk (such as: compact disc read-only memory (Compact Disc Read Only Memory;Hereinafter referred to as: CD-ROM), digital multi CD-ROM (Digital Video Disc Read Only Memory;Hereinafter referred to as: DVD-ROM) or other optical mediums) read-write CD drive.In these cases, each driving Device can be connected according to Media Interface Connector with bus 18 by one or multi-quantity.Memory 28 may include that at least one program produces Product, the program product have one group of (for example, at least one) program module, and it is each that these program modules are configured to perform the application The function of embodiment.
Program/utility 40 with one group of (at least one) program module 42 can store in such as memory 28 In, such program module 42 include but is not limited to operating system, one or more application program, other program modules and It may include the realization of network environment in program data, each of these examples or certain combination.Program module 42 is usual Execute the function and/or method in embodiments described herein.
Electronic equipment 12 can also be with one or more external equipments 14 (such as keyboard, sensing equipment, display 24 etc.) Communication, can also be enabled a user to one or more equipment interact with the electronic equipment 12 communicate, and/or with make the electricity Any equipment (such as network interface card, modem etc.) that sub- equipment 12 can be communicated with one or more of the other calculating equipment Communication.This communication can be carried out by input/output (I/O) interface 22.Also, electronic equipment 12 can also be suitable by network Orchestration 20 and one or more network (such as local area network (Local Area Network;Hereinafter referred to as: LAN), wide area network (Wide Area Network;Hereinafter referred to as: WAN) and/or public network, for example, internet) communication.As shown, network is suitable Orchestration 20 is communicated by bus 18 with other modules of electronic equipment 12.It should be understood that although not shown in the drawings, can be in conjunction with electricity Sub- equipment 12 uses other hardware and/or software module, including but not limited to: microcode, device driver, redundancy processing are single Member, external disk drive array, RAID system, tape drive and data backup storage system etc..
Processing unit 16 by the program that is stored in system storage 28 of operation, thereby executing various function application and Data processing, such as realize the method referred in previous embodiment.
In order to realize above-described embodiment, the embodiment of the present application also proposes a kind of non-transitorycomputer readable storage medium, It is stored thereon with computer program, the image processing method as described in above-described embodiment is realized when which is 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 embodiment or examples.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 descriptive purposes only and cannot be understood as indicating or suggesting 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 specifically defined.
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 discussed suitable Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, Lai Zhihang 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 (such as computer based system, including the system of 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 ", which can be, any may include, stores, communicates, propagates or pass 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 include the following: there is the electricity of one or more wirings 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 then be edited, be interpreted or when necessary with it for example by carrying out optical scanner to paper or other media 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 their combination.Above-mentioned In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction execution system with storage Or firmware is realized.Such as, if realized with hardware in another embodiment, following skill well known in the art can be used Any one of art or their combination are realized: have for data-signal is realized the logic gates of logic function from Logic circuit is dissipated, the 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 understood that realize all or part of step that above-described embodiment method carries It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, can integrate in a processing module in each functional unit in each embodiment of the application It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as Fruit is realized and when sold or used as an independent product in the form of software function module, also can store 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, modify, replace and become within the scope of application Type.

Claims (10)

1. a kind of image processing method, which comprises the following steps:
Obtain source picture and targeted color background picture to be processed;
Binary conversion treatment is carried out to the source picture, obtains first object picture;
Color mixing is carried out to the first object picture and the targeted color background picture according to preset colour filter algorithm, is obtained Obtain the second Target Photo;
Show second Target Photo.
2. the method as described in claim 1, which is characterized in that carry out binary conversion treatment to the source picture described, obtain Before first object picture, further includes:
Obtain frame material picture, wherein the frame material picture is black and white picture;
Whether the size for detecting the frame material picture meets the corresponding frame fill conditions of the source picture, if being unsatisfactory for institute Frame fill conditions is stated, then adjusts the size of the frame material picture according to the frame fill conditions;
Color mixing is carried out to the frame material picture after the source picture and adjustment size according to preset colour filter algorithm.
3. the method as described in claim 1, which is characterized in that display second Target Photo, comprising:
Obtain frame material picture, wherein the frame material picture is black and white picture;
Whether the size for detecting the frame material picture meets the corresponding frame fill conditions of the source picture, if being unsatisfactory for institute Frame fill conditions is stated, then adjusts the size of the frame material picture according to the frame fill conditions;
It is mixed that color is carried out to the frame material picture after second Target Photo and adjustment size according to preset colour filter algorithm It closes, and the mixed picture of display color.
4. the method as described in claim 1, which is characterized in that it is described that binary conversion treatment is carried out to the source picture, obtain the One Target Photo, comprising:
Obtain the binary conversion treatment intensity for being directed to the source picture;
According to the binary conversion treatment intensity to the source picture carry out binary conversion treatment obtain after binary conversion treatment described the One Target Photo.
5. the method as described in claim 1, which is characterized in that it is described that binary conversion treatment is carried out to the source picture, obtain the One Target Photo, comprising:
Extract the pixel brightness value of each pixel of the source picture;
According to the determining binary conversion treatment intensity corresponding with each pixel of the pixel brightness value;
According to binary conversion treatment intensity corresponding with each pixel to each pixel carry out binary conversion treatment with The first object picture after obtaining binary conversion treatment.
6. the method as described in claim 1, which is characterized in that
It is described mixed to the first object picture and targeted color background picture progress color according to preset colour filter algorithm It closes, obtains the second Target Photo, comprising:
Default equilibrium treatment is carried out to the targeted color background picture;
According to preset colour filter algorithm to the targeted color Background after the first object picture and the default equilibrium treatment Piece carries out color mixing;
Obtain second Target Photo.
7. the method as described in claim 1, which is characterized in that it is described according to preset colour filter algorithm to the first object figure Piece and the targeted color background picture carry out color mixing, obtain the second Target Photo, comprising:
Black picture element in the first object picture is converted into transparent pixels, and the transparent pixels and the target are color The pixel of color background picture is superimposed, and obtains second Target Photo.
8. the method as described in claim 1, which is characterized in that it is described according to preset colour filter algorithm to the first object figure Piece and the targeted color background picture carry out color mixing, obtain the second Target Photo, comprising:
Obtain the transparency of each pixel and the first color-values and the targeted color Background in the first object picture Second color-values of pixel corresponding with pixel each in the first object picture in piece;
According to the preset colour filter algorithm to the corresponding transparency of each pixel, first color-values and described Second color-values calculate, and obtain the color mixing value of each pixel in the first object picture;
Second Target Photo is generated according to the color mixing value of each pixel.
9. a kind of picture processing unit characterized by comprising
First obtains module, for obtaining source picture and targeted color background picture to be processed;
Binary processing module obtains first object picture for carrying out binary conversion treatment to the source picture;
Color mixing module is used for according to preset colour filter algorithm to the first object picture and the targeted color Background Piece carries out color mixing, obtains the second Target Photo;
Display module, for showing second Target Photo.
10. device as claimed in claim 9, which is characterized in that further include:
Second obtains module, for obtaining frame material picture, wherein the frame material picture is black and white picture;
Whether detection module, the size for detecting the frame material picture meet the corresponding frame filling of the source picture Condition;
Module is adjusted, for adjusting the frame according to the frame fill conditions when being unsatisfactory for the frame fill conditions The size of material picture;
The color mixing module is also used to according to preset colour filter algorithm to the frame object after the source picture and adjustment size Expect that picture carries out color mixing.
CN201910094113.5A 2019-01-30 2019-01-30 Picture processing method and device and electronic equipment Pending CN109801252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910094113.5A CN109801252A (en) 2019-01-30 2019-01-30 Picture processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910094113.5A CN109801252A (en) 2019-01-30 2019-01-30 Picture processing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN109801252A true CN109801252A (en) 2019-05-24

Family

ID=66559170

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910094113.5A Pending CN109801252A (en) 2019-01-30 2019-01-30 Picture processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN109801252A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102246189A (en) * 2008-12-11 2011-11-16 皇家飞利浦电子股份有限公司 A method silhouette image representation
CN103037194A (en) * 2011-10-07 2013-04-10 韩华S&C有限公司 Communication terminal for providing silhouette function on video screen for video call and method thereof
CN103634557A (en) * 2012-08-22 2014-03-12 韩华S&C有限公司 Image processing method and apparatus for personal protection in video call
JP2015222881A (en) * 2014-05-23 2015-12-10 パナソニックIpマネジメント株式会社 Monitoring device, monitoring system and monitoring method
US20170154454A1 (en) * 2015-11-30 2017-06-01 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN108629275A (en) * 2017-03-21 2018-10-09 佳能株式会社 Image processing apparatus, the control method of image processing apparatus and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102246189A (en) * 2008-12-11 2011-11-16 皇家飞利浦电子股份有限公司 A method silhouette image representation
CN103037194A (en) * 2011-10-07 2013-04-10 韩华S&C有限公司 Communication terminal for providing silhouette function on video screen for video call and method thereof
CN103634557A (en) * 2012-08-22 2014-03-12 韩华S&C有限公司 Image processing method and apparatus for personal protection in video call
JP2015222881A (en) * 2014-05-23 2015-12-10 パナソニックIpマネジメント株式会社 Monitoring device, monitoring system and monitoring method
US20170154454A1 (en) * 2015-11-30 2017-06-01 Canon Kabushiki Kaisha Image processing apparatus and image processing method
CN108629275A (en) * 2017-03-21 2018-10-09 佳能株式会社 Image processing apparatus, the control method of image processing apparatus and storage medium

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
THOMAS PORTER: "Compositing Digital Images", 《COMPUTER GRAPHICS》 *
刘小辉: "自然背景下的抠图技术研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
刘晓敏: "《基于虹膜识别的商务会馆管理系统的实现》", 31 August 2015, 湖南师范大学出版社 *
周维维: "《Photoshop CS3数码照片处理从新手到高手(案例超值版)》", 28 February 2009, 兵器工业出版社 *
徐科,周鹏: "《金属表面质量在线检测技术》", 31 October 2016, 冶金工业出版社 *
烟台职业学院科研处: "《学海求帆 烟台职业学院优秀论文选》", 31 March 2006, 中国海洋大学出版社 *
秦建平: "《Android 编程宝典》", 31 March 2013, 北京航空航天大学出版社 *

Similar Documents

Publication Publication Date Title
US10657652B2 (en) Image matting using deep learning
US11601630B2 (en) Video processing method, electronic device, and non-transitory computer-readable medium
Howse OpenCV computer vision with python
US10031906B2 (en) Images and additional data associated with cells in spreadsheets
Zollmann et al. Image-based ghostings for single layer occlusions in augmented reality
CN104221358B (en) Unified slider control for modifying multiple image properties
US7873909B2 (en) Manipulation and merging of graphic images
US20130057566A1 (en) User interface with color themes based on input image data
WO2015148733A2 (en) Systems and methods for the real-time modification of videos and images within a social network format
US8847974B2 (en) Display processing apparatus
Grundland et al. Cross dissolve without cross fade: Preserving contrast, color and salience in image compositing
CN106462334A (en) Controlling multiple photographic adjustments with a single control
CN106447756B (en) Method and system for generating user-customized computer-generated animations
Winnemöller NPR in the Wild
CN101296290A (en) Digital image displaying method and device
CN111402385B (en) Model processing method and device, electronic equipment and storage medium
US8842913B2 (en) Saturation varying color space
US20170274285A1 (en) Method and apparatus for automating the creation of a puzzle pix playable on a computational device from a photograph or drawing
CN109801252A (en) Picture processing method and device and electronic equipment
CN113936080A (en) Rendering method and device of virtual model, storage medium and electronic equipment
Ye Application of photoshop graphics and image processing in the field of animation
Jackson Digital image compositing fundamentals
CN113935894B (en) Ink and wash style scene rendering method and equipment and storage medium
US11928757B2 (en) Partially texturizing color images for color accessibility
CN108769520A (en) Electronic device, image processing method and computer readable 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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201125

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: 20190524