CN103400417B - A kind of image processing method of the simulation copperplate engraving effect bionical based on computer - Google Patents
A kind of image processing method of the simulation copperplate engraving effect bionical based on computer Download PDFInfo
- Publication number
- CN103400417B CN103400417B CN201310335000.2A CN201310335000A CN103400417B CN 103400417 B CN103400417 B CN 103400417B CN 201310335000 A CN201310335000 A CN 201310335000A CN 103400417 B CN103400417 B CN 103400417B
- Authority
- CN
- China
- Prior art keywords
- value
- evolution
- mapping table
- engraving
- copperplate
- 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.)
- Active
Links
- 230000000694 effects Effects 0.000 title claims abstract description 24
- 238000004088 simulation Methods 0.000 title claims abstract description 14
- 238000003672 processing method Methods 0.000 title claims abstract description 13
- 238000000034 method Methods 0.000 claims abstract description 26
- 238000013507 mapping Methods 0.000 claims abstract description 24
- 230000008569 process Effects 0.000 claims abstract description 23
- 238000001228 spectrum Methods 0.000 claims description 22
- 229910000906 Bronze Inorganic materials 0.000 claims description 11
- 239000010974 bronze Substances 0.000 claims description 11
- KUNSUQLRTQLHQQ-UHFFFAOYSA-N copper tin Chemical compound [Cu].[Sn] KUNSUQLRTQLHQQ-UHFFFAOYSA-N 0.000 claims description 11
- 238000009395 breeding Methods 0.000 claims description 10
- 230000001488 breeding effect Effects 0.000 claims description 9
- 235000001968 nicotinic acid Nutrition 0.000 claims description 9
- 230000002068 genetic effect Effects 0.000 claims description 8
- 238000009396 hybridization Methods 0.000 claims description 4
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 abstract description 22
- 229910052802 copper Inorganic materials 0.000 abstract description 22
- 239000010949 copper Substances 0.000 abstract description 22
- 230000006870 function Effects 0.000 description 6
- 238000012545 processing Methods 0.000 description 4
- 230000008901 benefit Effects 0.000 description 3
- 230000002950 deficient Effects 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 2
- 239000000463 material Substances 0.000 description 2
- 230000000007 visual effect Effects 0.000 description 2
- PCTMTFRHKVHKIS-BMFZQQSSSA-N (1s,3r,4e,6e,8e,10e,12e,14e,16e,18s,19r,20r,21s,25r,27r,30r,31r,33s,35r,37s,38r)-3-[(2r,3s,4s,5s,6r)-4-amino-3,5-dihydroxy-6-methyloxan-2-yl]oxy-19,25,27,30,31,33,35,37-octahydroxy-18,20,21-trimethyl-23-oxo-22,39-dioxabicyclo[33.3.1]nonatriaconta-4,6,8,10 Chemical compound C1C=C2C[C@@H](OS(O)(=O)=O)CC[C@]2(C)[C@@H]2[C@@H]1[C@@H]1CC[C@H]([C@H](C)CCCC(C)C)[C@@]1(C)CC2.O[C@H]1[C@@H](N)[C@H](O)[C@@H](C)O[C@H]1O[C@H]1/C=C/C=C/C=C/C=C/C=C/C=C/C=C/[C@H](C)[C@@H](O)[C@@H](C)[C@H](C)OC(=O)C[C@H](O)C[C@H](O)CC[C@@H](O)[C@H](O)C[C@H](O)C[C@](O)(C[C@H](O)[C@H]2C(O)=O)O[C@H]2C1 PCTMTFRHKVHKIS-BMFZQQSSSA-N 0.000 description 1
- 102000040350 B family Human genes 0.000 description 1
- 108091072128 B family Proteins 0.000 description 1
- 108091065810 E family Proteins 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 239000008280 blood Substances 0.000 description 1
- 210000004369 blood Anatomy 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000003086 colorant Substances 0.000 description 1
- 238000009402 cross-breeding Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000000877 morphologic effect Effects 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
Landscapes
- Image Analysis (AREA)
Abstract
The invention discloses the image processing method of a kind of simulation copperplate engraving effect bionical based on computer, comprise the following steps: step 1: form mapping table based on crossover process;Step 2: select typical application in artwork, carries out area extension based on this typical application and forms the region needing to carry out copper coin engraving simulated operation, be region to be operated;Step 3: based on this mapping table, described region to be operated is carried out copper coin engraving simulated operation, form the final image with simulation copper coin engraving effect.Should be true to nature based on the image processing method simulation effect simulating copperplate engraving effect that computer is bionical, it is easy to implementing, flexibly, data volume is little, and hardware requirement is not high in creation, is suitable to enforcement on mobile phone.
Description
Technical Field
The invention relates to an image processing method for simulating copperplate engraving effect based on computer bionics.
Background
Copperplate engraving, also known as copper engraving, is a engraving made on a copper plate by a cutter. The copperplate engraving art has unique technique, fine workmanship, strong stereoscopic impression, vivid image, luxury and elegant appearance, simple and unsophisticated color, fine texture and permanent color change of the picture, and is internationally considered as a famous and precious artwork which is worthy of collection and has value-added prospect.
How to make the individual color portrait present artistic effect similar to copper plate carving by processing the individual color portrait is a background picture of a self-using mobile phone or is handed and appreciated among relatives and friends, which is lacking in the prior art.
Therefore, it is necessary to design a new image processing method to simulate the halftone engraving effect.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an image processing method for simulating copperplate engraving effect based on computer bionics, which has the advantages of vivid simulation effect, easy implementation, flexible creation, small data volume, low requirement on hardware and suitability for implementation on a mobile phone.
The technical solution of the invention is as follows:
an image processing method for simulating copperplate engraving effect based on computer bionics comprises the following steps:
step 1: forming a mapping table based on the hybridization process;
the mapping table consists of N rows, each row including 4 parameters:wherein i is a row number, i ═ 1, 2, 3.., N;y and R, G, B values corresponding to row i, respectively;
step 2: selecting a sample plate point in an original image, and performing area expansion on the basis of the sample plate point to form an area needing to be subjected to copper plate engraving simulation operation, namely an area to be operated;
and step3: and carrying out copper plate engraving simulation operation on the area to be operated based on the mapping table to form a final image with a simulated copper plate engraving effect.
The region expansion in step2 is realized by the following steps:
step 1: establishing a stack, and pressing the selected sample plate point into the stack as an original sample plate point; setting an expansion threshold value T (default value is 90);
step 2: popping a sample plate from the stack, sequentially checking Y values of 8 pixel points around the sample plate, if the difference between the Y value of a certain pixel point and the Y value of the sample plate is less than a threshold value T, marking the point as a new sample plate point and pressing the point into the stack, and turning to the step 3; otherwise, if no new sample plate point exists, turning to the step 3;
and step3: detecting whether the stack is empty, and if the stack is not empty, turning to the step 2; if the stack is empty, the loop is ended, and the area formed by all the marked new template points is the final area to be operated.
In the step3, the simulation operation process of the copper plate engraving comprises the following steps: and calculating the Y value of any pixel point of the region to be operated, then searching the RGB value corresponding to the Y value in the mapping table according to the Y value, and finally covering the RGB value with the original RGB value of the pixel point.
The process of forming the mapping table based on the hybridization process in step1 is as follows:
step 1) selecting three color blocks of 'dark brown', 'earth yellow' and 'bright yellow' in the real copper plate carving image red blood, wherein the size of each color block is not less than 10 multiplied by 10 pixels, obtaining average RGB three-primary-color data of each color block, and calculating corresponding Y values;
step 2) taking the three-color block together with pure black and pure white as five parents for obtaining a genetic genealogy through breeding, and simply referring the five parents of full black, dark brown, earthy yellow, bright yellow and full white as parents A, B, C, D and E;
step 3), forming an A _ B ethnic group spectrum by taking A as a female parent and B as a male parent through a backcross iterative evolution process;
b is used as a female parent and C is used as a male parent, and a B _ C ethnic group spectrum is formed through a backcross iterative evolution process;
forming a C _ D ethnic group spectrum by taking C as a female parent and D as a male parent through a backcross iterative evolution process;
forming a D _ E ethnic group spectrum by taking D as a female parent and E as a male parent through a backcross iterative evolution process;
and 4) merging the family spectrums into a total family spectrum, taking the total family spectrum as a panchromatic pedigree for simulating dark to clear bronze color carved on the copper plate as a mapping table, wherein the mapping table reflects the corresponding relation between main characters and accompanying characters after backcross for multiple generations, namely reflects the one-to-one corresponding relation between Y and RGB (the mapping table is also called as a Y-RGB table).
The backcross iterative evolution process in step 3) is as follows:
marking the main character and the accompanying character of the female parent of the receptor as Ma,Mb,Mc,MdThe superscripts a, b, c and d correspond to the primary trait Y and the secondary trait R, G, B of the female parent, respectively;
the character of the donor male parent is recorded as Fa,Fb,Fc,Fd,
Recording the character of filial generation as Sa,Sb,Sc,SdAnd in dta,dtb,dtc,dtdAs evolution variables of the 4 traits, the following iterative evolution operation is performed:
step 1: evolution variable dta,dtb,dtc,dtdIs set to ρmSin(n)|m=a,b,c,dWhere ρ ism|m=a,b,c,dTo control the evolution amplitude (with initial values set to 2.0); n is the number of backcrosses, and a sine function sin (n) related to n is used for controlling the evolution speed;
step 2: taking X (sequentially taking ABCD in the preamble as a female parent and Z (sequentially taking BCDE in the preamble as a Z) as a male parent, and carrying out backcross iterative evolution on the basis of the following formula to obtain F after carrying out n-generation backcrossnThe characteristics of (A):
in the formulaAndrespectively the main character and the associated character of the filial generation of n generations, dta,dtm|m=b,c,dAre the evolution variables of them,random numbers (rand) different with n have a value range of 0-20, and the overlapped random numbers are used as development conditions);
step3: if evolution algebra n < Fa-MaIncreasing n by 1 and then returning to Step2, otherwise, turning to Step 4;
step4: through Fa-MaAfter evolutionary generation, if the formula abs (R) is satisfied1-R2)<Th|m=b,c,dThen, the breeding with Z as the receptor parent and Z as the donor parent is finished, and Step5 is switched; otherwise, according to formula If (abs (R)2)>abs(R1))Then(ρm=(1+0.0618)ρm)Else(ρm=(1-0.0618)ρm)|m=b,c,dReversely correcting rhom|m=b,c,dValue, go to Step2 for reiteration;
wherein,
wherein abs (x) is an absolute value function, and Th is an error tolerance value of 0.01;
step 5: record F1,F2,……,FnGenetic profiles of the formed traits, i.e. recordings As an X _ Z score.
The core of the invention is that based on the biological genetics theory, a biological genetic character family spectrum is established as a full-color image template from bright to dark of bronze color through computer bionics. (Note that the term "trait" in biology refers to the sum of morphological and physiological characteristics exhibited by an organism. for example, yellow and green, round and wrinkled pea in the two parents yellow and green, respectively, characterize different traits.)
In order to realize DIY image operation fitting with the theme of cartoon works aiming at a special platform of a mobile phone, the following series of measures are adopted in design, and particularly the memory requirement of an application program is reduced:
A. the simpler the application the better. We make each component into a Midlet as much as possible, and encapsulate multiple midlets used in one Midlet packet, which enables the program manager of the handset to manage the resources used by the midlets and midlets more economically.
B. The smaller the application the better. And deleting components which are temporarily unused in the application program, and reducing unnecessary information as much as possible so as to reduce the volume of the whole program. When downloading applications over a wireless network, smaller applications will significantly reduce download times and can run compatibly (but not exclusively) with other applications on the device.
C. The total memory requirement of the application program is reduced as much as possible. The main measures are as follows:
the object type is used less, and the scalar type is used instead. Because scalar types take up less memory than object types;
② declare objects as few as possible. Because the system allocates space on the runtime heap when an object is declared, it should be reallocated when an application is about to use the object, rather than being allocated entirely at program startup. Also, once the program no longer needs the object, the references to the object are each assigned null.
And thirdly, using the data type according to the precision requirement. Int should be replaced by a data type of bootean, byte, short, etc. whenever possible. This detail has little impact on desktop programs, but will have a much less than fruitful impact on the mobile.
And fourthly, reusing the materials as much as possible. Multiple references are made to use the same object at different times in the program life cycle. For example, reusing some large arrays, reusing may utilize allocated runtime memory, using "lazy" instantiation. Although this is not software engineering principles, it is suitable for the reality of a mobile phone, a computing device with very weak capabilities.
Avoid creating objects in the loop.
Sixthly, checking the use condition of the memory frequently. The related methods are as follows: freeMemory and totalMemory. The outmemorror error is handled by itself. It should be ensured that when the application program overflows from the memory, there is a predetermined exit routine to manage this, and not to leave it to the operating system.
And releasing the resources in time. Resources such as files, network connections, etc. are reluctant to be used when they are no longer needed. The necessary cleanup operations should be performed on their own without relying on the garbage collector or the hosting environment.
And more local variables are used. In desktop applications, developers are accustomed to setting up more class data members and less using local variables. But class data members are actually "global variables" within a class, require frequent data scheduling, stack operation support, and actually consume CPU computations to support. By assigning local variables, the CPU throughput of the application can be reduced by eliminating the extra step of accessing data members of the class. While the benefits of encapsulating data in classes are lost, the processing speed of applications that run on small computing devices such as cell phones and require large amounts of data is a first consideration.
Definition of biological backcrossing. Backcrossing of organisms is a special way of crossbreeding organisms. The backcross breeding method can be adopted for the assumption that the A variety has many excellent traits but individual traits are deficient, while the B variety has excellent traits which are deficient in the A variety: i.e. hybridizing the variety B with the variety A to form F1Then F1Backcrossing with A variety to form F2,F2Backcrossing with A variety to form F3… … through Fn. Through multiple backcrossing and selection, the original excellent characters of the A variety are maintained, meanwhile, the original deficient characters are introduced, and a new variety with improved characters is obtained. Herein, the breed A is called as the receptor parent; breed B is called donor parent.
Has the advantages that:
the image processing method for simulating the bronze printing engraving effect based on computer bionics can flexibly and vividly simulate the unique artistic effect of bronze printing engraving by adopting a computer bionics algorithm based on backcross iterative evolution, and enables a mobile phone user to use a picture of the mobile phone user as a background picture transformed from a material, thereby providing a platform for the user to creatively create DIY images and further expanding the image processing function of the mobile phone.
The invention reduces data volume and improves CPU operation efficiency, so that the mobile phone cartoon work restricted by mobile phone screen size and mobile phone computing power can meet good visual impression of users with low creation cost and rapid operation effect. In particular, it is to be noted that: one of the purposes of the invention is to realize DIY image operation on a platform with relatively weaker software and hardware resources than a computer, such as a mobile phone, so that the adoption of the series of targeted measures is completely necessary in design.
Drawings
FIG. 1 is a flow chart of an image processing method for simulating copperplate engraving effect based on computer bionics;
FIG. 2 is a real copper plate engraving image;
FIG. 3 is an original drawing 1;
FIG. 4 is an effect diagram of the simulated copper plate engraving operation performed on the original image 1;
FIG. 5 is an original drawing 2;
fig. 6 is an effect diagram of the simulation operation of the copper plate engraving on the original 2.
Detailed Description
The invention will be described in further detail below with reference to the following figures and specific examples:
example 1:
referring to fig. 1, a genetic genealogy formed based on biological backcross breeding is established as a panchromatic mapping table simulating bronze sculptures. The mapping table contains the Y-RGB mapping covering from full black, to dark brown, earthy yellow, bright yellow to full white.
(Note that the color spaces primarily used in the multimedia field are RGB, which expresses gray scale values for the three primary colors, and YCrCb (YUV), which expresses luminance, chrominance, and color difference information values because the human eye is more sensitive to low frequency signals than to high frequency signals, to changes in brightness than to changes in color, YCrCb is closer to the human visual system)
Wherein, the formula of mutual conversion between RGB and YCrCb is as follows:
Y=int(0.257×R+0.504×G+0.98×B+16)(1)
Cr=int(0.439×R-0.368×G-0.71×B+128)(2)
Cb=int(-0.148×R-0.291*G+0.439×B+128)(3)
B=int(1.164×(Y-16)+2.017×(Cb-128))(4)
G=int(1.164×(Y-16)-0.813×(Cr-128)-0.392×(Cb-128))(5)
R=int(1.164×(Y-16)+1.596×(Cr-128)))(6)
int (x) in the formula is an integer function.
As can be seen from the following partial data: the inverse Y-to-RGB transformation is not unique (e.g., different RGB values in any of the rows 1-6 below all correspond to the same Y value).
Since our goal is to transform a standard color image into copperplate engraving of the bronze color, we can, by nature, uniquely convert from RGB to YCrCb, but cannot uniquely convert from YCrCb back to RGB of a single bronze color family. This requires the following steps to obtain a genetic pedigree established based on biological backcross breeding as a full color template simulating the bright to dark bronze color of the copper plate carving.
Step1, selecting three color blocks of 'dark brown', 'earth yellow' and 'bright yellow' through a real copper plate carving portrait, obtaining average red, green and blue (RGB) tricolor data of each color block, and calculating corresponding Y values.
Step 1: three color blocks of 'dark brown', 'upper yellow' and 'bright yellow' are selected from a real copper plate engraving image as shown in figure 1, and the size of each color block is not less than 10 multiplied by 10 pixels.
Step 2: the average R, G, B data for each color block was found and the corresponding Y value was calculated.
And 2, taking the three color blocks together with pure black and pure white as five parents for obtaining a genetic genealogy through breeding. Hereinafter, the five parents from full black to dark brown, earthy yellow, bright yellow to full white are simply called parents A, B, C, D and E. Obviously, they are five parents with very different relative color traits, which meet the aforementioned criteria for selecting the hybrid parents, and they have significant traits representative of the hybrid parents.
Further, when the parent A and the parent B are crossed, the A is used as a recipient parent (female parent) and the B is used as a donor parent (male parent), and the cross is performed to form a progeny F1Then F1Backcrossing with receptor parent (mother parent) to form F2,F2Backcrossing with receptor parent (mother parent) to form F3… … obtaining F having a property very close to that of B (i.e., satisfying the following formula (13)) up to the n generationn. Thus, if we record F1,F2,……,FnThe character genetic evolution spectrum of A to B, called A _ B family spectrum for short, can be obtained in the character evolution and evolution process of (1).
Further, Y is used as a main trait of a parent and R, G, B is used as a secondary trait in the backcross breeding described below. For simplicity, the main and associated traits of the female parent of the recipient are recorded as Ma,Mb,Mc,MdAccordingly, the donor male parent has the trait of Fa,Fb,Fc,FdThe character of the filial generation is Sa,Sb,Sc,SdAnd in dta,dtb,dtc,dtdAs evolution evolutionary variables of these traits, the following iterative evolutionary evolution operation was performed.
Step 1: evolution variable dta,dtb,dtc,dtdIs set to ρmSin(n)|m=a,b,c,dWhere ρ ism|m=a,b,c,dTo control the evolution amplitude (with initial values set to 2.0); the sine function sin (n) related to n is used for controlling the evolution speed; [ n ] is the number of generations of backcross, see aboveF of (A)1,F2,……,FnSubscript ] and a small random number is superimposed as a developmental condition.
Step 2: the backcross iterative evolution process with A as female parent and B as male parent can be formalized into formulas (7) - (10), and F is obtained after n generations of backcrossnThe trait of (a) would be:
obviously, in the formulaAndrespectively the main character and the associated character of the filial generation of n generations, dta,dtm|m=b,c,dAre the evolution variables of them,is a random number that varies with n.
Step3: if evolution algebra n < Fa-MaIncreasing n continues at Step2, otherwise, turning to Step 4.
Step4: through Fa-MaAfter the generation evolution, if the formula (13) is satisfied, namely FnThe ratio (R) of the difference between the respective accompanying traits of (1) and the respective accompanying traits of (2) of (3)1) And FnIs compared with the difference between the principal form of the male parent (R)2) If the difference is less than the allowable value, the breeding with A as the receptor parent (female parent) and B as the donor parent (male parent) is finished, and Step5 is switched; otherwise, p is corrected in reverse according to equation (14)m|m=b,c,dValue, go to Step2 for reiteration;
abs(R1-R2)<Th|m=b,c,d(13)
in the above formula, abs (x) is an absolute value function, and Th is an error tolerance value, which is generally 0.01.
If(abs(R2)>abs(R1))Then(ρm=(1+0.0618)ρm)Else(ρm=(1-0.0618)ρm)|m=b,c,d
(14)
(note: in formula (14) we use the golden ratio to accelerate iterative convergence, the operation shows that the calculation is immediately converged to the expected Th value after short and short 5-14 iterations)
Step 5: record F1,F2,……,FnGenetic profiles of the formed traits, i.e. recordings As a _ B score.
Step 6: normalizing the family score to Ma~FaAnd (3) an integer space, wherein the genetic expression of the relative characters in filial generations is considered, and if individual obviously differentiated progeny exist, the relative characters are deleted and replaced by normal progeny.
And step3: and completely repeating the steps 1-5, and obtaining the B _ C classification spectrum from B to C by taking B as a receptor parent (female parent) and C as a donor parent (male parent). Thus, a C _ D family spectrum of C to D, a D _ E family spectrum of D to E are obtained.
And 4, step4: combining all the family spectrums to form a total family spectrum, using the total family spectrum as a panchromatic pedigree for simulating dark to bright bronze color carved on a copper plate as a special mapping table, wherein the mapping table reflects the main characters after n generations of backcrossesAnd associated traitsThat is, in fact, a one-to-one correspondence of Y and RGB.
Full color pedigree from dark to light (Y-RGB full series mapping table)
Algebra (i.e. main character Y) | Accompanying Property 1(R) | Accompanying Property 2(G) | Accompanying Property 3(B) |
Generation F1 | 1 | 3 | 5 |
Generation F2 | 2 | 3 | 8 |
Generation F3 | 5 | 6 | 11 |
Generation F4 | 5 | 7 | 14 |
… | … | … | … |
Generation F78 | 41 | 70 | 124 |
Generation F79 | 43 | 73 | 126 |
Generation F80 | 43 | 72 | 126 |
Generation F81 | 45 | 74 | 128 |
Generation F82 | 44 | 73 | 128 |
Generation F83 | 46 | 75 | 130 |
Generation F84 | 45 | 75 | 130 |
Generation F85 | 47 | 78 | 131 |
Generation F86 | 47 | 78 | 131 |
… | … | … | … |
Generation F249 | 246 | 250 | 253 |
Generation F250 | 248 | 249 | 253 |
Generation F251 | 250 | 250 | 255 |
Generation F252 | 252 | 251 | 255 |
Generation F253 | 255 | 253 | 255 |
Generation F254 | 255 | 253 | 255 |
Generation F255 | 255 | 253 | 255 |
[ Y value equals n ]
And secondly, expanding the area. This operation (in this context using conventional image processing techniques) is required in fig. 2 "original image" to confine the copperplate engraving to the desired image area. The process is that a minimum area which is selected by a user and is most meaningful for representing the image is expanded to a full graph by a threshold value T, and an image area which needs to be simulated to be carved by a copper plate is obtained, and the process specifically comprises the following contents:
step 1: selecting a certain original template point in the image by a user, and setting an expansion threshold value T (default value is 90);
step 2: building a stack, and pressing the original sample plate into the stack;
and step3: popping a sample plate point out of the stack, sequentially checking Y values of 8 pixel points around the sample plate point, if the difference between the Y value of a certain point and the sample plate point is less than a threshold value T, marking the point as a new sample plate point and pressing the point into the stack, and turning to the step 4; otherwise, if no new sample plate point exists, turning to the step 4;
and 4, step4: detecting whether the stack is empty, if not, popping out a point from the stack, and turning to the step 3; if the stack is empty, turning to step 5;
and 5: the copperplate engraving simulation was performed for all the areas consisting of all the new template points that have been marked as follows.
And thirdly, simulating copper plate engraving. The following steps are carried out in the image area:
step 1: and (3) taking out a pixel point in the simulated copperplate carving area, and calculating the Y value of the pixel point according to the pixel RGB value by using the formula (1).
Step 2: according to the Y value, the formed mapping table is checked to obtain corresponding bronze RGB value to replace the original pixel value, and finally the creation effect like 'simulated copper plate carving' in figure 2 is obtained.
Claims (3)
1. An image processing method for simulating copperplate engraving effect based on computer bionics is characterized by comprising the following steps:
step 1: forming a mapping table based on the hybridization process;
the mapping table consists of N rows, each row including 4 parameters:wherein i is the row number, i ═ 1, 2, 3, …, N;y and R, G, B values corresponding to row i, respectively;
the process of forming the mapping table based on the hybridization process in step1 is as follows:
step 1) selecting three color blocks of dark brown, earthy yellow and bright yellow on a real copperplate engraving image, obtaining average RGB (red, green and blue) tricolor data of each color block, wherein the average RGB tricolor data is R, G, B values of the average color block, and calculating corresponding Y values; the Y value is the brightness value of the pixel point;
step 2) taking the three-color block together with pure black and pure white as five parents for obtaining a genetic genealogy through breeding, and simply referring the five parents of full black, dark brown, earthy yellow, bright yellow and full white as parents A, B, C, D and E;
step 3), forming an A _ B ethnic group spectrum by taking A as a female parent and B as a male parent through a backcross iterative evolution process;
b is used as a female parent and C is used as a male parent, and a B _ C ethnic group spectrum is formed through a backcross iterative evolution process;
forming a C _ D ethnic group spectrum by taking C as a female parent and D as a male parent through a backcross iterative evolution process;
forming a D _ E ethnic group spectrum by taking D as a female parent and E as a male parent through a backcross iterative evolution process;
step 4) merging each family spectrum into a total family spectrum to be used as a panchromatic pedigree for simulating dark to bright bronze carving of a copperplate, and taking the panchromatic pedigree as a mapping table, wherein the mapping table reflects the corresponding relation between main characters and accompanying characters after multi-generation backcrossing, namely reflects the one-to-one corresponding relation between Y and RGB;
step 2: selecting a sample plate point in an original image, and performing area expansion on the basis of the sample plate point to form an area needing copperplate engraving simulation operation, namely the area to be operated;
and step3: performing copperplate engraving simulation operation on the area to be operated based on the mapping table to form a final image with a copperplate engraving simulation effect;
in the step3, the simulation operation process of copperplate engraving comprises the following steps: and calculating the Y value of any pixel point of the region to be operated, then searching the RGB value corresponding to the Y value in the mapping table according to the Y value, and finally covering the RGB value with the original RGB value of the pixel point.
2. The computer-bionics-based image processing method for simulating copperplate engraving effect according to claim 1, wherein the region expansion in step2 is realized by the following steps:
step 21: establishing a stack, and pressing the selected sample plate point into the stack as an original sample plate point; setting an expansion threshold value T;
step 22: popping a sample plate from the stack, sequentially checking Y values of 8 pixels around the sample plate, wherein the Y value is the brightness value of the pixel, and if the difference between the Y value of a certain pixel and the Y value of the sample plate is less than a threshold value T, marking the pixel as a new sample plate and pressing the pixel into the stack, and turning to step 23; otherwise, if no new template point exists, go to step 23;
step 23: detecting whether the stack is empty, if not, turning to step 22; if the stack is empty, the loop is ended, and the area formed by all the marked new template points is the final area to be operated.
3. The computer-bionics-based image processing method for simulating copperplate engraving effect according to claim 1, wherein the backcross iterative evolution process in step 3) is as follows:
marking the main character and the associated character of the female parent as Ma,Mb,Mc,MdThe superscripts a, b, c and d correspond to the primary trait Y and the secondary trait R, G, B of the female parent, respectively;
the character of the male parent is recorded as Fa,Fb,Fc,Fd,
Recording the character of filial generation as Sa,Sb,Sc,SdAnd in dta,dtb,dtc,dtdAs evolution variables of the traits of the 4 filial generations, the following iterative evolution operations were performed:
step 1: evolution variable dta,dtb,dtc,dtdIs set to ρmSin(n)|m=a,b,c,dWhere ρ ism|m=a,b,c,dFor controlling the magnitude of evolution; n is the number of backcrosses, and a sine function sin (n) related to n is used for controlling the evolution speed;
step 2: taking X as a female parent and Z as a male parent, carrying out backcross iterative evolution based on the following formula to obtain F after carrying out n-generation backcrossnThe characteristics of (A):
in the formulaAndrespectively the main character and the associated character of the filial generation of n generations, dta,dtm|m=b,c,dAre the evolution variables of them,is a random number that varies with n;
step3, if evolution algebra n < Fa-MaIncreasing n by 1 and then returning to Step2, otherwise, turning to Step 4;
step4 through Fa-MaAfter evolutionary generation, if the formula abs (R) is satisfied1-R2) If the number is less than Th, finishing the breeding by taking Z as a female parent and Z as a male parent, and turning to Step 5; otherwise, according to formula If (abs (R)2)>abs(R1))Then(ρm=(1+0.0618)ρm)Else(ρm=(1-0.0618)ρm)|m=b,c,dReversely correcting rhom|m=b,c,dValue, go to Step2 for reiteration;
wherein,
wherein abs (x) is an absolute value function, and Th is an error tolerance value of 0.01;
step 5: record F1,F2,……,FnGenetic profiles of the formed traits, i.e. recordingsAs an X _ Z score.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310335000.2A CN103400417B (en) | 2013-08-02 | 2013-08-02 | A kind of image processing method of the simulation copperplate engraving effect bionical based on computer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310335000.2A CN103400417B (en) | 2013-08-02 | 2013-08-02 | A kind of image processing method of the simulation copperplate engraving effect bionical based on computer |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103400417A CN103400417A (en) | 2013-11-20 |
CN103400417B true CN103400417B (en) | 2016-07-06 |
Family
ID=49564028
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310335000.2A Active CN103400417B (en) | 2013-08-02 | 2013-08-02 | A kind of image processing method of the simulation copperplate engraving effect bionical based on computer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103400417B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103971389B (en) * | 2014-04-28 | 2017-02-15 | 拓维信息系统股份有限公司 | Camouflage facial makeup realizing method for cell phone games |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101082765A (en) * | 2006-06-01 | 2007-12-05 | 高宏 | Three-dimensional portrait photograph system and realizing method thereof |
CN102089719A (en) * | 2008-07-10 | 2011-06-08 | 伊利诺斯工具制品有限公司 | Imaging of deep structures or reliefs for shallow relief embossing |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP2590144B1 (en) * | 2011-11-03 | 2018-10-24 | Dassault Systèmes | Designing a modeled volume represented by dexels |
-
2013
- 2013-08-02 CN CN201310335000.2A patent/CN103400417B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101082765A (en) * | 2006-06-01 | 2007-12-05 | 高宏 | Three-dimensional portrait photograph system and realizing method thereof |
CN102089719A (en) * | 2008-07-10 | 2011-06-08 | 伊利诺斯工具制品有限公司 | Imaging of deep structures or reliefs for shallow relief embossing |
Non-Patent Citations (2)
Title |
---|
Real-time relief mapping on arbitrary polygonal surfaces;Manuel M.Oliveira等;《Processings of the 2005 Symposium on Interactive 3D Graphics》;20060406;1-9 * |
基于套色浮雕的动漫素材创作技术;彭革刚;《电脑与信息技术》;20111231;第19卷(第6期);9-11 * |
Also Published As
Publication number | Publication date |
---|---|
CN103400417A (en) | 2013-11-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108830912B (en) | Interactive gray image coloring method for depth feature-based antagonistic learning | |
CN101529495B (en) | Image mask generation | |
CN105374007B (en) | Merge the pencil drawing generation method and device of skeleton stroke and textural characteristics | |
CN112069339B (en) | Background picture processing and search result displaying method, device, equipment and medium | |
US20200364910A1 (en) | Line drawing generation | |
EP4057609B1 (en) | Method and apparatus for image correction | |
CN106056666A (en) | Three-dimensional model processing method and three-dimensional model processing system | |
CN104915976A (en) | Image processing method and system for simulating pencil sketch | |
CN108288296A (en) | The picture batch coloring method of digital picture painting methods and digital publication | |
US20190362524A1 (en) | Oil painting stroke simulation using neural network | |
CN103400417B (en) | A kind of image processing method of the simulation copperplate engraving effect bionical based on computer | |
CN111784817A (en) | Shadow display method and device, storage medium and electronic device | |
CN102521867B (en) | Mobile phone anime character and background creation method | |
CN102034256B (en) | Mobile phone cartoon character creating method based on boundary tracking and pseudo-coloring | |
CN111681317B (en) | Data processing method and device, electronic equipment and storage medium | |
CN113440845A (en) | Rendering method and device of virtual model, storage medium and electronic device | |
CN107506736A (en) | Online education video fineness picture intercept method based on deep learning | |
CN108492365B (en) | Leaf self-adaptive chartlet visual simulation method based on color grading | |
CN106251316A (en) | Method and device for repairing photos | |
CN106021228A (en) | Method and system for performing text analysis by utilizing knowledge topographic map | |
CN103886550B (en) | Sketch texture method of adjustment and system | |
KR102215607B1 (en) | Electronic device capable of correction to improve the brightness of dark images and operating method thereof | |
CN112734673A (en) | Low-illumination image enhancement method and system based on multi-expression fusion | |
CN106528094A (en) | A similarity-based application icon classifying method and system | |
CN112766277A (en) | Channel adjustment method, device and equipment of convolutional neural network model |
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 |