CN102855647A - Method for generating watercolor images and image processing system - Google Patents

Method for generating watercolor images and image processing system Download PDF

Info

Publication number
CN102855647A
CN102855647A CN2012102539741A CN201210253974A CN102855647A CN 102855647 A CN102855647 A CN 102855647A CN 2012102539741 A CN2012102539741 A CN 2012102539741A CN 201210253974 A CN201210253974 A CN 201210253974A CN 102855647 A CN102855647 A CN 102855647A
Authority
CN
China
Prior art keywords
window
mobile
pixel
value
picture
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
Application number
CN2012102539741A
Other languages
Chinese (zh)
Other versions
CN102855647B (en
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.)
Vtron Group Co Ltd
Original Assignee
Vtron Technologies 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 Vtron Technologies Ltd filed Critical Vtron Technologies Ltd
Priority to CN201210253974.1A priority Critical patent/CN102855647B/en
Publication of CN102855647A publication Critical patent/CN102855647A/en
Application granted granted Critical
Publication of CN102855647B publication Critical patent/CN102855647B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Processing (AREA)

Abstract

The invention discloses a method for generating watercolor images and an image processing system. According to the technical scheme of the method and the image processing system, a window is set in an image needing processing, and then the pixel values of pixels with maximal gray values in a local range and the pixel value of pixels with minimal gray values are diffused through moving the window and judging the gray value relation between pixels, so that the transition pixel values in the images are reduced to form the watercolor effect with irregular block shapes, and the purpose of generating a watercolor image is achieved. The scheme is easily implemented, and the effect is better.

Description

A kind of method and image processing system with the stylization of image watercolor
Technical field
The present invention relates to technical field of image processing, be specifically related to a kind of method and image processing system with the stylization of image watercolor.
Background technology
Image is processed, and refers to and utilizes computing machine that image is analyzed, to reach the technology of results needed.Claim again image processing; Its general index word image is processed, and wherein, digital picture refers to a large two-dimensional array obtaining through over-sampling and digitizing with equipment such as digital camera, scanners, and the element of this array is called pixel, and its value is an integer, is called gray-scale value.
Along with the development of computer technology, also more and more diversified about the various technology that image is processed, be exactly wherein a kind of with the stylization of image watercolor.What propose the earliest the watercolor analogy method is cellular automaton (Cellular Automata) theory of Small in 1991, be used for simulating the reciprocation of pigment and water, obtained watercolor simulate effect comparatively true to nature, on this basis, Curtis has proposed the watercolor modeling of classics, this system is by using three layer model, and namely shoaling layer model, pigment sedimentary deposit model and capillary action layer model are simulated the diffusion of flowing of fluid and pigment.After this, prior art has proposed again several methods with the stylization of image watercolor, for example, come the method for drafting of Simulated Water colour painting effect by what Lei and Chang proposed based on simple spatial filtering, the method is by using Suo Beier (Sobel) wave filter to produce the effect of edge darkening; The method mainly comprises appointment and painted two stages of watercolor of color belt, wherein the appointment of color belt can be that each object in the scene is specified a color belt by the user, simulate pigment and flow and pigment counter-rotating texts, the painted stage of watercolor then is used for simulating edge darkening effect, granules of pigments separating effect, paper grain effect and further pigment flow effect etc.
In the research and practice process to prior art, the present inventor finds that existing these methods with the stylization of image watercolor are all too complicated, set up model or the processing in a plurality of stages of process etc. such as needs, not only be difficult for realizing, and need to consume larger computing cost.
Summary of the invention
The embodiment of the invention provides a kind of method and image processing system with the stylization of image watercolor, realizes that not only simply computing cost is little, and effect is better.
A kind of method with the stylization of image watercolor comprises:
Obtaining needs picture to be processed, and sets window at described picture;
Described window is moved according to presetting pixel size;
Obtain gray-scale value and first value of center pixel in the mobile rear hatch, described the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch;
Determine that whether the gray-scale value of described center pixel is greater than described the first value;
If then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, as the rgb value of described center pixel, and return and carry out described window according to the step that presets pixel size and move;
If not, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, as the rgb value of described center pixel, and return and carry out described window according to the step that presets pixel size and move.
Optionally, wherein, set window at described picture and be specifically as follows: window is set in the upper left corner at described picture;
This moment then, described described window is moved and is specifically as follows according to presetting pixel size: be from the upper left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the upper left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, described described picture set window specifically also can for: window is set in the upper right corner at described picture;
This moment then, described described window is moved and is specially according to presetting pixel size: be from the upper right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the upper right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, describedly set window at described picture and be specially: window is set in the lower left corner at described picture;
This moment then, described with described window according to preset pixel size move specifically also can for: from the lower left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the lower left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, described described picture set window specifically can also for: window is set in the lower right corner at described picture;
This moment then, described described window is moved and is specially according to presetting pixel size: be from the lower right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the lower right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Optionally, wherein, described setting window is specifically as follows: set shape and the size of window, described shape comprises rhombus, square or circular.
Optionally, describedly obtain that gray-scale value and first value of center pixel can comprise in the mobile rear hatch:
Obtain the gray-scale value of center pixel in the mobile rear hatch; And, obtain the gray-scale value of all pixels in the mobile rear hatch, calculate the average of the gray-scale value of all pixels in the described mobile rear hatch, described average be multiply by weighted value, obtain the first value.
Accordingly, the embodiment of the invention also provides a kind of image processing system, comprises initialization unit, mobile unit, gray-scale value acquiring unit, judging unit, the first processing unit and the second processing unit;
Initialization unit needs picture to be processed for obtaining, and sets window at described picture;
Mobile unit is used for the window that initialization unit is set is moved according to presetting pixel size;
The gray-scale value acquiring unit, for gray-scale value and the first value of obtaining center pixel in the mobile rear hatch, described the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch;
Judging unit is used for determining that whether the gray-scale value of described center pixel is greater than described average;
The first processing unit, the gray-scale value that is used for determining described center pixel at judging unit is during greater than described the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, as the rgb value of described center pixel, and trigger mobile unit and carry out described window according to the operation of presetting pixel size and moving;
The second processing unit, the gray-scale value that is used for determining described center pixel at judging unit is during less than or equal to described the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, as the rgb value of described center pixel, and trigger mobile unit and carry out described window according to the operation of presetting pixel size and moving.
Optionally, described initialization unit specifically can be used for setting window in the upper left corner of described picture;
Then this moment, described mobile unit, from left to right moves line by line according to presetting pixel size at concrete being used for from the upper left corner of described picture; Perhaps, from the upper left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, described initialization unit specifically can be used for setting window in the upper right corner of described picture;
Then this moment, described mobile unit specifically can be used for from the upper right corner of described picture, and is mobile line by line from right to left according to presetting pixel size; Perhaps, from the upper right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, described initialization unit specifically can be used for setting window in the lower left corner of described picture;
Then this moment, described mobile unit specifically can be used for from the lower left corner of described picture, and is from left to right mobile line by line according to presetting pixel size; Perhaps, from the lower left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Perhaps, optional, described initialization unit specifically can be used for setting window in the lower right corner of described picture;
Then this moment, described mobile unit specifically can be used for from the lower right corner of described picture, and is mobile line by line from right to left according to presetting pixel size; Perhaps, from the lower right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
Further, described gray-scale value acquiring unit can comprise that first obtains subelement and second and obtain subelement, and is as follows:
First obtains subelement, is used for obtaining the gray-scale value of center pixel in the mobile rear hatch;
Second obtains subelement, is used for obtaining the gray-scale value of all pixels in the mobile rear hatch, calculates the average of the gray-scale value of all pixels in the described mobile rear hatch, and described average be multiply by weighted value, obtains the first value.
The embodiment of the invention adopts and set window in need image to be processed, then by the movement of window and the gray-scale value magnitude relationship between the judgement pixel, pixel value with the pixel of maximum gradation value in the subrange, and the pixel value of the pixel of minimum gradation value spreads apart, thereby reduced the transition pixel values in the image, formation has the imitative watercolor effect of irregular block shape, has namely realized the purpose with the stylization of image watercolor; This scheme need not to set up model or through the processing in a plurality of stages, realizes comparatively simply, and effect is also comparatively obvious.
Description of drawings
In order to be illustrated more clearly in the technical scheme in the embodiment of the invention, the accompanying drawing of required use was done to introduce simply during the below will describe embodiment, apparently, accompanying drawing in the following describes only is some embodiments of the present invention, for those skilled in the art, under the prerequisite of not paying creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is the process flow diagram with the method for image watercolor stylization that the embodiment of the invention provides;
Fig. 2 is the another process flow diagram with the method for image watercolor stylization that the embodiment of the invention provides;
Fig. 3 a is the synoptic diagram of moving window first;
Fig. 3 b is the synoptic diagram of the moving window second time;
Fig. 3 c is for behind the moving window for the third time, current window and window reference position concern synoptic diagram;
Fig. 3 d is that the window of the second row pixel moves synoptic diagram;
Fig. 4 be the embodiment of the invention provide the structural drawing of image processing system.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the invention, the technical scheme in the embodiment of the invention is clearly and completely described, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those skilled in the art belong to the scope of protection of the invention not making the every other embodiment that obtains under the creative work prerequisite.
The embodiment of the invention provides a kind of method and image processing system with the stylization of image watercolor.Below be elaborated respectively.
Embodiment one,
Present embodiment will be described from the angle of image processing system, and this image processing system specifically can be integrated in terminal, in mobile phone, notebook computer or panel computer etc.
A kind of method with the stylization of image watercolor comprises: obtaining needs picture to be processed, sets window at picture; This window is moved according to presetting pixel size; Obtain gray-scale value and first value of center pixel in the mobile rear hatch, described the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch; Determine that whether the gray-scale value of this center pixel is greater than this first value; If, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, as the rgb value of this center pixel, and return execution with this window according to the step that presets pixel size and move; If not, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, as the rgb value of this center pixel, and return execution with this window according to the step that presets pixel size and move.
As shown in Figure 1, idiographic flow can be as follows:
101, obtain need picture to be processed, and set window at this picture.
For example, specifically can locate to set window in the upper left corner, the upper right corner, the lower left corner or the lower right corner etc. of this picture, such as shape and the size of setting window, wherein, the shape of window can comprise rhombus, the shape such as square or circular; The size of window can arrange according to the demand of practical application.
102, the window of setting in the step 101 is moved according to presetting pixel size.
Optionally, in order to reach better watercolor stylize effect, can allow as far as possible the pixel of whole pictures traverse, and to keep as far as possible window to move be continuous and have certain directivity, for example, specifically can be as follows:
(1) if step 101 is to set window in the upper left corner of picture, this moment then, this window is moved and is specially according to presetting pixel size:
From the upper left corner of this picture, from left to right mobile line by line according to presetting pixel size; Perhaps,
From the upper left corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, can (be first pixel of the first row from the upper left corner of this picture, also be first pixel of first row) beginning, from left to right mobile according to presetting pixel size, until traveled through all pixels of the first row, then again from first pixel of the second row of this picture, from left to right mobile according to presetting pixel size, until traveled through all pixels of the second row, moreover, with same method the pixel of the third line is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Can be from the upper left corner (first pixel of first row of this picture, also be first pixel of the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of first row, then again from first pixel of the secondary series of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of secondary series, moreover, process with same method again tertial pixel is processed, by that analogy, until travel through all pixels of complete pictures.
(2) if step 101 is to set window in the upper right corner of picture, this moment then, this window is moved and is specially according to presetting pixel size:
From the upper right corner of this picture, mobile line by line from right to left according to presetting pixel size; Perhaps,
From the upper right corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, can (be last pixel of the first row from the upper right corner of this picture, also be first pixel of last row) beginning, mobile from right to left according to presetting pixel size, until traveled through all pixels of the first row, then again from last pixel of the second row of this picture, mobile from right to left according to presetting pixel size, until traveled through all pixels of the second row, moreover, with same method the pixel of the third line is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Can be from the upper right corner (first pixel of last row of this picture, also be last pixel of the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of this last first row, then again from first pixel of the row second from the bottom of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of these row second from the bottom, moreover, process with same method again the pixel of row third from the bottom is processed, by that analogy, until travel through all pixels of complete pictures.
(3) if step 101 is to set window in the lower left corner of picture, this moment then, this window is moved and is specially according to presetting pixel size:
From the lower left corner of this picture, from left to right mobile line by line according to presetting pixel size; Perhaps,
From the lower left corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, can (be first pixel of last the first row from the lower left corner of this picture, also be last pixel of first row) beginning, from left to right mobile according to presetting pixel size, until traveled through all pixels of this last the first row, then again from first pixel of the row second from the bottom of this picture, from left to right mobile according to presetting pixel size, until traveled through all pixels with row second from the bottom, moreover, with same method the pixel of countdown line 3 is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Can be from the lower left corner (last pixel of first row of this picture, also be first pixel of last the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of first row, then again from last pixel of the secondary series of this picture, move to the road from lower according to presetting pixel size, until traveled through all pixels of secondary series, moreover, process with same method again tertial pixel is processed, by that analogy, until travel through all pixels of complete pictures.
(4) if step 101 is to set window in the lower right corner of picture, this moment then, this window is moved and is specially according to presetting pixel size:
From the lower right corner of this picture, mobile line by line from right to left according to presetting pixel size; Perhaps,
From the lower right corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, can (be last pixel of last column from the lower right corner of this picture, also be last pixel of last row) beginning, mobile from right to left according to presetting pixel size, until traveled through all pixels of last column, then again from last pixel of the row second from the bottom of this picture, mobile from right to left according to presetting pixel size, until traveled through all pixels of this row second from the bottom, moreover, with same method the pixel of countdown line 3 is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Can be from the lower right corner (last pixel of last row of this picture, also be last pixel of last column) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of this last first row, then again from last pixel of the row second from the bottom of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of these row second from the bottom, moreover, process with same method again the pixel of row third from the bottom is processed, by that analogy, until travel through all pixels of complete pictures.
Wherein, the pixel size that moves each time (i.e. mobile distance size) can arrange according to the demand of practical application, such as, can set each time mobile pixel, or move each time two pixels, by that analogy, etc.
103, obtain the gray-scale value of center pixel in the mobile rear hatch, and obtain the first value, this first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch; For example, specifically can be as follows:
Obtain the gray-scale value of center pixel in the mobile rear hatch; And
Obtain the gray-scale value of all pixels in the mobile rear hatch, then calculate the average that this moves the gray-scale value of all pixels in the rear hatch, this average be multiply by weighted value.
Wherein, the value of weighted value can arrange according to the demand of practical application, such as, this weighted value can be set to 1, then this moment first, value was " average of the gray-scale value of all pixels in the mobile rear hatch ", and in order to reach better watercolor effect, this weighted value generally can be set to 0.95; Certainly, this weighted value also can be set to other values, does not repeat them here.
104, whether the gray-scale value of center pixel is greater than the first value (namely the average of the gray-scale value of all pixels multiply by weighted value in the mobile rear hatch) in the mobile rear hatch that gets access in the determining step 103, if then execution in step 105, if not, then execution in step 106.
If the gray-scale value of center pixel is greater than the first value (namely the average of the gray-scale value of all pixels multiply by weighted value in the mobile rear hatch) in the 105 mobile rear hatches, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, move the rgb value of center pixel in the rear hatch as this, and return execution in step 102, the execution in step 102 ~ 106 that namely circulates is until whole pictures is disposed.
Wherein, the embodiment of the invention said " pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch " refers to the pixel that is positioned at same position with " pixel of gray-scale value maximum in the mobile rear hatch " in this window, such as, the pixel of gray-scale value maximum " the mobile rear hatch in " be the center pixel of current this window, then " pixel corresponding pixel before this window moves of the interior gray-scale value maximum of mobile rear hatch " what refer to is exactly the center pixel of this window before this moves.
If the gray-scale value of center pixel is less than or equal to the first value (namely the average of the gray-scale value of all pixels multiply by weighted value in the mobile rear hatch) in the 106 mobile rear hatches, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, move the rgb value of center pixel in the rear hatch as this, and return execution in step 102, the execution in step 102 ~ 106 that namely circulates is until whole pictures is disposed.
Wherein, the embodiment of the invention said " pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch " refers to the pixel that is positioned at same position with " pixel of gray-scale value minimum in the mobile rear hatch " in this window, such as, the pixel of gray-scale value minimum " the mobile rear hatch in " be the center pixel of current this window, then " pixel corresponding pixel before this window moves of the interior gray-scale value minimum of mobile rear hatch " what refer to is exactly the center pixel of this window before this moves.
As from the foregoing, present embodiment adopts and set window in need image to be processed, then by the movement of window and the gray-scale value magnitude relationship between the judgement pixel, pixel value with the pixel of maximum gradation value in the subrange, and the pixel value of the pixel of minimum gradation value spreads apart, thereby reduced the transition pixel values in the image, formed the imitative watercolor effect with irregular block shape, namely realized the purpose with the stylization of image watercolor; This scheme need not to set up model or through the processing in a plurality of stages, realizes comparatively simply, and effect is also comparatively obvious.
Embodiment two,
According to embodiment one described method, below will be described in further detail for example.
As shown in Figure 2, idiographic flow can be as follows:
201, image processing system obtains needs picture to be processed, and sets window at this picture.
For example, specifically can locate to set window in the upper left corner, the upper right corner, the lower left corner or the lower right corner etc. of this picture, such as shape and the size of setting window, wherein, the shape of window can comprise rhombus, the shape such as square or circular, and the shape of window and size all can be set according to the demand of practical application.For convenience, in the present embodiment, will describe as example to set window in the upper left corner of this picture.
It should be noted that wherein, this image processing system specifically can be integrated in terminal, such as being integrated in the terminals such as mobile phone, notebook computer or panel computer.
202, image processing system moves the window of setting according to presetting pixel size, wherein, the pixel size that the moves each time (size that namely moves, the distance that moves in other words) can arrange according to the demand of practical application, such as, can set window and can move each time a pixel size, two pixel sizes or three pixel sizes etc., by that analogy.
For convenience, present embodiment will be take the length of window as 2 pixels, and wide is 1 pixel, and at every turn from left to right mobile pixel size be that example describes.
Referring to Fig. 3 a, when moving first, image processing system is from the upper left corner of this picture, and with the window of the setting pixel that moves right, wherein, this moves the position of front window empty wire frame representation, and solid box represents that this moves the position of rear hatch.Referring to Fig. 3 b, this figure is for the second time synoptic diagram of moving window of image processing system, and same, this moves the position of front window empty wire frame representation, and solid box represents that this moves the position of rear hatch.Fig. 3 c is for behind the moving window for the third time, current window and window reference position concern synoptic diagram (because each mobile pixel, so after mobile for the third time, window and reference position differ 3 pixels).And Fig. 3 d then is that the window of the second row pixel moves synoptic diagram, and namely image processing system is after handling all pixels of the first row, and the window that begins to process the second row pixel moves synoptic diagram.
It should be noted that, present embodiment is only take the length of window as 2 pixels, wide is 1 pixel, and mobile pixel size is that example describes from left to right at every turn, should be understood that, also can realize that its implementation does not similarly repeat them here with other window sizes and with other move mode.
203, the every movement of window once, image processing system obtains the gray-scale value of center pixel in the mobile rear hatch, and obtains the first value, then execution in step 204, wherein, the average that the first value is specially the gray-scale value of interior all pixels of mobile rear hatch multiply by weighted value.For example, specifically can be as follows:
Obtain the gray-scale value of center pixel in the mobile rear hatch, and the gray-scale value that obtains all pixels in the mobile rear hatch, the gray-scale value that this moves all pixels in the rear hatch then calculated.Such as, if (x 0, y 0) be the center pixel coordinate figure, (x, y) is the coordinate figure of pixel in the window, then the gray-scale value of this center pixel can be expressed as GRAY(x 0, y 0); The gray-scale value of pixel can be expressed as GRAY(x, y in the window), so, the average that this moves the gray-scale value of all pixels in the rear hatch then can be expressed as AVE_GRAY(x, y), this average multiply by weighted value then can be expressed as AVE_GRAY(x, y) * coff, wherein, coff is weighted value, the value of coff can arrange according to the demand of practical application, such as, in order to reach better watercolor effect, the coff default value can be set to 0.95, etc.Perhaps, the value of coff also can be set to 1, and when the value of coff was set to 1, the first value was " average of the gray-scale value of all pixels in the mobile rear hatch "; Certainly, the value of this coff also can be set to other values.
204, image processing system determines that whether the gray-scale value of center pixel in the mobile rear hatch that gets access to is greater than the first value (namely the average of the gray-scale value of interior all pixels of mobile rear hatch multiply by weighted value), if, then execution in step 205, and if not, then execution in step 206.Be about to GRAY(x 0, y 0) and AVE_GRAY(x, y) * coff compares, if GRAY(x 0, y 0) greater than AVE_GRAY(x, y) * coff, then execution in step 205, if GRAY(x 0, y 0) less than or equal to AVE_GRAY(x, y) * coff, then execution in step 206.
If the gray-scale value of center pixel is greater than the first value (namely the average of the gray-scale value of all pixels multiply by weighted value in the mobile rear hatch) in the 205 mobile rear hatches, then image processing system moves the rgb value of center pixel in the rear hatch with the rgb value of pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch as this.
For example, if the words of moving window first, then image processing system will this mobile rear hatch in the rgb value of pixel (being the initial position of window) corresponding pixel before this window moves of gray-scale value maximum, move the rgb value of center pixel in the rear hatch as this window.
Again for example, if the words of moving window for the third time, then image processing system is this rgb value of the pixel of gray-scale value maximum (namely window moves afterwards for the second time) corresponding pixel before window moves for the third time in the mobile rear hatch for the third time, moves the rgb value of center pixel in the rear hatch as window for the third time.
By that analogy, etc., the result after all can processing with reference to the last time namely processed each time.
It should be noted that the rgb value of the pixel of window before moving can obtain and preserve before window moves prerequisite, also can be after window moves by determine window move before the position of corresponding pixel obtain, do not repeat them here.
If the gray-scale value of center pixel is less than or equal to the first value (namely the average of the gray-scale value of all pixels multiply by weighted value in the mobile rear hatch) in the 206 mobile rear hatches, then image processing system moves the rgb value of center pixel in the rear hatch with the rgb value of pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch as this.
For example, if the words of moving window first, then image processing system will this mobile rear hatch in the rgb value of pixel (being the initial position of window) corresponding pixel before this window moves of gray-scale value minimum, move the rgb value of center pixel in the rear hatch as this window.
Again for example, if the words of moving window for the third time, then image processing system is this rgb value of the pixel of gray-scale value minimum (namely window moves afterwards for the second time) corresponding pixel before window moves for the third time in the mobile rear hatch for the third time, moves the rgb value of center pixel in the rear hatch as window for the third time.
By that analogy, etc., the result after all can processing with reference to the last time namely processed each time.
Circulation execution in step 202 ~ 206 is until whole pictures is disposed.
As from the foregoing, present embodiment adopts and set window in need image to be processed, then the movement by window and judge gray-scale value magnitude relationship between pixel (and, result after each processing all can be processed with reference to the last time), pixel value with the pixel of maximum gradation value in the subrange, and the pixel value of the pixel of minimum gradation value spreads apart, thereby reduced the transition pixel values in the image, formation has the imitative watercolor effect of irregular block shape, has namely realized the purpose with the stylization of image watercolor; This scheme need not to set up model or through the processing in a plurality of stages, realizes comparatively simply, and effect is also comparatively obvious.
Embodiment three,
In order to implement better above method, the embodiment of the invention also provides a kind of image processing system, as shown in Figure 4, this image processing system can comprise initialization unit 301, mobile unit 302, gray-scale value acquiring unit 303, judging unit 304, the first processing unit 305 and the second processing unit 306.
Initialization unit 301 needs picture to be processed for obtaining, and sets window at this picture;
Such as, specifically can set at this picture shape and the size of window, wherein, the shape of window can comprise rhombus, the shape such as square or circular.The shape of window and the size of window all can be set according to the demand of practical application
Mobile unit 302 is used for the window that initialization unit 301 is set is moved according to presetting pixel size;
Gray-scale value acquiring unit 303, for gray-scale value and the first value of obtaining center pixel in the mobile rear hatch, wherein, the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch;
Judging unit 304 is used for determining that whether the gray-scale value of center pixel in the mobile rear hatch is greater than the first value;
The first processing unit 305, the gray-scale value that is used for center pixel in judging unit is determined mobile rear hatch is during greater than the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, move the rgb value of center pixel in the rear hatch as this, and trigger mobile unit 302 and carry out this window according to the operation of presetting pixel size and moving;
The second processing unit 306, the gray-scale value that is used for center pixel in judging unit is determined mobile rear hatch is during less than or equal to the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, move the rgb value of center pixel in the rear hatch as this, and trigger mobile unit 302 and carry out this window according to the operation of presetting pixel size and moving.
Wherein, gray-scale value acquiring unit 303 can comprise that first obtains subelement and second and obtain subelement;
First obtains subelement, is used for obtaining the gray-scale value of center pixel in the mobile rear hatch;
Second obtains subelement, is used for obtaining the gray-scale value of all pixels in the mobile rear hatch, calculates the average that this moves the gray-scale value of all pixels in the rear hatch, and this average be multiply by weighted value, obtains the first value.
Such as, if (x 0, y 0) be the center pixel coordinate figure, (x, y) is the coordinate figure of pixel in the window, then the gray-scale value of this center pixel can be expressed as GRAY(x 0, y 0); The gray-scale value of pixel can be expressed as GRAY(x, y in the window), so, the average that this moves the gray-scale value of all pixels in the rear hatch then can be expressed as AVE_GRAY(x, y), this average multiply by weighted value then can be expressed as AVE_GRAY(x, y) * coff, wherein, coff is weighted value, the value of coff can arrange according to the demand of practical application, such as, in order to reach better watercolor effect, the coff default value can be set to 0.95, etc.Perhaps, the value of coff also can be set to 1, and when the value of coff was set to 1, the first value was " average of the gray-scale value of all pixels in the mobile rear hatch "; Certainly, the value of this coff also can be set to other values.
Optionally, when picture is set window and moving window, in order to reach better watercolor stylize effect, can allow as far as possible the pixel of whole pictures traverse, and to keep as far as possible window to move be continuous and have certain directivity, for example, specifically can locate to set window in the upper left corner, the upper right corner, the lower left corner or the lower right corner etc. of this picture
(1) sets window in the upper left corner of picture;
Initialization unit 301, concrete being used for set window in the upper left corner of this picture;
Then mobile unit 302, and is concrete being used for from the upper left corner of this picture, from left to right mobile line by line according to presetting pixel size; Perhaps,
Mobile unit 302, concrete being used for from the upper left corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, mobile unit 302 can (be first pixel of the first row from the upper left corner of this picture specifically, also be first pixel of first row) beginning, from left to right mobile according to presetting pixel size, until traveled through all pixels of the first row, then again from first pixel of the second row of this picture, from left to right mobile according to presetting pixel size, until traveled through all pixels of the second row, moreover, with same method the pixel of the third line is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Mobile unit 302 specifically can be from the upper left corner (first pixel of first row of this picture, also be first pixel of the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of first row, then again from first pixel of the secondary series of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of secondary series, moreover, process with same method again tertial pixel is processed, by that analogy, until travel through all pixels of complete pictures.
(2) set window in the upper right corner of picture;
Initialization unit 301, concrete being used for set window in the upper right corner of this picture;
Then mobile unit 302, and is concrete being used for from the upper right corner of this picture, mobile line by line from right to left according to presetting pixel size; Perhaps,
Mobile unit 302, concrete being used for from the upper right corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, mobile unit 302 can (be last pixel of the first row from the upper right corner of this picture specifically, also be first pixel of last row) beginning, mobile from right to left according to presetting pixel size, until traveled through all pixels of the first row, then again from last pixel of the second row of this picture, mobile from right to left according to presetting pixel size, until traveled through all pixels of the second row, moreover, with same method the pixel of the third line is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Mobile unit 302 specifically can be from the upper right corner (first pixel of last row of this picture, also be last pixel of the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of this last first row, then again from first pixel of the row second from the bottom of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of these row second from the bottom, moreover, process with same method again the pixel of row third from the bottom is processed, by that analogy, until travel through all pixels of complete pictures.
(3) set window in the lower left corner of picture;
Initialization unit 301, concrete being used for set window in the lower left corner of this picture;
Then mobile unit 302, and is concrete being used for from the lower left corner of this picture, from left to right mobile line by line according to presetting pixel size; Perhaps,
Mobile unit 302, concrete being used for from the lower left corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, mobile unit 302 can (be first pixel of last the first row from the lower left corner of this picture specifically, also be last pixel of first row) beginning, from left to right mobile according to presetting pixel size, until traveled through all pixels of this last the first row, then again from first pixel of the row second from the bottom of this picture, from left to right mobile according to presetting pixel size, until traveled through all pixels with row second from the bottom, moreover, with same method the pixel of countdown line 3 is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Mobile unit 302 specifically can be from the lower left corner (last pixel of first row of this picture, also be first pixel of last the first row) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of first row, then again from last pixel of the secondary series of this picture, move to the road from lower according to presetting pixel size, until traveled through all pixels of secondary series, moreover, process with same method again tertial pixel is processed, by that analogy, until travel through all pixels of complete pictures.
(4) set window in the lower right corner of picture;
Initialization unit 301, concrete being used for set window in the lower right corner of this picture;
Then mobile unit 302, and is concrete being used for from the lower right corner of this picture, mobile line by line from right to left according to presetting pixel size; Perhaps,
Mobile unit 302, concrete being used for from the lower right corner of this picture, mobile by column from top to bottom according to presetting pixel size.
That is to say, mobile unit 302 can (be last pixel of last column from the lower right corner of this picture specifically, also be last pixel of last row) beginning, mobile from right to left according to presetting pixel size, until traveled through all pixels of last column, then again from last pixel of the row second from the bottom of this picture, mobile from right to left according to presetting pixel size, until traveled through all pixels of this row second from the bottom, moreover, with same method the pixel of countdown line 3 is processed again, by that analogy, until travel through all pixels of complete pictures.Perhaps,
Mobile unit 302 specifically can be from the lower right corner (last pixel of last row of this picture, also be last pixel of last column) beginning, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of this last first row, then again from last pixel of the row second from the bottom of this picture, mobile from top to bottom according to presetting pixel size, until traveled through all pixels of these row second from the bottom, moreover, process with same method again the pixel of row third from the bottom is processed, by that analogy, until travel through all pixels of complete pictures.
Wherein, the pixel size that moves each time (i.e. mobile distance size) can arrange according to the demand of practical application, such as, can set each time mobile pixel, or move each time two pixels, by that analogy, etc.
During implementation, above unit can be used as independently entity realization, also can carry out combination in any, realizes that as same or several entities the enforcement of above unit specifically can referring to the embodiment of the method for front, not repeat them here.
This image processing system specifically can be integrated in terminal, such as specifically being integrated in the terminals such as mobile phone, notebook computer or panel computer.
As from the foregoing, the initialization unit 301 of the picture processing system of the embodiment of the invention adopts sets window in need image to be processed, then the gray-scale value magnitude relationship of judging between pixel by movement and the judging unit 304 of 302 pairs of windows of mobile unit, spread apart by the pixel value of the first processing unit 305 with the pixel of maximum gradation value in the subrange, and spread apart by the pixel value of the pixel of the second processing unit 306 minimum gradation value, thereby reduced the transition pixel values in the image, formation has the imitative watercolor effect of irregular block shape, has namely realized the purpose with the stylization of image watercolor; This scheme need not to set up model or through the processing in a plurality of stages, realizes comparatively simply, and effect is also comparatively obvious.
One of ordinary skill in the art will appreciate that all or part of step in the whole bag of tricks of above-described embodiment is to come the relevant hardware of instruction finish by program, this program can be stored in the computer-readable recording medium, storage medium can comprise: ROM (read-only memory) (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD etc.
More than a kind of method and image processing system with the stylization of image watercolor that the embodiment of the invention is provided be described in detail, used specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment just is used for helping to understand method of the present invention and core concept thereof; Simultaneously, for those skilled in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. the method with the stylization of image watercolor is characterized in that, comprising:
Obtaining needs picture to be processed, and sets window at described picture;
Described window is moved according to presetting pixel size;
Obtain gray-scale value and first value of center pixel in the mobile rear hatch, described the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch;
Determine that whether the gray-scale value of described center pixel is greater than described the first value;
If then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, as the rgb value of described center pixel, and return and carry out described window according to the step that presets pixel size and move;
If not, then with the rgb value of pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, as the rgb value of described center pixel, and return and carry out described window according to the step that presets pixel size and move.
2. method according to claim 1 is characterized in that, describedly sets window at described picture and is specially:
Window is set in the upper left corner at described picture;
Then described described window is moved and is specially according to presetting pixel size: be from the upper left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the upper left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
3. method according to claim 1 is characterized in that, describedly sets window at described picture and is specially:
Window is set in the upper right corner at described picture;
Then described described window is moved and is specially according to presetting pixel size: be from the upper right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the upper right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
4. method according to claim 1 is characterized in that, describedly sets window at described picture and is specially:
Window is set in the lower left corner at described picture;
Then described described window is moved and is specially according to presetting pixel size: be from the lower left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the lower left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
5. method according to claim 1 is characterized in that, describedly sets window at described picture and is specially:
Window is set in the lower right corner at described picture;
Then described described window is moved and is specially according to presetting pixel size: be from the lower right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the lower right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
6. an image processing system is characterized in that, comprising:
Initialization unit needs picture to be processed for obtaining, and sets window at described picture;
Mobile unit is used for the window that initialization unit is set is moved according to presetting pixel size;
The gray-scale value acquiring unit, for gray-scale value and the first value of obtaining center pixel in the mobile rear hatch, described the first value multiply by weighted value for the average of the gray-scale value of all pixels in the mobile rear hatch;
Judging unit is used for determining that whether the gray-scale value of described center pixel is greater than described the first value;
The first processing unit, the gray-scale value that is used for determining described center pixel at judging unit is during greater than described the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value maximum in the mobile rear hatch, as the rgb value of described center pixel, and trigger mobile unit and carry out described window according to the operation of presetting pixel size and moving;
The second processing unit, the gray-scale value that is used for determining described center pixel at judging unit is during less than or equal to described the first value, rgb value with pixel corresponding pixel before this window moves of gray-scale value minimum in the mobile rear hatch, as the rgb value of described center pixel, and trigger mobile unit and carry out described window according to the operation of presetting pixel size and moving.
7. image processing system according to claim 6 is characterized in that,
Described initialization unit, concrete being used for set window in the upper left corner of described picture;
Then described mobile unit is concrete being used for from the upper left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the upper left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
8. image processing system according to claim 6 is characterized in that,
Described initialization unit, concrete being used for set window in the upper right corner of described picture;
Then described mobile unit is concrete being used for from the upper right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the upper right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
9. image processing system according to claim 6 is characterized in that,
Described initialization unit, concrete being used for set window in the lower left corner of described picture;
Then described mobile unit is concrete being used for from the lower left corner of described picture, from left to right mobile line by line according to presetting pixel size; Perhaps, from the lower left corner of described picture, mobile by column from top to bottom according to presetting pixel size.
10. image processing system according to claim 6 is characterized in that,
Described initialization unit, concrete being used for set window in the lower right corner of described picture;
Then described mobile unit is concrete being used for from the lower right corner of described picture, mobile line by line from right to left according to presetting pixel size; Perhaps, from the lower right corner of described picture, mobile by column from top to bottom according to presetting pixel size.
CN201210253974.1A 2012-07-20 2012-07-20 A kind of by the method for image watercolor stylization and image processing system Expired - Fee Related CN102855647B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210253974.1A CN102855647B (en) 2012-07-20 2012-07-20 A kind of by the method for image watercolor stylization and image processing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210253974.1A CN102855647B (en) 2012-07-20 2012-07-20 A kind of by the method for image watercolor stylization and image processing system

Publications (2)

Publication Number Publication Date
CN102855647A true CN102855647A (en) 2013-01-02
CN102855647B CN102855647B (en) 2015-07-29

Family

ID=47402208

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210253974.1A Expired - Fee Related CN102855647B (en) 2012-07-20 2012-07-20 A kind of by the method for image watercolor stylization and image processing system

Country Status (1)

Country Link
CN (1) CN102855647B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236070A (en) * 2013-04-24 2013-08-07 上海电机学院 Weaving effect picture generation method
CN109697707A (en) * 2018-12-29 2019-04-30 深圳美图创新科技有限公司 Freehandhand-drawing watercolor style method for drafting and device
US10636177B2 (en) 2014-11-26 2020-04-28 John Balestrieri Methods for creating a simulated watercolor-painted image from a source image

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020012003A1 (en) * 1997-08-29 2002-01-31 Catherine Jane Lockeridge Method and apparatus for generating images
CN101588438A (en) * 2009-06-10 2009-11-25 拓维信息系统股份有限公司 Mobile phone animation creation method for converting digitalized coloured picture into pictures of different styles

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020012003A1 (en) * 1997-08-29 2002-01-31 Catherine Jane Lockeridge Method and apparatus for generating images
CN101588438A (en) * 2009-06-10 2009-11-25 拓维信息系统股份有限公司 Mobile phone animation creation method for converting digitalized coloured picture into pictures of different styles

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
YUHONG SUN: "Representation of Watercolor Based on Regions", 《2011 INTERNATIONAL CONFERENCE ON IMAGE ANALYSIS AND SIGNAL PROCESSING》, 21 October 2011 (2011-10-21), pages 496 - 500, XP032078160, DOI: doi:10.1109/IASP.2011.6109092 *
卢盛荣等: "一种绘画效果生成算法", 《计算机工程与应用》, vol. 46, no. 26, 11 September 2010 (2010-09-11), pages 166 - 169 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103236070A (en) * 2013-04-24 2013-08-07 上海电机学院 Weaving effect picture generation method
US10636177B2 (en) 2014-11-26 2020-04-28 John Balestrieri Methods for creating a simulated watercolor-painted image from a source image
CN109697707A (en) * 2018-12-29 2019-04-30 深圳美图创新科技有限公司 Freehandhand-drawing watercolor style method for drafting and device
CN109697707B (en) * 2018-12-29 2020-09-18 深圳美图创新科技有限公司 Hand-drawn watercolor style drawing method and device

Also Published As

Publication number Publication date
CN102855647B (en) 2015-07-29

Similar Documents

Publication Publication Date Title
CN104134217B (en) Video salient object segmentation method based on super voxel graph cut
CN105303514A (en) Image processing method and apparatus
CN104574495B (en) A kind of image rendering method and device
CN104038807B (en) A kind of figure layer mixed method and device based on OpenGL
CN107395958B (en) Image processing method and device, electronic equipment and storage medium
CN109816769A (en) Scene based on depth camera ground drawing generating method, device and equipment
Bi et al. A dynamic mode decomposition based edge detection method for art images
US20150310305A1 (en) Learning painting styles for painterly rendering
US9478004B2 (en) Method and system for analog/digital image simplification and stylization
CN107451976B (en) A kind of image processing method and device
AU2013273784A1 (en) Method, system and apparatus for updating a scene model
CN104751405A (en) Method and device for blurring image
CN103020993A (en) Visual saliency detection method by fusing dual-channel color contrasts
CN106462950A (en) Systems and methods for localized contrast enhancement
CN105096330A (en) Image processing method capable of automatically recognizing pure-color borders, system and a photographing terminal
CN107851308A (en) system and method for identifying target object
CN110503704A (en) Building method, device and the electronic equipment of three components
CN104851122A (en) Method and device for generating shadow special effect graph
CN106303583B (en) Image data transmission bandwidth distribution method and device based on image dynamic scaling
CN102855647B (en) A kind of by the method for image watercolor stylization and image processing system
CN104010180A (en) Method and device for filtering three-dimensional video
CN105574834B (en) Image processing method and device
CN105578035A (en) Image processing method and electronic device
CN104503662B (en) A kind of generation method and device of the geometric profile of desktop elements
CN110570497A (en) Drawing method and device based on layer superposition, terminal equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Kezhu road high tech Industrial Development Zone, Guangzhou city of Guangdong Province, No. 233 510670

Patentee after: VTRON GROUP Co.,Ltd.

Address before: 510663 Guangzhou province high tech Industrial Development Zone, Guangdong, Cai road, No. 6, No.

Patentee before: VTRON TECHNOLOGIES Ltd.

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

Termination date: 20210720