CN106709964A - Gradient correction and multi-direction texture extraction-based sketch generation method and device - Google Patents
Gradient correction and multi-direction texture extraction-based sketch generation method and device Download PDFInfo
- Publication number
- CN106709964A CN106709964A CN201611111134.6A CN201611111134A CN106709964A CN 106709964 A CN106709964 A CN 106709964A CN 201611111134 A CN201611111134 A CN 201611111134A CN 106709964 A CN106709964 A CN 106709964A
- Authority
- CN
- China
- Prior art keywords
- image
- gradient
- pixel
- texture
- segmentation
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 77
- 238000000605 extraction Methods 0.000 title abstract description 3
- 238000012545 processing Methods 0.000 claims abstract description 10
- 230000009466 transformation Effects 0.000 claims abstract description 8
- 230000011218 segmentation Effects 0.000 claims description 42
- 230000000877 morphologic effect Effects 0.000 claims description 26
- 238000001914 filtration Methods 0.000 claims description 21
- 238000012986 modification Methods 0.000 claims description 20
- 230000004048 modification Effects 0.000 claims description 20
- 238000010586 diagram Methods 0.000 claims description 18
- 238000002156 mixing Methods 0.000 claims description 18
- 101100129590 Schizosaccharomyces pombe (strain 972 / ATCC 24843) mcp5 gene Proteins 0.000 claims description 12
- 239000003550 marker Substances 0.000 claims description 12
- 238000003709 image segmentation Methods 0.000 claims description 10
- 101100517651 Caenorhabditis elegans num-1 gene Proteins 0.000 claims description 6
- 238000012935 Averaging Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 230000007797 corrosion Effects 0.000 claims description 3
- 238000005260 corrosion Methods 0.000 claims description 3
- 238000005530 etching Methods 0.000 claims description 3
- 230000000694 effects Effects 0.000 abstract description 12
- 239000000284 extract Substances 0.000 description 2
- 238000010421 pencil drawing Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 235000009508 confectionery Nutrition 0.000 description 1
- 238000003708 edge detection Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 238000011017 operating method Methods 0.000 description 1
- 238000003672 processing method Methods 0.000 description 1
- 238000011160 research Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/001—Texturing; Colouring; Generation of texture or colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/20—Image enhancement or restoration using local operators
- G06T5/30—Erosion or dilatation, e.g. thinning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/50—Image enhancement or restoration using two or more images, e.g. averaging or subtraction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/70—Denoising; Smoothing
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/92—Dynamic range modification of images or parts thereof based on global image properties
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20172—Image enhancement details
- G06T2207/20182—Noise reduction or smoothing in the temporal domain; Spatio-temporal filtering
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20212—Image combination
- G06T2207/20221—Image fusion; Image merging
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
The invention provides a gradient correction and multi-direction texture extraction-based sketch generation method and device. The method comprises the following steps of: carrying out grayscale transformation on an input image to obtain a grayscale image; processing the grayscale image to obtain a pre-processed image, and segmenting the pre-processed image to obtain a segmented image; carrying out gradient processing on the grayscale image to obtain gradient information; determining a texture direction of each segmented region of the segmented image according to the gradient information; generating a white noise image according to the input image; combining the texture direction of each segmented region of the segmented image and the white noise image to generate a texture map; processing the input image to obtain an outline map; and fusing the texture map and the outline map to generate a sketch. According to the method and device, multidirectional textures are used, so that the generated sketch is close to a real freehand sketch and the sketch effect is richer and more alive.
Description
Technical field
The invention belongs to technical field of image processing, and in particular to the sketch images based on gradient modification and multidirectional texture blending
Generation method and device.
Background technology
Personal dynamic renewal in circle of friends, auto heterodyne etc. of playing is it can be seen that the figure of image;Meanwhile, on the internet
Also there is substantial amounts of picture browsing, share and download, the treatment technology on image is also increasingly paid close attention to by everybody accordingly.
In the image processing arts, stylized treatment, addition of artistic effect of image etc. is all favored by everybody very much.Sketch images are figures
As manifestation mode relatively conventional and basic in art.But for the artificial creation of sketch images, must be requested that creator has necessarily
Fine arts grounding in basic skills and designed capacity, while the artistic level of individual can also largely effect on the expression effect of final sketch images.For
Some professional image processing softwares, such as Photoshop, although fairly good image processing effect can be obtained, but to making
User has certain technical capability requirement.Certainly the also comparatively laborious and complexity in operating procedure, efficiency is not also high.Therefore, borrow
Help computer and quickly and efficiently generate sketch images, with important application prospect.The fast automatic generation pencil hand of computer
Draw as having important application and recreational value.
In existing sketch images generation method, the generation method of texture is more complicated, and the speed of service is slow;And, in line
General levels sense and the comparison of light and shade effect of sketch effect cannot be effectively considered in the generation of reason.
Author is the master thesis of Dandan SUN《Pencil drawing emulation mode research based on image》Disclose a kind of answering
The method that pencil drawing texture is emulated with motion blur method.The method is it is determined that the basis of grain direction and generation white noise sound spectrogram
On, it is main to apply motion blur filter to simulate the texture of pencil.Wherein, when it is determined that texture is moved towards, a direction is selected
As main direction, it is used to embody texture trend.But, in the sketch map of single grain direction, it is easy to cause losing for information
Lose, and, it is impossible to the overall artistic conception of sketch map is highlighted well.
The content of the invention
It is an object of the invention to provide a kind of sketch images generation method based on gradient modification and multidirectional texture blending and dress
Put, the information for being used to solve caused using single grain direction in current existing sketch images generation method lost, so as to cause picture
The false problem in face.
In order to solve the above technical problems, the present invention provides a kind of sketch images life based on gradient modification and multidirectional texture blending
Into method, including nine method schemes:
Method scheme one, comprises the following steps:
1) input picture is carried out into greyscale transformation, obtains gray level image;
2) gray level image process and obtain pretreatment image, pretreatment image is carried out into image segmentation treatment, obtained
Segmentation figure;
3) gray level image is carried out into gradient treatment, obtains gradient information;According to gradient information, each of the segmentation figure is determined
The texture trend of individual cut zone;
4) white noise acoustic image is generated according to input picture;
5) the texture trend and white noise sound spectrogram of each cut zone of the segmentation figure are combined, texture maps are generated;
6) input picture is processed, is obtained profile diagram;
7) texture maps and profile diagram are merged, generates sketch map.
Method scheme two is right also including using Multiscale Morphological Opening and closing by reconstruction on the basis of method scheme one
Gray level image carries out processing the step of obtaining pretreatment image:
The Multiscale Morphological Opening and closing by reconstruction is to use various sizes of structural element, and form is carried out to gray level image
Opening and closing by reconstruction is learned, result is added and is averaging, obtain pretreatment image;
The Multi-scale model element definition is as follows:
Wherein, n is the scale parameter of mesostructure element, is a positive number, and n=3 is made in the method;B is basic structure
Element;Represent the etching operation in Morphological scale-space;Above formula is meant that big structural element is by small structural element
Constantly corrosion is obtained.
Method scheme three, on the basis of method scheme one, also including pretreatment image is carried out into watershed image segmentation
Treatment, the step of obtain segmentation figure:
Pretreatment figure is made into Morphological Gradient treatment, Morphological Gradient figure is generated;Morphological Gradient figure=pretreatment image
Expansion plans-pretreatment image etch figures;
Morphological reconstruction by opening is carried out to pretreatment figure and morphology closes reconstruction operation, make filtering, obtain filtering
Figure;
According to filtering figure, prospect mark and context marker are calculated;
According to prospect mark and context marker, Morphological Gradient figure is changed, carry out watershed segmentation, obtain segmentation figure.
Method scheme four, be on the basis of method scheme three, the step of calculating prospect mark and context marker:
The local maximum bianry image of filtering figure is asked for, morphology opening and closing fortune is made to local maximum bianry image
Calculate, smooth edges, and remove local minimum region of the number of pixels less than 20 in image, isolated pixel point is removed, before obtaining
Scape mark figure;
To filtering figure, threshold value is sought with maximum between-cluster variance Otsu methods, then carry out binaryzation, obtain bianry image;
The maximum between-cluster variance Otsu methods ask the threshold value to include:
If the tonal range of filtering figure is { 0,1,2,3......l }, the pixel count of gray scale i is ni, remember the total of image
Pixel count isGray scale is that the probability of the pixel appearance of i is:
The gray-scale pixels of image are divided into C by one threshold value t ∈ [1, l-1] of selection, threshold value t1:{0,1,2......,t}
And C2:T+1, t+2 ..., and l } two parts, C1、C2The probability of appearance is respectively:
Its corresponding average is respectively:
The overall gray level average of image is:
The maximum between-cluster variance in two regions that threshold value is got is:
Using traversal method, in the range of t ∈ [1, l-1], ask for so thatMaximum threshold value t, it is as required
Threshold value;
Carry out range conversion to bianry image, watershed segmentation, the watershed line image for obtaining is used as context marker.
Method scheme five, on the basis of method scheme one, the gradient information is the tangent value of gradient angle:
Tan θ=[Fy/Fx]
Wherein, Fx be gray level image by gradient treatment after, the Grad of the horizontal direction for obtaining;Fy is passed through for gray level image
After crossing gradient treatment, the Grad of the vertical direction for obtaining;θ is gradient angle, and tan θ are the tangent value of gradient angle.
Method scheme six, on the basis of method scheme one, the texture of each cut zone for determining segmentation figure is walked
To including:
Gradient angle tangent value corresponding to each pixel in each cut zone is compared with zero:If the ladder of pixel
Degree angle tangent value is more than zero, and the grain direction for recording this pixel is 45 degree;Otherwise, the grain direction of this pixel is recorded
It is -45 degree;I.e.:
Wherein, IinputIt is the pixel of input, NiIt is i-th cut zone, Iinput_ tan θ are the gradient tangent for being input into pixel
Value, Ioutput_ θ is the grain direction of output pixel;
Count in same cut zone, the pixel number of 45 degree of grain directions and -45 degree grain directions is recorded as respectively
Num1 and num2;I.e.:
Wherein, the initial value of num1 is:Num1=0;The initial value of num2 is:Num2=0;
Compare the size of num1 and num2:If num1 is more than num2, the grain direction of this cut zone is 45 degree;If
Num1 is less than or equal to num2, then the grain direction of this cut zone is -45 degree;I.e.:
Wherein, Ni_ θ is the grain direction of cut zone i.
Method scheme seven, on the basis of method scheme one, also including input picture is transformed into by RGB color
Hsv color space, and extract V component, with reference to segmentation figure and V component addition white noise, the step of generation white noise sound spectrogram:
The average brightness value R of each cut zone is calculated on the V component figure for extractingi, RiRepresent i-th cut zone;
The pixel and region averages in each region in luminance picture are compared, are asked for according to the following equation new
Pixel value:
T1=k1 (1-Iinput),k1∈[0,1.0]
T2=k2 (1-Iinput),k2∈[0,1.0]
Wherein, IinputTo be input into the brightness value of pixel, IoutputIt is the brightness value of output pixel;Ioutput1It is in input picture
The brightness value I of elementinputLess than or equal to the average value R of all pixels in the i of regioniWhen, the brightness value I of output pixeloutputTake
Value;Ioutput2It is the brightness value I in input pixelinputMore than the average value R of all pixels in the i of regioniWhen, output pixel it is bright
Angle value IoutputValue;Two variate-values in T1 and T2 formula;P is a random number, span:p∈(0,1);RiFor
The average brightness value of all pixels, I in the i of regionmax1、Imax2It is the maximum brightness value of output noise, usually 1;I is one normal
Number can be as needed defined by user, and I=0.2 is made in this method, and k1 and k2 are two empirical values, k1 in this method in formula
=0.7, k2=0.3.
Method scheme eight, on the basis of method scheme one, the texture maps are each cut zone for combining segmentation figure
Texture trend and white noise sound spectrogram, generation is filtered by motion blur filter.
Method scheme nine, on the basis of method scheme one, the profile diagram is that input picture is carried out into rainbow treatment life
Into.
In addition, the present invention also provides a kind of sketch images generating means based on gradient modification and multidirectional texture blending, including
Such as lower module:
For input picture to be carried out into greyscale transformation, the module of gray level image is obtained;
For by gray level image process obtaining pretreatment image, pretreatment image is carried out into image segmentation treatment, obtained
To the module of segmentation figure;
For gray level image to be carried out into gradient treatment, gradient information is obtained;According to gradient information, the segmentation figure is determined
The module of the texture trend of each cut zone;
Module for generating white noise acoustic image according to input picture;
Texture trend and white noise sound spectrogram for combining each cut zone of the segmentation figure, generate the mould of texture maps
Block;
For input picture to be processed, the module of profile diagram is obtained;
For texture maps and profile diagram to be merged, the module of sketch map is generated.
Beneficial effects of the present invention:
Input figure is carried out greyscale transformation, gradient treatment by the present invention, and image segmentation is carried out to gray-scale map, obtains segmentation figure;
According to gradient treatment and segmentation figure, grain direction is obtained;White noise is added to input picture, further according to grain direction, line is generated
Reason figure;Input figure is carried out into treatment and obtains profile diagram;By texture maps and profile diagram fusion generation sketch map.
The present invention on the basis of traditional use line integral convolution method simulation sketch images texture generating process is simplified,
Do not use the texture maps of single direction, and use multidirectional texture so that the sketch images of generation are close to real Freehandhand-drawing
Sketch effect, more have levels sense, and sketch effect more enriches and fresh and alive;And, it is determined that before grain direction, addition white noise
Image segmentation is carried out to gray level image, the region to different characteristic in image is separately processed, for the different qualities of regional
To be processed so that stereovision, the chiaroscuro effect of image more preferably, preferably express the Global Information of image.
Brief description of the drawings
Fig. 1 is flow chart of the method for the present invention;
Fig. 2 is original input picture;
Fig. 3 is gray-scale map;
Fig. 4 is the figure after Multiscale Morphological Opening and closing by reconstruction;
Fig. 5 is segmentation figure;
Fig. 6 is to add the generation figure after white noise;
Fig. 7 is the direction texture maps of synthesis;
Fig. 8 is the profile diagram for extracting;
Fig. 9 is the sketch map of generation.
Specific embodiment
Below in conjunction with the accompanying drawings, specific embodiment of the invention is described in further detail.
Sketch images generation method step based on gradient modification and multidirectional texture blending of the invention is as follows:
1st, greyscale transformation is carried out using original graph as input picture, obtains gray level image.
2nd, Multiscale Morphological Opening and closing by reconstruction is used, gray-scale map process to obtain pretreatment image.
Multiscale Morphological Opening and closing by reconstruction is to use various sizes of structural element, and carrying out morphology to gray level image opens
Reconstruction computing is closed, result is added and is averaging, obtain pretreatment image.In Multiscale Morphological Opening and closing by reconstruction,
Multi-scale model element definition is as follows:
Wherein, n is the scale parameter of mesostructure element, is a positive number, and n=3 is made in the method;B is basic structure
Element;Represent the etching operation in Morphological scale-space;Above formula is meant that big structural element is by small structural element
Constantly corrosion is obtained.
3rd, to pretreated image, the watershed image segmentation treatment based on mark is carried out, obtains segmentation figure, specific step
It is rapid as follows:
1) pretreatment figure is made into Morphological Gradient treatment, generates Morphological Gradient figure;
Wherein, the etch figures of the expansion plans-pretreatment image of Morphological Gradient figure=pretreatment image;
2) morphological reconstruction by opening is carried out to pretreatment figure and morphology closes reconstruction operation, make filtering, obtain filtering flat
Sliding figure;
3) according to filtering figure, prospect mark and context marker are calculated;
The local maximum bianry image of filtering figure is asked for, morphology opening and closing fortune is made to local maximum bianry image
Calculate, smooth edges, and remove local minimum region of the number of pixels less than 20 in image, isolated pixel point is removed, before obtaining
Scape mark figure.
To filtering figure, threshold value is sought with maximum between-cluster variance Otsu methods, then carry out binaryzation, obtain bianry image.
Maximum between-cluster variance Otsu methods ask the process of threshold value as follows:
If the tonal range of filtering figure is { 0,1,2,3......l }, the pixel count of gray scale i is ni, remember the total of image
Pixel count isGray scale is that the probability of the pixel appearance of i is:
The gray-scale pixels of image are divided into C by one threshold value t ∈ [1, l-1] of selection, threshold value t1:{0,1,2......,t}
And C2:T+1, t+2 ..., and l } two parts, C1、C2The probability of appearance is respectively:
Its corresponding average is respectively:
The overall gray level average of image is:
The maximum between-cluster variance in two regions that threshold value is got is:
Using traversal method, in the range of t ∈ [1, l-1], ask for so thatMaximum threshold value t, it is as required
Threshold value.
Carry out range conversion to bianry image, watershed segmentation, the watershed line image for obtaining is used as context marker.
4) according to prospect mark and context marker, Morphological Gradient figure is changed, carries out watershed segmentation.Use mandatory modification skill
The gradient map that art modification second step is obtained, prospect mark and context marker that the 4th step is obtained, as the mark of watershed segmentation,
Watershed segmentation is carried out, segmentation figure is obtained.Areal after statistics segmentation, and eliminate cut-off rule using medium filtering.
4th, carry out gradient treatment to gray level image, the Grad for remembering the horizontal direction of gray-scale map is Fx, gray-scale map it is vertical
The Grad in direction is Fy, asks for the tangent value of gradient angle:
Tan θ=[Fy/Fx]
Wherein, Fx be gray level image by after gradient treatment, the Grad of horizontal direction that obtains;Fy is passed through for gray level image
After crossing gradient treatment, the Grad of vertical direction that obtains;θ is gradient angle, and tan θ are the tangent value of gradient angle.
5th, according to the result of upper step gradient treatment, the texture method of each cut zone is obtained.Grain direction is performance element
Retouch the important means of information, between relatively conventional grain direction is 30 degree to 60 degree in the sketch images of reality or -30 degree extremely -
Between 60 degree;Herein by experiment and contrast, have selected 45 degree and -45 and spend as the direction of texture.Specific method is:
1) the gradient angle tangent value corresponding to each pixel in each cut zone is compared with zero:If pixel
Gradient angle tangent value is more than zero, and the grain direction for recording this pixel is 45 degree;Otherwise, the grain direction of this pixel is recorded
It is -45 degree;I.e.:
Wherein, IinputIt is the pixel of input, NiIt is i-th cut zone, Iinput_ tan θ are the gradient tangent for being input into pixel
Value, Ioutput_ θ is the grain direction of output pixel;
2) count in same cut zone, the pixel number of 45 degree of grain directions and -45 degree grain directions is recorded respectively
It is num1 and num2;I.e.:
Wherein, the initial value of num1 is:Num1=0;The initial value of num2 is:Num2=0;
3) size of num1 and num2 is compared:If num1 is more than num2, the grain direction of this cut zone is 45 degree;If
Num1 is less than or equal to num2, then the grain direction of this cut zone is -45 degree;I.e.:
Wherein, Ni_ θ is the grain direction of cut zone i.
6th, input picture is transformed into hsv color space by RGB color, and extracts V component figure;With reference to segmentation figure and
V component figure, generates white noise acoustic image.White noise adding method is:
1) the average brightness value R of each cut zone is calculated on the V component figure for extractingi, RiRepresent i-th cut zone;
2) pixel and region averages in each region in luminance picture are compared, are asked for according to the following equation new
Pixel value:
T1=k1 (1-Iinput),k1∈[0,1.0]
T2=k2 (1-Iinput),k2∈[0,1.0]
Wherein, IinputTo be input into the brightness value of pixel, IoutputIt is the brightness value of output pixel;Ioutput1It is in input picture
The brightness value I of elementinputLess than or equal to the average value R of all pixels in the i of regioniWhen, the brightness value I of output pixeloutputTake
Value;Ioutput2It is the brightness value I in input pixelinputMore than the average value R of all pixels in the i of regioniWhen, output pixel it is bright
Angle value IoutputValue;Two variate-values in T1 and T2 formula;P is a random number, span:p∈(0,1);RiFor
The average brightness value of all pixels, I in the i of regionmax1、Imax2It is the maximum brightness value of output noise, usually 1;I is one normal
Number can be as needed defined by user, and I=0.2 is made in this method, and k1 and k2 are two empirical values, k1 in this method in formula
=0.7, k2=0.3.
3) image after white noise will be added and is divided into 45 degree of white noise sound spectrograms of grain direction and -45 degree lines by grain direction
Manage the white noise sound spectrogram in direction.The hollow white region of white noise sound spectrogram obtained by segmentation is filled with white.
7th, the texture trend and white noise sound spectrogram of each cut zone according to segmentation figure, are filtered by motion blur filter
Ripple generates texture maps.
Motion blur (Motion Blur) filter is a kind of effects filters for capturing object moving state, along specific
Direction simultaneously carries out Fuzzy Processing with certain strength to image.The motion blur effect and pencil texture produced by motion filters have
Good similitude, the texture of pencil is simulated using the method.
Generation is filtered using motion blur filter respectively to the white noise sound spectrogram after segmentation.Wherein, generation motion filter
Code of the predefined template of ripple device in MATLAB be:
H=fspecial (' motion', len, phi)
Wherein, phi is the filtering direction of anti-motion blur filter, takes grain direction;Len is the intensity of motion filtering, takes len
=10;With the predefined template of motion filters, the white noise sound spectrogram after segmentation is filtered.
8th, input figure is carried out into rainbow treatment, obtains profile diagram.
9th, by anti-motion blur filter after two width direction texture maps, i.e. texture maps and profile diagram carry out the dot product of image, melt
Symphysis is into final texture maps.
In the present embodiment, the profile diagram of sketch image is obtained using rainbow processing method;As other embodiment, also
The edge detection operator based on first derivative can be used, an input picture is detected by calculating the Grad of image
Profile, such as Candy operators, Sobel operators, Prewitt operators, to realize the extraction to input picture profile.
In addition, the present invention also provides a kind of sketch images generating means based on gradient modification and multidirectional texture blending, including
Such as lower module:
For input picture to be carried out into greyscale transformation, the module of gray level image is obtained;
For by gray level image process obtaining pretreatment image, pretreatment image is carried out into image segmentation treatment, obtained
To the module of segmentation figure;
For gray level image to be carried out into gradient treatment, gradient information is obtained;According to gradient information, the segmentation figure is determined
The module of the texture trend of each cut zone;
Module for generating white noise acoustic image according to input picture;
Texture trend and white noise sound spectrogram for combining each cut zone of the segmentation figure, generate the mould of texture maps
Block;
For input picture to be processed, the module of profile diagram is obtained;
For texture maps and profile diagram to be merged, the module of sketch map is generated.
The above-mentioned sketch images generating means based on gradient modification and multidirectional texture blending, are actually based on present invention correspondence
A kind of computer solution of method flow, i.e., a kind of software architecture, above-mentioned various modules are corresponding with method flow
Each treatment progress or program.Because the sufficiently clear of the introduction to the above method is complete, therefore no longer the device is carried out in detail
Thin description.
Claims (10)
1. the sketch images generation method of gradient modification and multidirectional texture blending is based on, it is characterised in that comprised the following steps:
1) input picture is carried out into greyscale transformation, obtains gray level image;
2) gray level image process and obtain pretreatment image, pretreatment image is carried out into image segmentation treatment, split
Figure;
3) gray level image is carried out into gradient treatment, obtains gradient information;According to gradient information, each point of the segmentation figure is determined
Cut the texture trend in region;
4) white noise acoustic image is generated according to input picture;
5) the texture trend and white noise sound spectrogram of each cut zone of the segmentation figure are combined, texture maps are generated;
6) input picture is processed, is obtained profile diagram;
7) texture maps and profile diagram are merged, generates sketch map.
2. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In also including using Multiscale Morphological Opening and closing by reconstruction, carrying out processing the step of obtaining pretreatment image to gray level image:
The Multiscale Morphological Opening and closing by reconstruction is to use various sizes of structural element, and carrying out morphology to gray level image opens
Reconstruction computing is closed, result is added and is averaging, obtain pretreatment image;
The Multi-scale model element definition is as follows:
Wherein, n is the scale parameter of mesostructure element, is a positive number, and n=3 is made in the method;B is basic structural element;Represent the etching operation in Morphological scale-space;Above formula is meant that big structural element is continuous by small structural element
What corrosion was obtained.
3. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In also including pretreatment image is carried out into watershed image segmentation treatment, the step of obtain segmentation figure:
Pretreatment figure is made into Morphological Gradient treatment, Morphological Gradient figure is generated;Morphological Gradient figure=pretreatment image it is swollen
The etch figures of swollen figure-pretreatment image;
Morphological reconstruction by opening is carried out to pretreatment figure and morphology closes reconstruction operation, make filtering, obtain filtering figure;
According to filtering figure, prospect mark and context marker are calculated;
According to prospect mark and context marker, Morphological Gradient figure is changed, carry out watershed segmentation, obtain segmentation figure.
4. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 3, its feature exists
In the calculating prospect mark and context marker include:
The local maximum bianry image of filtering figure is asked for, morphology opening and closing operation is made to local maximum bianry image,
Smooth edges, and local minimum region of the number of pixels less than 20 in image is removed, isolated pixel point is removed, obtain prospect mark
Note figure;
To filtering figure, threshold value is sought with maximum between-cluster variance Otsu methods, then carry out binaryzation, obtain bianry image;It is described
Maximum between-cluster variance Otsu methods ask for threshold value to be included:
If the tonal range of filtering figure is { 0,1,2,3......l }, the pixel count of gray scale i is ni, remember total pixel of image
Number isGray scale is that the probability of the pixel appearance of i is:
The gray-scale pixels of image are divided into C by one threshold value t ∈ [1, l-1] of selection, threshold value t1:{ 0,1,2......, t } and C2:
T+1, t+2 ..., and l } two parts, C1、C2The probability of appearance is respectively:
Its corresponding average is respectively:
The overall gray level average of image is:
The maximum between-cluster variance in two regions that threshold value is got is:
Using traversal method, in the range of t ∈ [1, l-1], ask for so thatMaximum threshold value t, as required threshold value;
Carry out range conversion to bianry image, watershed segmentation, the watershed line image for obtaining is used as context marker.
5. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In the gradient information is the tangent value of gradient angle:
Tan θ=[Fy/Fx]
Wherein, Fx be gray level image by gradient treatment after, the Grad of the horizontal direction for obtaining;Fy is gray level image by ladder
After degree treatment, the Grad of the vertical direction for obtaining;θ is gradient angle, and tan θ are the tangent value of gradient angle.
6. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In the texture trend of each cut zone for determining segmentation figure includes:
Gradient angle tangent value corresponding to each pixel in each cut zone is compared with zero:If the gradient angle of pixel
Degree tangent value is more than zero, and the grain direction for recording this pixel is 45 degree;Otherwise, the grain direction for recording this pixel is -45
Degree;I.e.:
Wherein, IinputIt is the pixel of input, NiIt is i-th cut zone, Iinput_ tan θ are the gradient tangent value for being input into pixel,
Ioutput_ θ is the grain direction of output pixel;
Count in same cut zone, the pixel number of 45 degree of grain directions and -45 degree grain directions is recorded as num1 respectively
And num2;I.e.:
Wherein, the initial value of num1 is:Num1=0;The initial value of num2 is:Num2=0;
Compare the size of num1 and num2:If num1 is more than num2, the grain direction of this cut zone is 45 degree;If num1 is small
In equal to num2, then the grain direction of this cut zone is -45 degree;I.e.:
Wherein, Ni_ θ is the grain direction of cut zone i.
7. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In, also including input picture is transformed into hsv color space by RGB color, and V component is extracted, divide with reference to segmentation figure and V
The step of amount addition white noise, generation white noise sound spectrogram:
The average brightness value R of each cut zone is calculated on the V component figure for extractingi, RiRepresent i-th cut zone;
The pixel and region averages in each region in luminance picture are compared, new pixel is asked for according to the following equation
Value:
T1=k1 (1-Iinput),k1∈[0,1.0]
T2=k2 (1-Iinput),k2∈[0,1.0]
Wherein, IinputTo be input into the brightness value of pixel, IoutputIt is the brightness value of output pixel;Ioutput1It is in input pixel
Brightness value IinputLess than or equal to the average value R of all pixels in the i of regioniWhen, the brightness value I of output pixeloutputValue;
Ioutput2It is the brightness value I in input pixelinputMore than the average value R of all pixels in the i of regioniWhen, the brightness of output pixel
Value IoutputValue;Two variate-values in T1 and T2 formula;P is a random number, span:p∈(0,1);RiIt is area
The average brightness value of all pixels, I in the i of domainmax1、Imax2It is the maximum brightness value of output noise, usually 1;I is a constant
Can be as needed defined by user, I=0.2 is made in this method, k1 and k2 are two empirical values, k1=in this method in formula
0.7, k2=0.3.
8. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In the texture maps are the texture trend and white noise sound spectrogram of each cut zone for combining segmentation figure, by motion blur filter
It is filtered generation.
9. the sketch images generation method based on gradient modification and multidirectional texture blending according to claim 1, its feature exists
In the profile diagram is that input picture is carried out into rainbow treatment generation.
10. the sketch images generating means of gradient modification and multidirectional texture blending are based on, it is characterised in that including such as lower module:
For input picture to be carried out into greyscale transformation, the module of gray level image is obtained;
For by gray level image process obtaining pretreatment image, pretreatment image is carried out into image segmentation treatment, divided
Cut the module of figure;
For gray level image to be carried out into gradient treatment, gradient information is obtained;According to gradient information, each of the segmentation figure is determined
The module of the texture trend of cut zone;
Module for generating white noise acoustic image according to input picture;
Texture trend and white noise sound spectrogram for combining each cut zone of the segmentation figure, generate the module of texture maps;
For input picture to be processed, the module of profile diagram is obtained;
For texture maps and profile diagram to be merged, the module of sketch map is generated.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611111134.6A CN106709964B (en) | 2016-12-06 | 2016-12-06 | Sketch generation method and device based on gradient correction and multidirectional texture extraction |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611111134.6A CN106709964B (en) | 2016-12-06 | 2016-12-06 | Sketch generation method and device based on gradient correction and multidirectional texture extraction |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106709964A true CN106709964A (en) | 2017-05-24 |
CN106709964B CN106709964B (en) | 2020-02-18 |
Family
ID=58937567
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611111134.6A Expired - Fee Related CN106709964B (en) | 2016-12-06 | 2016-12-06 | Sketch generation method and device based on gradient correction and multidirectional texture extraction |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106709964B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108182664A (en) * | 2017-12-26 | 2018-06-19 | 努比亚技术有限公司 | A kind of image processing method, mobile terminal and computer readable storage medium |
CN109102513A (en) * | 2018-08-15 | 2018-12-28 | 黄淮学院 | A kind of partitioning algorithm of the medical image based on mathematical morphology |
CN109840928A (en) * | 2019-01-31 | 2019-06-04 | 北京达佳互联信息技术有限公司 | It is knitted generation method, device, electronic equipment and the storage medium of image |
CN110097549A (en) * | 2019-05-08 | 2019-08-06 | 广州中国科学院沈阳自动化研究所分所 | Based on morphologic land, water and air boundary line detecting method, system, medium and equipment |
CN111950357A (en) * | 2020-06-30 | 2020-11-17 | 北京航天控制仪器研究所 | Marine water surface garbage rapid identification method based on multi-feature YOLOV3 |
CN112884639A (en) * | 2021-02-03 | 2021-06-01 | 上海艾麒信息科技股份有限公司 | Method, system and medium for converting photograph into pencil drawing |
CN113763506A (en) * | 2021-07-28 | 2021-12-07 | 北京印刷学院 | Method for generating artistic stippling image with custom pixels |
CN114612355A (en) * | 2022-03-02 | 2022-06-10 | 影石创新科技股份有限公司 | Oil painting stylization method, device, equipment and medium for image |
CN115798396A (en) * | 2022-11-29 | 2023-03-14 | 卡莱特云科技股份有限公司 | LED screen brightness gradient correction method, device and system |
CN115908458A (en) * | 2023-03-09 | 2023-04-04 | 国家海洋局南海标准计量中心 | Deep sea area interference fringe extraction method, device and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571952A (en) * | 2009-06-18 | 2009-11-04 | 北京航空航天大学 | Method for segmenting video object based on fixed period regional compensation |
CN102663766A (en) * | 2012-05-04 | 2012-09-12 | 云南大学 | Non-photorealistic based art illustration effect drawing method |
-
2016
- 2016-12-06 CN CN201611111134.6A patent/CN106709964B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101571952A (en) * | 2009-06-18 | 2009-11-04 | 北京航空航天大学 | Method for segmenting video object based on fixed period regional compensation |
CN102663766A (en) * | 2012-05-04 | 2012-09-12 | 云南大学 | Non-photorealistic based art illustration effect drawing method |
Non-Patent Citations (2)
Title |
---|
闫利伟: "基于灰度和彩色铅笔画的研究与实现", 《硕士学位论文》 * |
陈洁: "基于形态学和分水岭算法的数字图像分割", 《硕士学位论文》 * |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108182664A (en) * | 2017-12-26 | 2018-06-19 | 努比亚技术有限公司 | A kind of image processing method, mobile terminal and computer readable storage medium |
CN109102513A (en) * | 2018-08-15 | 2018-12-28 | 黄淮学院 | A kind of partitioning algorithm of the medical image based on mathematical morphology |
CN109840928A (en) * | 2019-01-31 | 2019-06-04 | 北京达佳互联信息技术有限公司 | It is knitted generation method, device, electronic equipment and the storage medium of image |
CN109840928B (en) * | 2019-01-31 | 2023-10-17 | 北京达佳互联信息技术有限公司 | Knitting image generation method and device, electronic equipment and storage medium |
CN110097549A (en) * | 2019-05-08 | 2019-08-06 | 广州中国科学院沈阳自动化研究所分所 | Based on morphologic land, water and air boundary line detecting method, system, medium and equipment |
CN111950357A (en) * | 2020-06-30 | 2020-11-17 | 北京航天控制仪器研究所 | Marine water surface garbage rapid identification method based on multi-feature YOLOV3 |
CN112884639A (en) * | 2021-02-03 | 2021-06-01 | 上海艾麒信息科技股份有限公司 | Method, system and medium for converting photograph into pencil drawing |
CN112884639B (en) * | 2021-02-03 | 2022-10-11 | 上海艾麒信息科技股份有限公司 | Method, system and medium for converting photograph into pencil drawing |
CN113763506A (en) * | 2021-07-28 | 2021-12-07 | 北京印刷学院 | Method for generating artistic stippling image with custom pixels |
CN114612355A (en) * | 2022-03-02 | 2022-06-10 | 影石创新科技股份有限公司 | Oil painting stylization method, device, equipment and medium for image |
CN115798396A (en) * | 2022-11-29 | 2023-03-14 | 卡莱特云科技股份有限公司 | LED screen brightness gradient correction method, device and system |
CN115908458A (en) * | 2023-03-09 | 2023-04-04 | 国家海洋局南海标准计量中心 | Deep sea area interference fringe extraction method, device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN106709964B (en) | 2020-02-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106709964A (en) | Gradient correction and multi-direction texture extraction-based sketch generation method and device | |
CN110378985B (en) | Animation drawing auxiliary creation method based on GAN | |
CN110490896B (en) | Video frame image processing method and device | |
CN102663766B (en) | Non-photorealistic based art illustration effect drawing method | |
CN103279936B (en) | Human face fake photo based on portrait is synthesized and modification method automatically | |
CN109035381B (en) | Cartoon picture hair rendering method and storage medium based on UE4 platform | |
CN111161137A (en) | Multi-style Chinese painting flower generation method based on neural network | |
CN103914862A (en) | Pencil sketch simulating method based on edge tangent stream | |
CN104063888B (en) | A kind of wave spectrum artistic style method for drafting based on feeling of unreality | |
CN107240073A (en) | A kind of 3 d video images restorative procedure merged based on gradient with clustering | |
Dong et al. | Real-time image-based Chinese ink painting rendering | |
Yu et al. | Image-based synthesis of Chinese landscape painting | |
CN105574814A (en) | Portrait paper-cut special effect generation method | |
Zang et al. | Artistic preprocessing for painterly rendering and image stylization | |
Zhao et al. | Research on the application of computer image processing technology in painting creation | |
He | Application of local color simulation method of landscape painting based on deep learning generative adversarial networks | |
Li et al. | Image stylization with enhanced structure on GPU | |
Qian et al. | Simulating chalk art style painting | |
CN116342377A (en) | Self-adaptive generation method and system for camouflage target image in degraded scene | |
CN113538647B (en) | Ink image rendering method | |
CN114549288A (en) | Sketch landscape map generation method based on deep learning | |
Zhao et al. | A pencil drawing algorithm based on wavelet transform multiscale | |
Ren et al. | Dunhuang murals image restoration method based on generative adversarial network | |
Rosin et al. | Watercolour rendering of portraits | |
CN114385883B (en) | Contour enhancement method for approximately simulating chapping method in style conversion |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20200218 Termination date: 20201206 |