Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to make the advantages of the technical solutions of the present invention clearer, the present invention is described in detail below with reference to the accompanying drawings and examples.
Example one
The present embodiment provides a fm network control method, as shown in fig. 1, where the fm network control method includes:
101. generating a first filter matrix and a second filter matrix;
102. initializing a dyeing matrix, a threshold, a black dyeing probability matrix and a white dyeing probability matrix;
103. selecting pixel points to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, and dyeing the pixel points black;
104. selecting pixel points to be dyed according to the dyeing matrix, the dyeing probability matrix and the second filter matrix which are updated once, and dyeing the pixel points to be dyed with white;
105. judging whether all the pixel points are dyed, if so, repeating the step 103 and the step 104, otherwise, ending the step.
The frequency modulation and amplitude modulation network control method comprises the steps of firstly generating a first filter matrix and a second filter matrix, initializing a dyeing matrix, a threshold, a black dyeing probability matrix and a white dyeing probability matrix, selecting pixel points to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, dyeing the pixel points to be dyed black, selecting the pixel points to be dyed white according to the dyeing matrix, the white dyeing probability matrix and the second filter matrix which are updated once, dyeing the pixel points to be dyed white, and repeating the dyeing process until all the pixel points are dyed. Compared with the prior art, the invention adopts a double-filter mechanism, divides the threshold matrix into a front section and a rear section, and respectively adopts different filters, so that the amplitude modulation characteristics of the frequency modulation dots of the highlight part and the dark tone part are different, and the requirements of different output devices can be met.
Example two
As shown in fig. 2, the fm-am network control method includes:
201. generating two filter matrices FblackAnd FwhiteWhere both filter matrices are WXH, the first filter matrix FblackTo generate a filter matrix of elements according to equation (1):
second filter matrix FwhiteTo generate a filter matrix of elements according to equation (2):
wherein W is the width of the threshold matrix, H is the height of the threshold matrix, x belongs to [1, W ], y belongs to [1, H ];
in this embodiment, the threshold matrix width W is 9, the threshold matrix height H is 9, and the filter function f is1As shown in equation (3), the filter function f2As shown in formula (4):
<math><mrow><msub><mi>f</mi><mn>1</mn></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mn>0.1</mn><mo>,</mo><mi>t</mi><mo>≤</mo><mn>1.2</mn></mtd></mtr><mtr><mtd><mn>0.2,1.2</mn><mo><</mo><mi>t</mi><mo>≤</mo><mn>1.5</mn></mtd></mtr><mtr><mtd><mfrac><mn>1</mn><msup><mi>t</mi><mn>2</mn></msup></mfrac><mo>,</mo><mi>t</mi><mo>></mo><mn>1.5</mn></mtd></mtr></mtable></mfenced><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>3</mn><mo>)</mo></mrow></mrow></math>
<math><mrow><msub><mi>f</mi><mn>2</mn></msub><mrow><mo>(</mo><mi>t</mi><mo>)</mo></mrow><mo>=</mo><mfenced open='{' close=''><mtable><mtr><mtd><mo>-</mo><mn>0.01</mn><mo>,</mo><mi>t</mi><mo>≤</mo><mn>1.5</mn></mtd></mtr><mtr><mtd><mfrac><mn>1</mn><msup><mi>t</mi><mn>2</mn></msup></mfrac><mo>,</mo><mi>t</mi><mo>></mo><mn>1.5</mn></mtd></mtr></mtable></mfenced><mo>-</mo><mo>-</mo><mo>-</mo><mrow><mo>(</mo><mn>4</mn><mo>)</mo></mrow></mrow></math>
thus, the first filter matrix F is generatedblackAs shown in fig. 3a, a second filter matrix F is generatedwhiteAs shown in fig. 3 b.
202. Initializing a dyeing matrix B, specifically: b [ x, y ] ═ 0, all pixels were set to the undyed state; wherein B [ x, y ] ═ 0 represents that pixel [ x, y ] is not dyed, B [ x, y ] ═ -1 represents that pixel [ x, y ] is dyed black, B [ x, y ] ═ 1 represents that pixel [ x, y ] is dyed white;
initializing a threshold matrix T, specifically: t [ x, y ] ═ 0, all elements in the threshold matrix are set to 0;
wherein x belongs to [1, W ], y belongs to [1, H ], and all are integers;
initializing a Threshold, specifically: threshold ═ 1;
thus, the initialized staining matrix B is shown in fig. 4, and the initialized threshold matrix T is shown in fig. 5.
203. Initializing black-colored probability matrix MblackThe method specifically comprises the following steps: mblack[x,y]0.0; wherein M isblack[x,y]Is a pixel [ x, y]Probability of being stained with black, Mblack[x,y]0.0 represents that the probability of all pixels being colored black is the same;
initializing a whitening probability matrix MwhiteThe method specifically comprises the following steps: mwhite[x,y]0.0; wherein M iswhite[x,y]Is a pixel [ x, y]Probability of being stained with white, Mwhite[x,y]0.0 represents that the probability of all pixels being stained white is the same;
wherein x belongs to [1, W ], y belongs to [1, H ], and all are integers;
thus, the initialized black-colored probability matrix MblackAs shown in FIG. 6a, the initialized white-colored probability matrix MwhiteAs shown in fig. 6 b.
204. Probability matrix M of black dyeingblackFind the minimum value and its corresponding pixel coordinate [ M _ black, n _ black [ ]]The treatment method comprises the following steps:
find pixel coordinates m _ black, n _ black]So that B [ m _ black, n _ black]0, and Mblack[m_black,n_black]=min{MblackIs then [ m _ black, n _ black ]]The next pixel point to be dyed black;
due to initialized Mblack[x,y]0.0, that is, the probability that all pixels are colored black is the same, and therefore, the pixel coordinates m _ black, n _ black are randomly selected at the first cycle]=[5,4]Then pixel point [5, 4]]The next spot to be dyed black.
205. The pixel point with the pixel coordinate [ m _ black, n _ black ] ═ 5, 4] is dyed with black, and the specific implementation method is as follows: let B [ m _ black, n _ black ] be-1, and since [ m _ black, n _ black ] be [5, 4], B [5, 4] be-1, the updated staining matrix B is shown in fig. 7 a;
assigning a threshold matrix T, specifically: t [ m _ black, n _ black ] ═ Threshold, that is, the element of the Threshold matrix T whose coordinates are [ m _ black, n _ black ] is assigned to Threshold, since [ m _ black, n _ black ] ═ 5, 4] and Threshold is 1, T [5, 4] ═ Threshold is 1, and thus, the updated Threshold matrix T is as shown in fig. 7 b;
pair black probability matrix MblackAnd assigning, specifically: mblack[m_black,n_black]Infinity to make pixel point [ m _ black, n _ black]Will not be selected in later cycles, since m _ black, n _ black]=[5,4]Thus, Mblack[5,4]=∞。
206. As shown in fig. 9, M is superimposed
blackAnd F
blackAnd translate F
blackSo that M
blackThe middle coordinate is [ m _ black, n _ black ]]Of (a) and F
blackThe center coordinate is
Corresponds to the updated M
blackBy way of example, the elements in the matrix [ x ', y']The following corresponding relations are provided:
<math><mrow><msup><mi>x</mi><mo>′</mo></msup><mo>=</mo><mrow><mo>(</mo><mi>m</mi><mo>_</mo><mi>black</mi><mo>+</mo><mi>x</mi><mo>-</mo><mfrac><mi>W</mi><mn>2</mn></mfrac><mo>)</mo></mrow><mi>mod</mi><mi>W</mi><mo>,</mo></mrow></math> <math><mrow><msup><mi>y</mi><mo>′</mo></msup><mo>=</mo><mrow><mo>(</mo><mi>n</mi><mo>_</mo><mi>black</mi><mo>+</mo><mi>y</mi><mo>-</mo><mfrac><mi>H</mi><mn>2</mn></mfrac><mo>)</mo></mrow><mi>mod</mi><mi>H</mi><mo>;</mo></mrow></math>
after rewinding according to the method shown in FIG. 8, MblackAnd FblackAdding corresponding matrix elements, wherein the specific method comprises the following steps: mblack[x′,y′]=Mblack[x′,y′]+Fblack[x,y]Thus, in the first cycle, when a pixel [5, 4]]After being dyed with black, an updated black dyeing probability matrix M is obtainedblackAs shown in fig. 7 c.
207. White-in-color probability matrix MwhiteFind the minimum value and its corresponding pixel coordinate [ m _ white, n _ white [ ]]The treatment method comprises the following steps:
find pixel coordinate [ m _ white, n _ white [ ]]So that B [ m _ white, n _ white]0, and Mwhite[m_white,n_white]=min{MwhiteIs then [ m _ white, n _ white ]]The next pixel point to be dyed with white;
due to initialized Mwhite[x,y]0.0, i.e. the probability that all pixels are stained white, is the same, so the pixel coordinates m _ white, n _ white are randomly chosen at the first iteration]=[4,6]Then pixel point [4, 6]]The next spot to be dyed white.
208. The method for realizing the white-point pixel comprises the following steps of dyeing white points of pixels with pixel coordinates of [ m _ white, n _ white ] ([ 4, 6 ]), and specifically comprises the following steps: let B [ m _ white, n _ white ] be 1, and [ m _ white, n _ white ] be [4, 6], so that B [4, 6] is 1, and the updated staining matrix B is shown in fig. 8 a;
assigning a threshold matrix T, specifically: t [ m _ white, n _ white ] ═ W — H-Threshold +1, that is, the elements in the Threshold matrix T whose coordinates are [ m _ white, n _ white ] are assigned W × H-Threshold +1, and since [ m _ white, n _ white ] ═ 4, 6], W ═ 9, H ═ 9, and Threshold ═ 1, T [4, 6] ═ W — H — Threshold +1 ═ 81, the Threshold matrix T after updating again is shown in fig. 8 b;
pair-dyeing white probability matrix MwhiteAnd assigning, specifically: mwhite[m_white,n_white]Infinity to make pixel point [ m _ white, n _ white]Will not be selected in later cycles because of m _ white, n _ white]=[4,6]Thus, Mwhite[4,6]=∞。
209. As shown in fig. 9, M is superimposed
whiteAnd F
whiteAnd translate F
whiteSo that M
whiteThe middle coordinate is [ m _ white, n _ white ]]Of (a) and F
whiteThe center coordinate is
Corresponds to the updated M
whiteBy way of example, the elements in the matrix [ x ', y']Has the following corresponding relation:
<math><mrow><msup><mi>x</mi><mo>′</mo></msup><mo>=</mo><mrow><mo>(</mo><mi>m</mi><mo>_</mo><mi>white</mi><mo>+</mo><mi>x</mi><mo>-</mo><mfrac><mi>W</mi><mn>2</mn></mfrac><mo>)</mo></mrow><mi>mod</mi><mi>W</mi><mo>,</mo></mrow></math> <math><mrow><msup><mi>y</mi><mo>′</mo></msup><mo>=</mo><mrow><mo>(</mo><mi>n</mi><mo>_</mo><mi>white</mi><mo>+</mo><mi>y</mi><mo>-</mo><mfrac><mi>H</mi><mn>2</mn></mfrac><mo>)</mo></mrow><mi>mod</mi><mi>H</mi><mo>;</mo></mrow></math>
after rewinding according to the method shown in FIG. 8, MwhiteAnd FwhiteAdding corresponding matrix elements, wherein the specific method comprises the following steps: mwhite[x′,y′]=Mwhite[x′,y′]+Fwhite[x,y]Thus, in the first cycle, when a pixel [4, 6]]After being dyed with white, the white dyeing probability matrix M after being updated again is obtainedwhiteAs shown in fig. 8 c.
210. The Threshold value Threshold is self-added by 1, and specifically comprises the following steps: threshold +1, so that, after the end of the first cycle, Threshold is 2.
211. Judging whether the element in the dyeing matrix B is 0, if so, indicating that the pixel point is not dyed; if no element in the dyeing matrix B is 0, all the pixel points are dyed;
when the element in the dyeing matrix B is 0, the step 204-210 is repeatedly executed until all the pixel points are dyed white or black, that is: for all x ∈ [1, W ], y ∈ [1, H ], when B [ x, y ] ═ 1 or B [ x, y ] ═ 1, the loop ends, resulting in the final threshold matrix T as shown in fig. 10.
The frequency modulation and amplitude modulation network control method comprises the steps of firstly generating a first filter matrix and a second filter matrix, initializing a dyeing matrix, a threshold, a black dyeing probability matrix and a white dyeing probability matrix, selecting pixel points to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, dyeing the pixel points to be dyed black, selecting the pixel points to be dyed white according to the dyeing matrix, the white dyeing probability matrix and the second filter matrix which are updated once, dyeing the pixel points to be dyed white, and repeating the dyeing process until all the pixel points are dyed. Compared with the prior art, the invention adopts a double-filter mechanism, divides the threshold matrix into a front section and a rear section, and respectively adopts different filters, so that the amplitude modulation characteristics of the frequency modulation dots of the highlight part and the dark tone part are different, and the requirements of different output devices can be met.
EXAMPLE III
The embodiment provides a frequency modulation and amplitude modulation network control method, and the implementation process of the frequency modulation and amplitude modulation network control method can specifically refer to the second embodiment; unlike the second embodiment, in the present embodiment, the threshold matrix width W is 64, and the threshold matrix height H is 64. The final threshold matrix is obtained by an imaging method, as shown in fig. 11a, in which the deeper the gradation, the smaller the element value, and the shallower the gradation, the larger the element value.
Accordingly, a binary matrix with a gray scale value of 20 is shown in fig. 11b, and a binary matrix with a gray scale value of 235 is shown in fig. 11 c;
the method for acquiring the binary matrix with the gray value of 20 comprises the following steps: for each element in the threshold matrix, if the element is greater than 20, output 255, otherwise output 0;
similarly, the method for acquiring the binary matrix with the gray value of 235 includes: for each element in the threshold matrix, 255 is output if the element is greater than 235, and 0 is output otherwise.
As can be seen from fig. 11a, 11b and 11c, the amplitude modulation dots of the highlight region and the dark tone region are obviously different in size, so as to meet the actual output requirement.
Example four
In this embodiment, as shown in fig. 12, an fm-am network control apparatus includes:
a generating module 121, configured to generate a first filter matrix and a second filter matrix;
an initialization module 122, configured to initialize the coloring matrix, the threshold matrix, the black coloring probability matrix, and the white coloring probability matrix;
the black dyeing module 123 is configured to select a pixel point to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, and dye the pixel point black;
the white dyeing module 124 is configured to select a pixel point to be white dyed according to the once updated dyeing matrix, the white dyeing probability matrix and the second filter matrix, and dye the pixel point white;
a judging module 125, configured to judge whether all the pixel points are dyed;
specifically, the determining module 125 determines whether there is an element in the staining matrix that is 0, and if there is an element in the staining matrix that is 0, it indicates that there is a pixel that is not stained; if no element in the dyeing matrix is 0, all the pixel points are dyed; when the number of the elements in the dyeing matrix B is 0, the black dyeing module 123 selects a pixel point to be dyed black, and dyes the pixel point black, and the white dyeing module 124 selects a pixel point to be dyed white, and dyes the pixel point white.
The FM-AM network control device provided by the embodiment of the invention comprises the steps of firstly generating a first filter matrix and a second filter matrix, initializing a dyeing matrix, a threshold, a black dyeing probability matrix and a white dyeing probability matrix, selecting pixel points to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, dyeing the pixel points to be dyed black, selecting the pixel points to be dyed white according to the once updated dyeing matrix, the white dyeing probability matrix and the second filter matrix, dyeing the pixel points to be dyed white, and repeating the dyeing process until all the pixel points are dyed. Compared with the prior art, the invention adopts a double-filter mechanism, divides the threshold matrix into a front section and a rear section, and respectively adopts different filters, so that the amplitude modulation characteristics of the frequency modulation dots of the highlight part and the dark tone part are different, and the requirements of different output devices can be met.
EXAMPLE five
As shown in fig. 13, the fm-am network control apparatus includes:
a generating module 131, configured to generate a first filter matrix and a second filter matrix;
an initialization module 132 configured to initialize the coloring matrix, the threshold matrix, the black coloring probability matrix, and the white coloring probability matrix;
the black dyeing module 133 is configured to select a pixel point to be black dyed according to the dyeing matrix, the black dyeing probability matrix, and the first filter matrix, and dye the pixel point black;
the white dyeing module 134 is configured to select a pixel point to be white dyed according to the once updated dyeing matrix, the white dyeing probability matrix and the second filter matrix, and dye the pixel point white;
a determining module 135, configured to determine whether all the pixel points are dyed;
specifically, the determining module 135 determines whether there is an element in the staining matrix that is 0, and if there is an element in the staining matrix that is 0, it indicates that there is a pixel that is not stained; if no element in the dyeing matrix is 0, all the pixel points are dyed; when the number of the elements in the dyeing matrix B is 0, the black dyeing module 133 selects a pixel point to be dyed black, and dyes the pixel point black, and the white dyeing module 134 selects a pixel point to be dyed white, and dyes the pixel point white.
Wherein the initialization module 132 comprises:
a first initialization unit 1321, configured to set all elements in the staining matrix B to 0, where an element in the staining matrix B being 0 indicates that the pixel is in an undyed state;
a second initialization unit 1322 to set all elements in the threshold matrix T to 0;
a third initialization unit 1323 configured to set a Threshold to 1;
a fourth initializing unit 1324 for applying the black colored probability matrix MblackAll elements in (1) are set to 0.0;
a fifth initializing unit 1325 for applying the whitening probability matrix MwhiteAll elements in (a) are set to 0.0.
Wherein the black dyeing module 133 includes:
a first selection unit 1331 for selecting a black matrix M according to the dyeing matrix BblackSelecting a pixel point which is not dyed and has the minimum black dyeing probability;
a black dyeing unit 1332, configured to dye the pixel point black, and obtain a dyeing matrix B and a threshold matrix T after the first updating;
a first obtaining unit 1333 for obtaining the black-colored probability matrix M according to the black-colored probability matrixblackAnd a first filter matrix FblackObtaining the black-dyeing probability matrix M after one-time updatingblack。
Wherein the whitening module 134 comprises:
a second selecting unit 1341, configured to select a white color probability matrix M according to the color matrix B after one time updatewhiteSelecting a pixel point which is not dyed and has the minimum probability of being dyed white;
a white dyeing unit 1342, configured to dye the pixels to be white, and obtain a dyeing matrix B and a threshold matrix T after being updated again;
a second obtaining unit 1343 for obtaining the white-staining probability matrix MwhiteAnd a second filter matrix FwhiteObtaining the updated white-staining probability matrix Mwhite;
A Threshold self-adding unit 1344 for self-adding 1 to the Threshold.
The FM-AM network control device provided by the embodiment of the invention comprises the steps of firstly generating a first filter matrix and a second filter matrix, initializing a dyeing matrix, a threshold, a black dyeing probability matrix and a white dyeing probability matrix, selecting pixel points to be dyed black according to the dyeing matrix, the black dyeing probability matrix and the first filter matrix, dyeing the pixel points to be dyed black, selecting the pixel points to be dyed white according to the once updated dyeing matrix, the white dyeing probability matrix and the second filter matrix, dyeing the pixel points to be dyed white, and repeating the dyeing process until all the pixel points are dyed. Compared with the prior art, the invention adopts a double-filter mechanism, divides the threshold matrix into a front section and a rear section, and respectively adopts different filters, so that the amplitude modulation characteristics of the frequency modulation dots of the highlight part and the dark tone part are different, and the requirements of different output devices can be met.
The fm-am network control apparatus provided in the embodiment of the present invention may implement the method embodiment provided above. The method and the device for controlling the frequency modulation and amplitude modulation network provided by the embodiment of the invention can be suitable for printers and high-grade printing plate-making equipment, but are not limited to the method and the device.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above description is only for the specific embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.