CN103236070A - Weaving effect picture generation method - Google Patents

Weaving effect picture generation method Download PDF

Info

Publication number
CN103236070A
CN103236070A CN2013101451583A CN201310145158A CN103236070A CN 103236070 A CN103236070 A CN 103236070A CN 2013101451583 A CN2013101451583 A CN 2013101451583A CN 201310145158 A CN201310145158 A CN 201310145158A CN 103236070 A CN103236070 A CN 103236070A
Authority
CN
China
Prior art keywords
straight line
picture
generation method
colour
weave effect
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
CN2013101451583A
Other languages
Chinese (zh)
Other versions
CN103236070B (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.)
SINOCBD Inc.
Original Assignee
Shanghai Dianji University
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 Shanghai Dianji University filed Critical Shanghai Dianji University
Priority to CN201310145158.3A priority Critical patent/CN103236070B/en
Publication of CN103236070A publication Critical patent/CN103236070A/en
Application granted granted Critical
Publication of CN103236070B publication Critical patent/CN103236070B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention relates to the technical field of image processing, and discloses a weaving effect picture generation method. The weaving effect picture generation method comprises the following steps of: 1, on the basis of a source picture, establishing a blank target picture with the same size as the source picture; 2, determining a terminal condition for drawing a line on the target picture; 3, determining one section of straight line on the source picture, recording the starting point position and the terminal point position of the straight line, and determining the color value of the straight line; 4, drawing the straight line of the weaving effect with the same color value on the same position of the target picture; and 5, judging whether the terminal condition is true, if so, finishing drawing, outputting the target picture, and if no, returning to step 3. According to the method, the quick and efficient drawing of the weaving effect picture is realized.

Description

A kind of generation method of weave effect picture
Technical field
The present invention relates to technical field of image processing, particularly a kind of generation method of weave effect picture.
Background technology
The weave effect picture has strong and true to nature braiding lines sense, for industries such as publicity, art provide a kind of good material.
There are some relevant line arts to draw disposal route in the prior art, such as Chinese patent: " a kind of abstract stick figure generation method based on feature stream " (publication number 102930576A), it adopts FGaD filtering effectively to detect the visual properties of large scale, generates the strong abstract stick figure of height of stylize effect.Chinese patent for another example: " stick figure producing device and stick figure method for making " (publication number 101547292), it provides a kind of stick figure producing device and stick figure method for making, its objective is based on the good stick figure of image making.This patent stick figure is the distribution character according to edge strength, sets the outline portion of stick figure and the threshold value of blank parts, thereby draws lines picture picture.Chinese patent: " a kind of method for making of traditional Chinese Painting knitting picture " (publication number 102582348A) is disclosed for another example is a kind of establishment painter technology.
Above image lines disposal route does not all generate the function that figure is imitated in braiding with image.
Summary of the invention
To the objective of the invention is in order solving the problems of the technologies described above, a kind of generation method of weave effect picture to be provided, in the hope of realizing the generation of weave effect picture.
The technical scheme that the present invention takes is:
A kind of generation method of weave effect picture is characterized in that, comprises the steps:
The first step: based on the source picture, set up a blank Target Photo with described source picture same size;
Second step: the end condition of determining to draw at described Target Photo lines;
The 3rd step: determine one section straight line at described source picture, start position and the final position of recording this straight line, and the colour of definite described straight line;
The 4th step: use identical colour to draw the straight line of weave effect in the same position of described Target Photo.
The 5th step: judge whether end condition is set up, then finish in this way to draw the export target picture; As otherwise returned for the 3rd step;
Further, the end condition in described second step reaches predetermined number of times for the number of times of drawing straight line at described Target Photo.
Further, the end condition in described second step is to draw straight line on the described Target Photo to reach specified density.
Further, the end condition in described second step is to draw the straight line time on the described Target Photo to reach the fixed time.
Further, in described the 3rd step, according to the colour distribution of the straight line of determining, use iterative algorithm to redefine the final position of straight line.
Further, described iterative algorithm comprises the steps:
Whether the colour of judging described straight line changes difference greater than preset threshold value, judge that whether the length of described straight line is greater than pre-set length, if two judged results are all and are, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
Further, described iterative algorithm comprises the steps:
Judge that whether the graded difference of described straight line is greater than preset threshold value, judge that whether the length of described straight line is greater than pre-set length, if two judged results are all and are, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
Further, the colour of described straight line is the colour of pixel of the mid point of described straight line.
Further, in described the 3rd step, draw the start position of straight line for the first time for obtaining at random, from for the second time, the starting point of drafting straight line is the terminal point of last straight line.
Further, if described source picture and Target Photo are cromogram, the colour of described straight line is the color-values of described straight line.
Further, if described source picture and Target Photo are gray-scale map, the colour of described straight line is the gray-scale value of described straight line.
The invention has the beneficial effects as follows:
Be instrument with the computing machine, at digital picture, produce the picture of different weave effect automatically and quickly.
Description of drawings
Accompanying drawing 1 is the schematic flow sheet of embodiment among the present invention;
Accompanying drawing 2 is schematic flow sheets of determining the iterative algorithm of braided wire terminal point;
Accompanying drawing 3 is schematic flow sheets of determining the braided wire color.
Embodiment
Elaborate below in conjunction with the embodiment of accompanying drawing to the generation method of a kind of weave effect picture of the present invention.
Weave effect picture texture is well arranged, and artistic effect is strong, in beautifying and decorating, publicity and art are used very strong application prospect is arranged.
Generation method with weave effect picture comprises the steps:
The first step: based on the source picture, set up a blank Target Photo with described source picture same size.
The source picture is electronic pictures, and for cromogram, Target Photo corresponds to cromogram; For the gray scale picture, Target Photo should be gray-scale map.
Second step: the end condition of determining to draw at described Target Photo lines.
The condition of end condition for determining that Target Photo is completed, end condition can determine that a kind of is when reaching predetermined number of times according to the number of times of drawing straight line on the Target Photo, to be defined as drawing end condition by following several algorithms; Another kind is when drawing straight line on the Target Photo and reach specified density, is defined as drawing end condition; Also having a kind of is to reach the fixed time according to the drafting straight line time on the Target Photo, is defined as drawing end condition.These three kinds of end conditions can be selected according to the source picture size of practical application, the parameters such as color of source picture.
The 3rd step: determine one section straight line at described source picture, start position and the final position of recording this straight line, and the colour of definite described straight line.
When determining the straight line on the picture of source for the first time, can determine start position and the final position of straight line at random.When determining straight line later on, can determine at random also that perhaps the terminal point of above straight line is determined the terminal point of current straight line more at random as the starting point of current straight line at every turn.The mode of Que Dinging is when the straight line of drawing is abundant at random, substantially can make definite straight line cover whole source picture, but the straight line that random fashion is determined, the colour of the pixel on whole straight line may have very big difference, therefore, increase the method that a straight line terminal point recomputates in this step, distribute by the colour of analyzing straight line and use iterative algorithm to redefine the final position of straight line.
A kind of iterative algorithm is, whether the colour of judging described straight line changes difference greater than preset threshold value, judges the length of described straight line whether greater than pre-set length, if two judged results are all is, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
Another kind of iterative algorithm is, whether judge the graded difference of described straight line greater than preset threshold value, judge the length of described straight line whether greater than pre-set length, if two judged results are all is, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
After determining the starting point and final position of straight line, determine the colour of this straight line, colour can be chosen the colour of any point pixel on the colour of pixel of straight line mid point or the straight line, and for colour picture, colour is color-values, and for the gray scale picture, colour is gray-scale value.
The 4th step: use identical colour to draw the straight line of weave effect in the same position of described Target Photo.
After having determined the correlation parameter of straight line, use these parameters to draw the straight line of weave effect in the same position of Target Photo.
The 5th step: judge whether draw end condition sets up, then finish in this way to draw the export target picture; As otherwise returned for the 3rd step.
Referring to accompanying drawing 1, with a specific embodiment the present invention is set forth now.Present embodiment is the generative process that a colour picture carries out weave effect, its end condition is the number of times of predetermined drafting straight line, the alternative manner of its terminal point is that the colour by straight line changes difference and calculates, and the colour of its straight line is the colour of the pixel of straight line mid point.
Concrete method is as follows:
The 1st step: initialization is drawn end condition for drawing maximum times N; The blank Target Photo (step S01 among the figure) of initialization.
The 2nd step: the initial starting point (step S02 among the figure) of selecting drafting at random.
The 3rd step: the terminal point (step S03 among the figure) of selecting lines at random.
The 4th step: according to the length (step S04 among the figure) of starting point and the definite braiding of terminal point lines.
The 5th step: according to iteration cut-off condition, calculate and adjust braiding lines length, determine terminal point coordinate (step S05 among the figure).
Referring to accompanying drawing 2, the step of iterative computation is:
The 501st step: set basic parameter, comprise straight line reduction step-length S, step S501 among the threshold value T(figure of the minimum length L of straight line and colour);
The 502nd step: the coordinate of each pixel on the calculated line (step S502 among the figure);
The 503rd step: the color pixel cell on the straight line is converted into gray scale, the half-tone information of each pixel on the calculated line (step S503 among the figure);
The 504th step: whether judge length that whether tonal range surpass threshold value T or straight line greater than minimum length L, if, then entered for the 505th step, if not, then enter the 506th and go on foot (step S504 among the figure);
The 505th the step: with terminal point coordinate along rectilinear direction to starting point coordinate moving step length S; Then repeating step the 502nd step until length that tonal range surpasses threshold value T or straight line less than minimum length L(figure in step S505);
The 506th the step: with current terminal point coordinate as final terminal point coordinate (step S506 among the figure).
The 6th step: the color (or gray scale: for gray scale source picture) (step S06 among the figure) of determining the braiding lines according to the source picture.
Referring to accompanying drawing 3, the definite of color finishes by following step:
The 601st step: the middle point coordinate of calculated line (step S601 among the figure).
The 602nd step: with the color of the mid point color (step S602 among the figure) as the straight line that will draw in the Target Photo.
The 7th step: braiding straight line (step S07 among the figure) is drawn in beginning in Target Photo.
The 8th step: judge and whether draw number of times greater than initial preset times N, if, draw and finish ((step S10 among the figure)), if not, enter next step (step S08 among the figure).
The 9th step: with the starting point of current terminal point as next straight line, repeated for the 3rd step, repeat to draw the braiding straight line until arriving default number of times (step S09 among the figure).
The above only is preferred implementation of the present invention; should be pointed out that for those skilled in the art, under the prerequisite that does not break away from the principle of the invention; can also make some improvements and modifications, these improvements and modifications also should be considered as protection scope of the present invention.

Claims (11)

1. the generation method of a weave effect picture is characterized in that, comprises the steps:
The first step: based on the source picture, set up a blank Target Photo with described source picture same size;
Second step: the end condition of determining to draw at described Target Photo lines;
The 3rd step: determine one section straight line at described source picture, start position and the final position of recording this straight line, and the colour of definite described straight line;
The 4th step: use identical colour to draw the straight line of weave effect in the same position of described Target Photo.
The 5th step: judge whether end condition is set up, then finish in this way to draw the export target picture; As otherwise returned for the 3rd step.
2. the generation method of a kind of weave effect picture according to claim 1 is characterized in that: the end condition in described second step reaches predetermined number of times for the number of times of drawing straight line at described Target Photo.
3. the generation method of a kind of weave effect picture according to claim 1 is characterized in that: the end condition in described second step is to draw straight line on the described Target Photo to reach specified density.
4. the generation method of a kind of weave effect picture according to claim 1 is characterized in that: the end condition in described second step is to draw the straight line time on the described Target Photo to reach the fixed time.
5. the generation method of a kind of weave effect picture according to claim 1 is characterized in that: in described the 3rd step, according to the colour distribution of the straight line of determining, use iterative algorithm to redefine the final position of straight line.
6. the generation method of a kind of weave effect picture according to claim 5, it is characterized in that: described iterative algorithm comprises the steps:
Whether the colour of judging described straight line changes difference greater than preset threshold value, judge that whether the length of described straight line is greater than pre-set length, if two judged results are all and are, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
7. the generation method of a kind of weave effect picture according to claim 5, it is characterized in that: described iterative algorithm comprises the steps:
Judge that whether the graded difference of described straight line is greater than preset threshold value, judge that whether the length of described straight line is greater than pre-set length, if two judged results are all and are, be the length that basic point shortens described straight line with the straight line start position then, the duplicate step of laying equal stress on; If two judgements have one for not, then determine the final position of straight line.
8. according to the generation method of each described a kind of weave effect picture in the claim 1 to 7, it is characterized in that: the colour of described straight line is the colour of pixel of the mid point of described straight line.
9. according to the generation method of each described a kind of weave effect picture in the claim 1 to 7, it is characterized in that: in described the 3rd step, draw for the first time the start position of straight line for obtaining at random, from for the second time, the starting point of drafting straight line is the terminal point of last straight line.
10. according to the generation method of each described a kind of weave effect picture in the claim 1 to 7, it is characterized in that: described source picture and Target Photo are cromogram, and the colour of described straight line is the color-values of described straight line.
11. the generation method according to each described a kind of weave effect picture in the claim 1 to 7 is characterized in that: described source picture and Target Photo are gray-scale map, and the colour of described straight line is the gray-scale value of described straight line.
CN201310145158.3A 2013-04-24 2013-04-24 Method for generating weaving effect picture Active CN103236070B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310145158.3A CN103236070B (en) 2013-04-24 2013-04-24 Method for generating weaving effect picture

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310145158.3A CN103236070B (en) 2013-04-24 2013-04-24 Method for generating weaving effect picture

Publications (2)

Publication Number Publication Date
CN103236070A true CN103236070A (en) 2013-08-07
CN103236070B CN103236070B (en) 2020-07-10

Family

ID=48884109

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310145158.3A Active CN103236070B (en) 2013-04-24 2013-04-24 Method for generating weaving effect picture

Country Status (1)

Country Link
CN (1) CN103236070B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11302286B2 (en) 2018-07-20 2022-04-12 Huawei Technologies Co., Ltd. Picture obtaining method and apparatus and picture processing method and apparatus

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737809A (en) * 2005-09-12 2006-02-22 刘立宏 Finger knitting auxiliary method using computer drawing
CN101313303A (en) * 2005-11-17 2008-11-26 株式会社岛精机制作所 Border pattern designing device, designing method, and designing program
CN101551911A (en) * 2009-05-07 2009-10-07 上海交通大学 Human face sketch portrait picture automatic generating method
CN101588438A (en) * 2009-06-10 2009-11-25 拓维信息系统股份有限公司 Mobile phone animation creation method for converting digitalized coloured picture into pictures of different styles
CN102855647A (en) * 2012-07-20 2013-01-02 广东威创视讯科技股份有限公司 Method for generating watercolor images and image processing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1737809A (en) * 2005-09-12 2006-02-22 刘立宏 Finger knitting auxiliary method using computer drawing
CN101313303A (en) * 2005-11-17 2008-11-26 株式会社岛精机制作所 Border pattern designing device, designing method, and designing program
CN101551911A (en) * 2009-05-07 2009-10-07 上海交通大学 Human face sketch portrait picture automatic generating method
CN101588438A (en) * 2009-06-10 2009-11-25 拓维信息系统股份有限公司 Mobile phone animation creation method for converting digitalized coloured picture into pictures of different styles
CN102855647A (en) * 2012-07-20 2013-01-02 广东威创视讯科技股份有限公司 Method for generating watercolor images and image processing system

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
吴旭虹,陈昭炯: "基于色彩传递的图像马赛克算法研究", 《计算机工程》 *
唐颖,房宽峻,付少海,田安丽,张连兵: "蜡染冰纹的计算机仿真研究", 《纺织学报》 *
徐伯俊,李艳梅: "织物立体仿真的一种新思路", 《北京纺织》 *
沈一锋: "让图片出彩的"光影魔术手"", 《照相机》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11302286B2 (en) 2018-07-20 2022-04-12 Huawei Technologies Co., Ltd. Picture obtaining method and apparatus and picture processing method and apparatus

Also Published As

Publication number Publication date
CN103236070B (en) 2020-07-10

Similar Documents

Publication Publication Date Title
CN105913485B (en) A kind of generation method and device of three-dimensional virtual scene
CN104331699B (en) A kind of method that three-dimensional point cloud planarization fast search compares
CN105719351B (en) A kind of method and apparatus of display electronic map
CN103413340B (en) The image stick figure generation method that the degree of depth strengthens
CN104574495B (en) A kind of image rendering method and device
DE102014106780A1 (en) Graphics processing unit and tile-based rendering method
CN105303616A (en) Embossment modeling method based on single photograph
CN110039186A (en) A kind of surface model paths planning method applied to laser surface ablation
CN103903216B (en) Determination method based on raster anti-fake concealed image vector diagram line width
CN106778881B (en) Digital printing method and device
CN105389541A (en) Fingerprint image recognition method and device
CN102147927A (en) Processing method for terrain texture map and processing device
Shesh et al. Efficient and dynamic simplification of line drawings
CN103236070A (en) Weaving effect picture generation method
WO2010015190A1 (en) Image analysis method of knitting pattern
CN110554871B (en) Method and device for drawing Ninepatch graph and computer readable storage medium
CN101464953A (en) Outline extracting apparatus and method
CN110610504A (en) Pencil drawing generation method and device based on skeleton and tone
CN109785443A (en) A kind of three-dimensional model simplifying method for large ocean engineer equipment
CN105957053A (en) Two-dimensional image depth-of-field generating method and two-dimensional image depth-of-field generating device
JP2011028743A5 (en) Image processing apparatus and image processing method
CN106845350B (en) A kind of tree-shaped node recognition methods based on image procossing
CN105828061B (en) A kind of virtual view quality evaluating method of view-based access control model masking effect
JP2010028429A5 (en)
CN104103035A (en) Three-dimensional model scaling method

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20200525

Address after: 201306 No. 1350 olive Road, Shanghai, Pudong New Area

Applicant after: Chi Dong Xiang

Address before: 200240 No. 690, Jiangchuan Road, Shanghai, Minhang District

Applicant before: Shanghai Dianji University

Effective date of registration: 20200525

Address after: 201306 1B, Building 11, Lingang Software Park, 99 Huanhu West Road, Pudong New Area, Shanghai

Applicant after: SINOCBD Inc.

Address before: 201306 No. 1350 olive Road, Shanghai, Pudong New Area

Applicant before: Chi Dong Xiang

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant