CN110070499A - Image processing method, device and computer readable storage medium - Google Patents

Image processing method, device and computer readable storage medium Download PDF

Info

Publication number
CN110070499A
CN110070499A CN201910193207.8A CN201910193207A CN110070499A CN 110070499 A CN110070499 A CN 110070499A CN 201910193207 A CN201910193207 A CN 201910193207A CN 110070499 A CN110070499 A CN 110070499A
Authority
CN
China
Prior art keywords
image
luminance
picture
luminance picture
edge
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
CN201910193207.8A
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 ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910193207.8A priority Critical patent/CN110070499A/en
Publication of CN110070499A publication Critical patent/CN110070499A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/20Image enhancement or restoration using local operators
    • G06T5/30Erosion or dilatation, e.g. thinning
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics

Landscapes

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

Abstract

A kind of image processing method of the disclosure, image processing apparatus, image processing hardware device and computer readable storage medium.Wherein, which includes: to obtain luminance picture according to the corresponding luminance component of original image;Edge detection process is carried out to obtain edge image to the luminance picture;The tone images of the luminance picture are obtained according to predetermined reference image;Pencil drawing style image corresponding with the original image is generated according to the edge image and the tone images.The embodiment of the present disclosure passes through according to the corresponding luminance component of original image, obtain luminance picture, edge detection process is carried out to obtain edge image to the luminance picture again, the tone images of the luminance picture are obtained according to predetermined reference image, pencil drawing style image is generated further according to the edge image and the tone images, the technical issues of filter for solving pencil drawing style in the prior art cannot be considered in terms of effect and performance.

Description

Image processing method, device and computer readable storage medium
Technical field
This disclosure relates to a kind of technical field of image processing, more particularly to a kind of image processing method, device and calculating Machine readable storage medium storing program for executing.
Background technique
With the development of computer technology, the application range of intelligent terminal has obtained extensive raising, such as can pass through Intelligent terminal listens to music, plays game, chats on line and take pictures.For the shooting technology of intelligent terminal, pixel of taking pictures Have reached ten million pixel or more, the effect of taking pictures of clarity with higher and the mm professional camera special that matches in excellence or beauty.
At present when being taken pictures using intelligent terminal, built-in software realization tradition of taking pictures when factory not only can be used The effect of taking pictures of function can also realize tool by downloading application program (Application, referred to as are as follows: APP) from network-side There is the effect of taking pictures of additional function, such as various filtering effects may be implemented.Typically, for example pencil can be converted by image The filter of painting style lattice.
However the filter of pencil drawing style in the prior art cannot be considered in terms of effect and performance or be can only be to static map It does the processing of pencil drawing style or is that can do the processing of real-time pencil drawing style to camera video picture, but due to processing Speed is slow, ineffective.The filter of pencil drawing style can also be made using the image algorithm of deep learning in the prior art, It require that powerful GPU is used as support, even if on the background server for being equipped with high-performance GPU, it is also difficult to reach real-time Processing frame per second.In addition, the algorithm based on deep learning, needs to prepare a large amount of training datas in advance, take considerable time and people Power.
Summary of the invention
The technical issues of disclosure solves is to provide a kind of image processing method, at least to be partially solved in the prior art The filter of pencil drawing style cannot be considered in terms of the technical issues of effect and performance.In addition, also providing a kind of image processing apparatus, image Handle hardware device, computer readable storage medium and image processing terminal.
To achieve the goals above, according to one aspect of the disclosure, the following technical schemes are provided:
A kind of image processing method, comprising:
According to the corresponding luminance component of original image, the luminance picture of the original image is obtained;
Edge detection process is carried out to obtain the edge image of the luminance picture to the luminance picture;
The tone images of the luminance picture are obtained according to predetermined reference image;And
Pencil drawing style image corresponding with the original image is generated according to the edge image and the tone images.
Further, described that the luminance picture of the original image is obtained according to the corresponding luminance component of original image, packet It includes:
Color notation conversion space processing is carried out to the original image, the extract light intensity level from transformed image obtains Original intensity image;
The luminance picture of the original image is obtained according to the original intensity image.
It is further, described that the luminance picture of the original image is obtained according to the original intensity image, comprising:
Denoising is carried out to the original intensity image, obtains the luminance picture of the original image.
Further, described that edge detection process is carried out to obtain the edge graph of the luminance picture to the luminance picture Picture, comprising:
Edge detection is carried out to the luminance picture, obtains initial edge image;
The edge image is obtained according to the initial edge image.
Further, described that edge detection process is carried out to obtain the edge graph of the luminance picture to the luminance picture Picture, comprising:
Planar convolution is done using the first default matrix template and the luminance picture, obtains the first brightness of each pixel Difference value, and planar convolution is done using the second default matrix template and the luminance picture, obtain each pixel second is bright Spend difference value;
For each pixel, corresponding picture is determined according to the first luminance difference score value and the second luminance difference score value Element value, obtains the edge image of the luminance picture.
Further, described to be directed to each pixel, according to the first luminance difference score value and second brightness difference Value determines corresponding pixel value, obtains the edge image of the luminance picture, comprising:
For each pixel, the root mean square of the first luminance difference score value and the second luminance difference score value is calculated, it will The root mean square obtains the edge image of the luminance picture as corresponding pixel value.
It is further, described that the edge image is obtained according to the initial edge image, comprising:
Expansion process at least once is done to the initial edge image, the image after being expanded;
The edge image is obtained according to the image after the expansion.
Further, the image according to after the expansion obtains the edge image, comprising:
Inversion operation is carried out to the pixel value of each pixel in the image after the expansion;
The edge image is obtained according to negated pixel value.
It is further, described that edge image is obtained according to negated pixel value, comprising:
Using formula Rx,y=(1.0-Valx,y)αCalculate the α power of the negated pixel value of each pixel, wherein Valx,yFor negated pixel value, Rx,yTo calculate the pixel value after α power, α is customized parameter;
By the R of all pixels pointx,yPixel value constitutes the edge image.
Further, the tone images that the luminance picture is obtained according to predetermined reference image, comprising:
Brightness histogram matching is carried out to the luminance picture and the reference picture, obtains brightness mapping table;
Color mapping is carried out to the luminance picture according to the brightness mapping table, obtains the tone images.
Further, described that brightness histogram matching is carried out to the luminance picture and the reference picture, obtain brightness Mapping table, comprising:
Obtain the brightness histogram of the reference picture;
The Luminance Distribution of the luminance picture is adjusted, so that the histogram of the luminance picture and the reference picture is bright The degree of approximation for spending histogram is greater than preset value;
The brightness mapping table is determined according to the reference picture and luminance picture adjusted.
Further, described that lead corresponding with the original image is generated according to the edge image and the tone images Stroke style image, comprising:
Product is carried out to the edge image and the tone images, obtains black and white pencil corresponding with the original image Painting style table images.
Further, described that lead corresponding with the original image is generated according to the edge image and the tone images Stroke style image, comprising:
Luminance component is obtained according to the tone images, and color component is obtained according to the original image;
Starting color pencil drawing style image is generated according to the luminance component and the color component;And
The starting color pencil drawing style image is transformed into RGB color, is obtained corresponding with the original image Drawing with colored pencil style image.
To achieve the goals above, according to the another aspect of the disclosure, and also the following technical schemes are provided:
A kind of image processing apparatus, comprising:
Brightness separation module, for obtaining the luminance graph of the original image according to the corresponding luminance component of original image Picture;
Image processing module, for carrying out edge detection process to the luminance picture to obtain the side of the luminance picture Edge image, and obtain according to predetermined reference image the tone images of the luminance picture;And
Pencil drawing generation module, for being generated and the original image pair according to the edge image and the tone images The pencil drawing style image answered.
Further, the brightness separation module includes:
Brightness separative unit, for carrying out color notation conversion space processing to the original image, from transformed image Extract light intensity level obtains original intensity image;
Luminance picture generation unit, for obtaining the luminance picture of the original image according to the original intensity image.
Further, the luminance picture generation unit is specifically used for: denoising is carried out to the original intensity image, Obtain the luminance picture of the original image.
Further, described image processing module includes:
Edge detection unit obtains initial edge image for carrying out edge detection to the luminance picture;
Edge image generation unit, for obtaining the edge image according to the initial edge image.
Further, described image processing module is specifically used for: using the first default matrix template and the luminance picture Planar convolution is done, obtains the first luminance difference score value of each pixel, and using the second default matrix template and the luminance graph As doing planar convolution, the second luminance difference score value of each pixel is obtained;For each pixel, according to first luminance difference Score value and the second luminance difference score value determine corresponding pixel value, obtain the edge image of the luminance picture.
Further, described image processing module is specifically used for: being directed to each pixel, calculates first brightness difference The root mean square of value and the second luminance difference score value obtains the luminance picture using the root mean square as corresponding pixel value Edge image.
Further, the edge image generation unit is specifically used for: doing to the initial edge image swollen at least once Swollen processing, the image after being expanded;The edge image is obtained according to the image after the expansion.
Further, the edge image generation unit is specifically used for: to each pixel in the image after the expansion The pixel value of point carries out inversion operation;The edge image is obtained according to negated pixel value.
Further, the edge image generation unit is specifically used for: using formula Rx,y=(1.0-Valx,y)αIt calculates every The α power of a negated pixel value of pixel, wherein Valx,yFor negated pixel value, Rx,yTo calculate the picture after α power Element value, α is customized parameter;By the R of all pixels pointx,yPixel value constitutes the edge image.
Further, described image processing module includes:
Histogram Matching unit is obtained for carrying out brightness histogram matching to the luminance picture and the reference picture To brightness mapping table;
Tone images generation module is obtained for carrying out color mapping to the luminance picture according to the brightness mapping table To the tone images.
Further, the Histogram Matching unit is specifically used for: obtaining the brightness histogram of the reference picture;Adjustment The Luminance Distribution of the luminance picture, so that the histogram of the luminance picture is close with the brightness histogram of the reference picture It is greater than preset value like degree;The brightness mapping table is determined according to the reference picture and luminance picture adjusted.
Further, the pencil drawing generation module is specifically used for: carrying out to the edge image and the tone images Product obtains black and white pencil drawing style image corresponding with the original image.
Further, the pencil drawing generation module is specifically used for: obtaining luminance component, and root according to the tone images Color component is obtained according to the original image;The starting color pencil painting style is generated according to the luminance component and the color component Table images;And the starting color pencil drawing style image is transformed into RGB color space, is obtained and the original image Corresponding drawing with colored pencil style image.
To achieve the goals above, according to the another aspect of the disclosure, and also the following technical schemes are provided:
A kind of electronic equipment, comprising:
Memory, for storing non-transient computer readable instruction;And
Processor, for running the computer-readable instruction, so that the processor realizes any of the above-described figure when executing The step of as described in processing method technical solution.
To achieve the goals above, according to the another aspect of the disclosure, and also the following technical schemes are provided:
A kind of computer readable storage medium, for storing non-transient computer readable instruction, when the non-transient calculating When machine readable instruction is executed by computer, so that the computer executes described in any of the above-described image processing method technical solution The step of.
To achieve the goals above, according to the another aspect of the disclosure, and also the following technical schemes are provided:
A kind of image processing terminal, including any of the above-described image processing apparatus.
The embodiment of the present disclosure is by obtaining the luminance graph of the original image according to the corresponding luminance component of original image Picture, then edge detection process is carried out to obtain the edge image of the luminance picture, according to predetermined reference to the luminance picture Image obtains the tone images of the luminance picture, further according to the edge image and the tone images generate with it is described original The corresponding pencil drawing style image of image, the filter for solving pencil drawing style in the prior art cannot be considered in terms of effect and performance Technical problem.
Above description is only the general introduction of disclosed technique scheme, in order to better understand the technological means of the disclosure, and It can be implemented in accordance with the contents of the specification, and to allow the above and other objects, features and advantages of the disclosure can be brighter Show understandable, it is special below to lift preferred embodiment, and cooperate attached drawing, detailed description are as follows.
Detailed description of the invention
Fig. 1 is the flow diagram according to the image processing method of an embodiment of the present disclosure;
Fig. 2 is the structural schematic diagram according to the device of the image procossing of an embodiment of the present disclosure;
Fig. 3 is the structural schematic diagram according to the electronic equipment of an embodiment of the present disclosure.
Specific embodiment
Illustrate embodiment of the present disclosure below by way of specific specific example, those skilled in the art can be by this specification Disclosed content understands other advantages and effect of the disclosure easily.Obviously, described embodiment is only the disclosure A part of the embodiment, instead of all the embodiments.The disclosure can also be subject to reality by way of a different and different embodiment It applies or applies, the various details in this specification can also be based on different viewpoints and application, in the spirit without departing from the disclosure Lower carry out various modifications or alterations.It should be noted that in the absence of conflict, the feature in following embodiment and embodiment can To be combined with each other.Based on the embodiment in the disclosure, those of ordinary skill in the art are without making creative work Every other embodiment obtained belongs to the range of disclosure protection.
It should be noted that the various aspects of embodiment within the scope of the appended claims are described below.Ying Xian And be clear to, aspect described herein can be embodied in extensive diversified forms, and any specific structure described herein And/or function is only illustrative.Based on the disclosure, it will be understood by one of ordinary skill in the art that one described herein Aspect can be independently implemented with any other aspect, and can combine the two or both in these aspects or more in various ways. For example, carry out facilities and equipments in terms of any number set forth herein can be used and/or practice method.In addition, can make With other than one or more of aspect set forth herein other structures and/or it is functional implement this equipment and/or Practice the method.
It should also be noted that, diagram provided in following embodiment only illustrates the basic structure of the disclosure in a schematic way Think, component count, shape and the size when only display is with component related in the disclosure rather than according to actual implementation in schema are drawn System, when actual implementation kenel, quantity and the ratio of each component can arbitrarily change for one kind, and its assembly layout kenel can also It can be increasingly complex.
In addition, in the following description, specific details are provided for a thorough understanding of the examples.However, fields The skilled person will understand that the aspect can be practiced without these specific details.
In order to solve the technical issues of filter of pencil drawing style in the prior art cannot be considered in terms of effect and performance, the disclosure Embodiment provides a kind of image processing method.As shown in Figure 1, the image processing method mainly includes the following steps S1 to step S3.Wherein:
Step S1: according to the corresponding luminance component of original image, the luminance picture of the original image is obtained.
Wherein, original image can be the photo of shooting.
Wherein, luminance picture is the image of luminance component composition.
Specifically, need to be carried out color notation conversion space if original image is RGB image, it is corresponding bright to obtain Information is spent, and then obtains corresponding luminance picture.
Step S2: edge detection process is carried out to obtain the edge image of the luminance picture to luminance picture;
Step S3: the tone images of the luminance picture are obtained according to predetermined reference image.
Step S4: pencil drawing style image corresponding with the original image is generated according to edge image and tone images.
The present embodiment is carried out by according to the corresponding luminance component of original image, obtaining luminance picture, then to luminance picture Edge detection process obtains the color of the luminance picture according to predetermined reference image to obtain the edge image of the luminance picture It changes the line map picture, generates pencil drawing style image further according to edge image and tone images, solve pencil drawing style in the prior art Filter the technical issues of cannot be considered in terms of effect and performance.
In an alternative embodiment, step S1 is specifically included:
Step S11: to original image progress color notation conversion space processing, the extract light intensity level from transformed image, Obtain original intensity image.
Specifically, then needing to carry out color to it if original image is RGB (Red Green Blue, RGB) image Space converts to obtain corresponding luminance component, such as original image is transformed into YCbCr color space by RGB color, Wherein, conversion formula is as follows:
Y=0.257*R+0.564*G+0.098*B+16
Cb=-0.148*R-0.291*G+0.439*B+128
Cr=0.439*R-0.368*G-0.071*B+128
Wherein, it is then respectively blue component and red component that Y, which is luminance component, Cb and Cr, then Y is the brightness point extracted Amount.
Or original image is transformed into LAB color space by RGB color, wherein L is luminance component, and A, B are color Color component, A indicate the range from carmetta to green, and B indicates the range from yellow to blue, then L is the brightness point extracted Amount.
Step S12: the luminance picture of the original image is obtained according to original intensity image.
Further, step S12 includes:
Directly subsequent processing is carried out using original intensity image as the luminance picture of the original image;Or to initial bright It spends image and carries out denoising, obtain the luminance picture of the original image.
Denoising is carried out to original intensity image specifically, median filtering can be used, is made an uproar with the spiced salt eliminated in image Sound considers, the present embodiment can be used the median filter of 3*3 size, specifically face domain for the 8 of each pixel for performance Inside seek intermediate value.
In an alternative embodiment, step S2 includes:
Step S21: edge detection is carried out to luminance picture, obtains initial edge image.
Step S22: the edge image is obtained according to initial edge image.
Further, step S2 includes:
Planar convolution is done using the first default matrix template and luminance picture, obtains the first brightness difference of each pixel Value, and planar convolution is done using the second default matrix template and luminance picture, obtain the second luminance difference score value of each pixel; For each pixel, corresponding pixel value is determined according to the first luminance difference score value and the second luminance difference score value, is obtained described bright Spend the edge image of image.
Herein, in order to distinguish different default matrix templates, the default matrix template first appeared is known as here The default matrix template of subsequent appearance is known as the second default matrix template by the first default matrix template.
And in order to distinguish different luminance difference score values, the luminance difference score value first appeared is known as the first brightness difference here Value, is known as the second luminance difference score value for the luminance difference score value of subsequent appearance.
Specifically, Sobel filtering, which can be used, carries out edge detection, Sobel filtering includes two groups of matrix templates, respectively horizontal To template and vertical framework, wherein the first default matrix template can be cross form, and the second default matrix template can be vertical To template.The size of template can be 3x3, it is made planar convolution with luminance picture, can obtain transverse direction and longitudinal direction respectively Brightness difference approximation i.e. the first luminance difference score value and the second luminance difference score value.Wherein, adoptable cross form and longitudinal mould Plate is as follows:
Further, described to be directed to each pixel, according to the first luminance difference score value and second brightness difference Value determines corresponding pixel value, obtains the edge image of the luminance picture, comprising:
For each pixel, the root mean square of the first luminance difference score value and the second luminance difference score value is calculated, root mean square is made For corresponding pixel value, the edge image of the luminance picture is obtained.
Specifically, passing through formula by taking the luminance difference score value that above-mentioned formwork calculation obtains as an exampleIt calculates To the pixel value of each pixel.
Further, step S22 includes:
Expansion process at least once is done to initial edge image, the image after being expanded;It is obtained according to the image after expansion To the edge image.
Specifically, expansion is a kind of algorithm of morphological image, in the present embodiment for making image border more overstriking i.e. It becomes apparent from, is specifically as follows for each pixel of initial edge image, formula f can be used in the maximizing in 8 neighborhoodsx,y= maxx-1≤i≤x+1maxy-1≤j≤y+1Vali,jIt is calculated, wherein Vali,jIt is i, the corresponding pixel value of the pixel of j for position.? It can according to need circulation herein to execute repeatedly, the number of execution is more, and edge is thicker to be more obvious.
Further, the image according to after the expansion obtains the edge image, comprising:
Inversion operation is carried out to the pixel value of each pixel in the image after expansion;It is obtained according to negated pixel value To the edge image.
It is further, described that the edge image is obtained according to negated pixel value, comprising:
Using formula Rx,y=(1.0-Valx,y)αCalculate the α power of the negated pixel value of each pixel, wherein Valx,yFor negated pixel value, Rx,yTo calculate the pixel value after α power, α is customized parameter;By all pixels point Rx,yPixel value constitutes the edge image.
Wherein, the bigger image border α is more black.
In an alternative embodiment, step S3 includes:
Step S31: carrying out brightness histogram matching to luminance picture and the reference picture, obtains the brightness mapping Table.
Step S32: color mapping is carried out to luminance picture according to brightness mapping table, obtains the tone images.
Further, step S31 includes:
Obtain the brightness histogram of the reference picture;The Luminance Distribution for adjusting luminance picture, so that luminance picture is straight Side's figure and the degree of approximation of the brightness histogram of reference picture are greater than preset value;According to reference picture and luminance picture adjusted Determine the brightness mapping table.
Specifically, the present embodiment uses Histogram Matching, so that the variation of the histogram of luminance picture is and reference picture Histogram it is close.That is, adjustment luminance picture Luminance Distribution make it consistent with the Luminance Distribution of reference picture or It is close.For example, in same coordinate system, the overlapping area and ginseng of the brightness histogram of the histogram and reference picture of luminance picture The ratio of the gross area of the brightness histogram of image is examined, is greater than predetermined ratio value (such as 95%), that is, thinks that degree of approximation is greater than Preset value.Wherein, the histogram of reference picture is adjustable variable, and the brighter or darker image of practical entirety is as reference Figure, the luminance picture that can make are brighter or darker.
In an alternative embodiment, step S4 includes:
Product is carried out to edge image and tone images, obtains black and white pencil drawing style figure corresponding with the original image Picture.
In an alternative embodiment, step S4 includes:
Step S41: luminance component is obtained according to tone images, and color component is obtained according to original image.
Step S42: starting color pencil drawing style image is generated according to luminance component and color component.
Step S43: starting color pencil drawing style image is transformed into RGB color, is obtained and the original image Corresponding drawing with colored pencil style image.
Specifically, being converted into YCbCr color space, then corresponding color component is if original image is RGB image Cb and Cr, the then luminance component determined by above-mentioned steps then form YCbCr image by Y-component, Cb component and Cr component as Y That is starting color pencil drawing style image, then convert it to RGB color and drawing with colored pencil style image can be obtained. The conversion formula that it is used is as follows:
R=1.164* (Y-16)+1.596* (Cr-128)
G=1.164* (Y-16) -0.392* (Cb-128) -0.813* (Cr-128)
B=1.164* (Y-16)+2.017* (Cb-128)
If original image is transformed into LAB color space by RGB color, divide with the brightness that reason above-mentioned steps determine Amount is used as L * component, and LAB image can be obtained as color component in A, B, then converts it to RGB color and coloured silk can be obtained Color pencil drawing style image.
Those skilled in the art will be understood that on the basis of above-mentioned each embodiment, can also carry out obvious variant (example Such as, cited mode is combined) or equivalent replacement.
Hereinbefore, although describing each step in image processing method embodiment, ability according to above-mentioned sequence Field technique personnel it should be clear that the step in the embodiment of the present disclosure not necessarily executes in the order described above, can also with inverted order, simultaneously Other sequences such as row, intersection execute, moreover, those skilled in the art can also add other on the basis of above-mentioned steps The mode of step, these obvious variants or equivalent replacement should also be included within the protection scope of the disclosure, and details are not described herein.
It is below embodiment of the present disclosure, embodiment of the present disclosure can be used for executing embodiments of the present disclosure realization The step of, for ease of description, part relevant to the embodiment of the present disclosure is illustrated only, it is disclosed by specific technical details, it asks Referring to embodiments of the present disclosure.
In order to solve the technical issues of filter of pencil drawing style in the prior art cannot be considered in terms of effect and performance, the disclosure Embodiment provides a kind of image processing apparatus.The device can execute the step in above-mentioned image processing method embodiment.Such as Fig. 2 It is shown, the device mainly includes: brightness separation module 21, image processing module 22 and pencil drawing generation module 23;Wherein,
Brightness separation module 21 is used to obtain the luminance graph of the original image according to the corresponding luminance component of original image Picture;
Image processing module 22 is used to carry out edge detection process to the luminance picture to obtain the luminance picture Edge image, and obtain according to predetermined reference image the tone images of the luminance picture;And
Pencil drawing generation module 23 is used to be generated and the original image according to the edge image and the tone images Corresponding pencil drawing style image.
Further, the brightness separation module 21 includes: brightness separative unit 211 and luminance picture generation unit 212; Wherein,
Brightness separative unit 211 is used to carry out color notation conversion space processing to the original image, from transformed image Middle extract light intensity level obtains original intensity image;
Luminance picture generation unit 212 is used to obtain the luminance graph of the original image according to the original intensity image Picture.
Further, the luminance picture generation unit 212 is specifically used for: carrying out at denoising to the original intensity image Reason, obtains the luminance picture of the original image.
Further, described image processing module 22 includes: edge detection unit 221 and edge image generation unit 222; Wherein,
Edge detection unit 221 is used to carry out edge detection to the luminance picture, obtains initial edge image;
Edge image generation unit 222 is used to obtain the edge image according to the initial edge image.
Further, described image processing module 22 is specifically used for: using the first default matrix template and the luminance graph As doing planar convolution, the first luminance difference score value of each pixel is obtained, and using the second default matrix template and the brightness Image does planar convolution, obtains the second luminance difference score value of each pixel;For each pixel, according to first brightness Difference value and the second luminance difference score value determine corresponding pixel value, obtain the edge image of the luminance picture.
Further, described image processing module 22 is specifically used for: being directed to each pixel, calculates first luminance difference The root mean square of score value and the second luminance difference score value obtains the luminance graph using the root mean square as corresponding pixel value The edge image of picture.
Further, the edge image generation unit 222 is specifically used for: doing at least once to the initial edge image Expansion process, the image after being expanded;The edge image is obtained according to the image after the expansion.
Further, the edge image generation unit 222 is specifically used for: to each picture in the image after the expansion The pixel value of vegetarian refreshments carries out inversion operation;The edge image is obtained according to negated pixel value.
Further, the edge image generation unit 222 is specifically used for: using formula Rx,y=(1.0-Valx,y)αMeter Calculate the α power of the negated pixel value of each pixel, wherein Valx,yFor negated pixel value, Rx,yAfter calculating α power Pixel value, α is customized parameter;By the R of all pixels pointx,yPixel value constitutes the edge image.
Further, described image processing module 22 includes: Histogram Matching unit 223 and tone images generation module 224;Wherein,
Histogram Matching unit 223 is used to carry out brightness histogram matching to the luminance picture and the reference picture, Obtain brightness mapping table;
Tone images generation module 224 is used to carry out color mapping to the luminance picture according to the brightness mapping table, Obtain the tone images.
Further, the Histogram Matching unit 223 is specifically used for: obtaining the brightness histogram of the reference picture; The Luminance Distribution of the luminance picture is adjusted, so that the brightness histogram of the histogram of the luminance picture and the reference picture Degree of approximation be greater than preset value;The brightness mapping table is determined according to the reference picture and luminance picture adjusted.
Further, the pencil drawing generation module 23 is specifically used for: to the edge image and the tone images into Row product obtains black and white pencil drawing style image corresponding with the original image.
Further, the pencil drawing generation module 23 is specifically used for: luminance component is obtained according to the tone images, and Color component is obtained according to the original image;Starting color pencil drawing is generated according to the luminance component and the color component Style image;And the starting color pencil drawing style image is transformed into RGB color, is obtained and the original graph As corresponding drawing with colored pencil style image.
The detailed descriptions such as the technical effect of working principle, realization in relation to image processing apparatus embodiment can refer to aforementioned Related description in image processing method embodiment, details are not described herein.
Below with reference to Fig. 3, it illustrates the structural schematic diagrams for the electronic equipment for being suitable for being used to realize the embodiment of the present disclosure.This Electronic equipment in open embodiment can include but is not limited to such as mobile phone, laptop, digit broadcasting receiver, PDA (personal digital assistant), PAD (tablet computer), PMP (portable media player), car-mounted terminal (such as vehicle mounted guidance Terminal) etc. mobile terminal and such as number TV, desktop computer etc. fixed terminal.Electronic equipment shown in Fig. 3 An only example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in figure 3, electronic equipment may include processing unit (such as central processing unit, graphics processor etc.) 301, Random access storage can be loaded into according to the program being stored in read-only memory (ROM) 302 or from storage device 308 Program in device (RAM) 303 and execute various movements appropriate and processing.In RAM 303, it is also stored with electronic device Required various programs and data.Processing unit 301, ROM 302 and RAM 303 are connected with each other by bus 304.Input/ Output (I/O) interface 305 is also connected to bus 304.
In general, following device can connect to I/O interface 305: including such as touch screen, touch tablet, keyboard, mouse, figure As the input unit 306 of sensor, microphone, accelerometer, gyroscope etc.;Including such as liquid crystal display (LCD), loudspeaking The output device 307 of device, vibrator etc.;Storage device 308 including such as tape, hard disk etc.;And communication device 309.It is logical T unit 309 can permit electronic equipment and wirelessly or non-wirelessly be communicated with other equipment to exchange data.Although Fig. 3 is shown Electronic equipment with various devices, it should be understood that being not required for implementing or having all devices shown.It can replace Implement or have more or fewer devices in generation ground.
Particularly, in accordance with an embodiment of the present disclosure, it may be implemented as computer above with reference to the process of flow chart description Software program.For example, embodiment of the disclosure includes a kind of computer program product comprising be carried on computer-readable medium On computer program, which includes the program code for method shown in execution flow chart.In such reality It applies in example, which can be downloaded and installed from network by communication device 309, or from storage device 308 It is mounted, or is mounted from ROM 302.When the computer program is executed by processing unit 301, the embodiment of the present disclosure is executed Method in the above-mentioned function that limits.
It should be noted that the above-mentioned computer-readable medium of the disclosure can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In open, computer-readable signal media may include in a base band or as the data-signal that carrier wave a part is propagated, In carry computer-readable program code.The data-signal of this propagation can take various forms, including but not limited to Electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be computer-readable and deposit Any computer-readable medium other than storage media, the computer-readable signal media can send, propagate or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: electric wire, optical cable, RF (radio frequency) etc. are above-mentioned Any appropriate combination.
Above-mentioned computer-readable medium can be included in above-mentioned electronic equipment;It is also possible to individualism, and not It is fitted into the electronic equipment.
Above-mentioned computer-readable medium carries one or more program, when said one or multiple programs are by the electricity When sub- equipment executes, so that the electronic equipment: according to the corresponding luminance component of original image, obtaining the brightness of the original image Image;Edge detection process is carried out to obtain the edge image of the luminance picture to the luminance picture;According to predetermined reference Image obtains the tone images of the luminance picture;And it is generated and the original according to the edge image and the tone images The corresponding pencil drawing style image of beginning image.
The calculating of the operation for executing the disclosure can be write with one or more programming languages or combinations thereof Machine program code, above procedure design language include object oriented program language-such as Java, Smalltalk, C+ +, it further include conventional procedural programming language-such as " C " language or similar programming language.Program code can Fully to execute, partly execute on the user computer on the user computer, be executed as an independent software package, Part executes on the remote computer or executes on a remote computer or server completely on the user computer for part. In situations involving remote computers, remote computer can pass through the network of any kind --- including local area network (LAN) Or wide area network (WAN)-is connected to subscriber computer, or, it may be connected to outer computer (such as utilize Internet service Provider is connected by internet).
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of the module, program segment or code include one or more use The executable instruction of the logic function as defined in realizing.It should also be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it to infuse Meaning, the combination of each box in block diagram and or flow chart and the box in block diagram and or flow chart can be with holding The dedicated hardware based system of functions or operations as defined in row is realized, or can use specialized hardware and computer instruction Combination realize.
Being described in unit involved in the embodiment of the present disclosure can be realized by way of software, can also be by hard The mode of part is realized.Wherein, the title of unit does not constitute the restriction to the unit itself under certain conditions, for example, the One acquiring unit is also described as " obtaining the unit of at least two internet protocol addresses ".
Above description is only the preferred embodiment of the disclosure and the explanation to institute's application technology principle.Those skilled in the art Member is it should be appreciated that the open scope involved in the disclosure, however it is not limited to technology made of the specific combination of above-mentioned technical characteristic Scheme, while should also cover in the case where not departing from design disclosed above, it is carried out by above-mentioned technical characteristic or its equivalent feature Any combination and the other technical solutions formed.Such as features described above has similar function with (but being not limited to) disclosed in the disclosure Can technical characteristic replaced mutually and the technical solution that is formed.

Claims (16)

1. a kind of image processing method characterized by comprising
According to the corresponding luminance component of original image, the luminance picture of the original image is obtained;
Edge detection process is carried out to obtain the edge image of the luminance picture to the luminance picture;
The tone images of the luminance picture are obtained according to predetermined reference image;And
Pencil drawing style image corresponding with the original image is generated according to the edge image and the tone images.
2. obtaining the method according to claim 1, wherein described according to the corresponding luminance component of original image The luminance picture of the original image, comprising:
Color notation conversion space processing is carried out to the original image, the extract light intensity level from transformed image obtains initial Luminance picture;
The luminance picture of the original image is obtained according to the original intensity image.
3. according to the method described in claim 2, it is characterized in that, it is described obtained according to the original intensity image it is described original The luminance picture of image, comprising:
Denoising is carried out to the original intensity image, obtains the luminance picture of the original image.
4. the method according to claim 1, wherein it is described to the luminance picture carry out edge detection process with Obtain the edge image of the luminance picture, comprising:
Edge detection is carried out to the luminance picture, obtains initial edge image;
The edge image is obtained according to the initial edge image.
5. the method according to claim 1, wherein it is described to the luminance picture carry out edge detection process with Obtain the edge image of the luminance picture, comprising:
Planar convolution is done using the first default matrix template and the luminance picture, obtains the first brightness difference of each pixel Value, and planar convolution is done using the second default matrix template and the luminance picture, obtain the second luminance difference of each pixel Score value;
For each pixel, corresponding pixel is determined according to the first luminance difference score value and the second luminance difference score value Value, obtains the edge image of the luminance picture.
6. according to the method described in claim 5, it is characterized in that, described be directed to each pixel, according to first brightness Difference value and the second luminance difference score value determine corresponding pixel value, obtain the edge image of the luminance picture, comprising:
For each pixel, the root mean square of the first luminance difference score value and the second luminance difference score value is calculated, it will be described Root mean square obtains the edge image of the luminance picture as corresponding pixel value.
7. according to the method described in claim 4, it is characterized in that, described obtain the edge according to the initial edge image Image, comprising:
Expansion process at least once is done to the initial edge image, the image after being expanded;
The edge image is obtained according to the image after the expansion.
8. the method according to the description of claim 7 is characterized in that the image according to after the expansion obtains the edge Image, comprising:
Inversion operation is carried out to the pixel value of each pixel in the image after the expansion;
The edge image is obtained according to negated pixel value.
9. according to the method described in claim 8, it is characterized in that, described obtain edge image according to negated pixel value, Include:
Using formula Rx,y=(1.0-Valx,y)αCalculate the α power of the negated pixel value of each pixel, wherein Valx,yFor Negated pixel value, Rx,yTo calculate the pixel value after α power, α is customized parameter;
By the R of all pixels pointx,yPixel value constitutes the edge image.
10. the method according to claim 1, wherein described obtain the luminance graph according to predetermined reference image The tone images of picture, comprising:
Brightness histogram matching is carried out to the luminance picture and the reference picture, obtains brightness mapping table;
Color mapping is carried out to the luminance picture according to the brightness mapping table, obtains the tone images.
11. according to the method described in claim 10, it is characterized in that, it is described to the luminance picture and the reference picture into The matching of row brightness histogram, obtains brightness mapping table, comprising:
Obtain the brightness histogram of the reference picture;
The Luminance Distribution of the luminance picture is adjusted, so that the histogram of the luminance picture and the brightness of the reference picture are straight The degree of approximation of square figure is greater than preset value;
The brightness mapping table is determined according to the reference picture and luminance picture adjusted.
12. -11 described in any item methods according to claim 1, which is characterized in that described according to the edge image and described Tone images generate pencil drawing style image corresponding with the original image, comprising:
Product is carried out to the edge image and the tone images, obtains the black and white pencil painting style corresponding with the original image Table images.
13. -11 described in any item methods according to claim 1, which is characterized in that described according to the edge image and described Tone images generate pencil drawing style image corresponding with the original image, comprising:
Luminance component is obtained according to the tone images, and color component is obtained according to the original image;
Starting color pencil drawing style image is generated according to the luminance component and the color component;And
The starting color pencil drawing style image is transformed into RGB color, obtains coloured silk corresponding with the original image Color pencil drawing style image.
14. a kind of image processing apparatus characterized by comprising
Brightness separation module, for obtaining the luminance picture of the original image according to the corresponding luminance component of original image;
Image processing module, for carrying out edge detection process to the luminance picture to obtain the edge graph of the luminance picture Picture, and obtain according to predetermined reference image the tone images of the luminance picture;And
Pencil drawing generation module, it is corresponding with the original image for being generated according to the edge image and the tone images Pencil drawing style image.
15. a kind of electronic equipment, comprising:
Memory, for storing non-transient computer readable instruction;And
Processor, for running the computer-readable instruction so that the processor execute when realize according to claim 1- Image processing method described in any one of 13.
16. a kind of computer readable storage medium, for storing non-transient computer readable instruction, when the non-transient computer When readable instruction is executed by computer, so that the computer perform claim requires image procossing described in any one of 1-13 Method.
CN201910193207.8A 2019-03-14 2019-03-14 Image processing method, device and computer readable storage medium Pending CN110070499A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910193207.8A CN110070499A (en) 2019-03-14 2019-03-14 Image processing method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910193207.8A CN110070499A (en) 2019-03-14 2019-03-14 Image processing method, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110070499A true CN110070499A (en) 2019-07-30

Family

ID=67365267

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910193207.8A Pending CN110070499A (en) 2019-03-14 2019-03-14 Image processing method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110070499A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636331A (en) * 2019-09-26 2019-12-31 北京百度网讯科技有限公司 Method and apparatus for processing video
CN110956590A (en) * 2019-11-04 2020-04-03 中山市奥珀金属制品有限公司 Denoising device and method for iris image and storage medium
CN111754440A (en) * 2020-06-29 2020-10-09 苏州科达科技股份有限公司 License plate image enhancement method, system, equipment and storage medium
CN112241941A (en) * 2020-10-20 2021-01-19 北京字跳网络技术有限公司 Method, device, equipment and computer readable medium for acquiring image
CN112669227A (en) * 2020-12-16 2021-04-16 Tcl华星光电技术有限公司 Icon edge processing method and device and computer readable storage medium
WO2022199583A1 (en) * 2021-03-26 2022-09-29 影石创新科技股份有限公司 Image processing method and apparatus, computer device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915975A (en) * 2015-06-03 2015-09-16 厦门美图之家科技有限公司 Image processing method and system for simulating crayon colored drawing
CN104915976A (en) * 2015-06-03 2015-09-16 厦门美图之家科技有限公司 Image processing method and system for simulating pencil sketch
CN105374007A (en) * 2015-12-02 2016-03-02 华侨大学 Generation method and generation device of pencil drawing fusing skeleton strokes and textural features
CN105528765A (en) * 2015-12-02 2016-04-27 小米科技有限责任公司 Method and device for processing image
CN108682040A (en) * 2018-05-21 2018-10-19 努比亚技术有限公司 A kind of sketch image generation method, terminal and computer readable storage medium
CN109300099A (en) * 2018-08-29 2019-02-01 努比亚技术有限公司 A kind of image processing method, mobile terminal and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104915975A (en) * 2015-06-03 2015-09-16 厦门美图之家科技有限公司 Image processing method and system for simulating crayon colored drawing
CN104915976A (en) * 2015-06-03 2015-09-16 厦门美图之家科技有限公司 Image processing method and system for simulating pencil sketch
CN105374007A (en) * 2015-12-02 2016-03-02 华侨大学 Generation method and generation device of pencil drawing fusing skeleton strokes and textural features
CN105528765A (en) * 2015-12-02 2016-04-27 小米科技有限责任公司 Method and device for processing image
CN108682040A (en) * 2018-05-21 2018-10-19 努比亚技术有限公司 A kind of sketch image generation method, terminal and computer readable storage medium
CN109300099A (en) * 2018-08-29 2019-02-01 努比亚技术有限公司 A kind of image processing method, mobile terminal and computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
何东健: "《数字图像处理》", 28 February 2015, 西安电子科技大学出版社 *
刘国华: "《HALCON数字图像处理》", 31 May 2018, 西安电子科技大学出版社 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110636331A (en) * 2019-09-26 2019-12-31 北京百度网讯科技有限公司 Method and apparatus for processing video
CN110956590A (en) * 2019-11-04 2020-04-03 中山市奥珀金属制品有限公司 Denoising device and method for iris image and storage medium
CN110956590B (en) * 2019-11-04 2023-11-17 张杰辉 Iris image denoising device, method and storage medium
CN111754440A (en) * 2020-06-29 2020-10-09 苏州科达科技股份有限公司 License plate image enhancement method, system, equipment and storage medium
CN112241941A (en) * 2020-10-20 2021-01-19 北京字跳网络技术有限公司 Method, device, equipment and computer readable medium for acquiring image
CN112241941B (en) * 2020-10-20 2024-03-22 北京字跳网络技术有限公司 Method, apparatus, device and computer readable medium for acquiring image
CN112669227A (en) * 2020-12-16 2021-04-16 Tcl华星光电技术有限公司 Icon edge processing method and device and computer readable storage medium
CN112669227B (en) * 2020-12-16 2023-10-17 Tcl华星光电技术有限公司 Icon edge processing method, icon edge processing device and computer readable storage medium
WO2022199583A1 (en) * 2021-03-26 2022-09-29 影石创新科技股份有限公司 Image processing method and apparatus, computer device, and storage medium

Similar Documents

Publication Publication Date Title
CN110070499A (en) Image processing method, device and computer readable storage medium
CN109584180A (en) Face image processing process, device, electronic equipment and computer storage medium
CN108229279A (en) Face image processing process, device and electronic equipment
CN110062176A (en) Generate method, apparatus, electronic equipment and the computer readable storage medium of video
CN110047124A (en) Method, apparatus, electronic equipment and the computer readable storage medium of render video
CN109087377B (en) Method and apparatus for handling image
CN110047122A (en) Render method, apparatus, electronic equipment and the computer readable storage medium of image
US11409794B2 (en) Image deformation control method and device and hardware device
CN110084154A (en) Render method, apparatus, electronic equipment and the computer readable storage medium of image
WO2023093291A1 (en) Image processing method and apparatus, computer device, and computer program product
CN110070495A (en) Processing method, device and the electronic equipment of image
CN110070896A (en) Image processing method, device, hardware device
CN111080806B (en) Mapping processing method and device, electronic equipment and storage medium
US20240104810A1 (en) Method and apparatus for processing portrait image
CN110070515A (en) Image composition method, device and computer readable storage medium
CN110363753A (en) Image quality measure method, apparatus and electronic equipment
CN110069974A (en) Bloom image processing method, device and electronic equipment
CN110062157A (en) Render method, apparatus, electronic equipment and the computer readable storage medium of image
CN110288521A (en) Image beautification method, device and electronic equipment
CN110070555A (en) Image processing method, device, hardware device
CN110070585A (en) Image generating method, device and computer readable storage medium
CN110084204A (en) Image processing method, device and electronic equipment based on target object posture
CN110069191A (en) Image based on terminal pulls deformation implementation method and device
CN110211030A (en) Image generating method and device
CN112819691B (en) Image processing method, device, equipment and 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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Tiktok vision (Beijing) Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Applicant before: Tiktok vision (Beijing) Co.,Ltd.