Method, device and equipment for generating halftone image

The halftone image is generated by point-by-point scanning and dot table matrix retrieval processing, and the problems of low efficiency and low accuracy of halftone image generation in the prior art are solved, and fast, efficient and accurate halftone image generation is achieved.

CN119444883AActive Publication Date: 2025-02-14PEKING UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411346286.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2025-02-14
Estimated Expiration
2044-09-26

AI Technical Summary

Technical Problem

The prior art has low efficiency and low accuracy in halftone image generation in image hard copy replication, especially in large-scale traditional printing or digital printing, resulting in reduced production cycles and production efficiency.

Method used

By acquiring the original image data, the initial grayscale hierarchy value is determined by point-by-point scanning process, the dot table matrix is ​​determined based on the preset dot matrix, and the data blocks of each initial grayscale hierarchy value in the dot table matrix are determined through the search process, and finally generated Halftone image.

Benefits of technology

It realizes rapid generation of halftone images, improves generation efficiency, and ensures generation accuracy, and accurately realizes digital halftone electronic hanging network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444883A_ABST
    Figure CN119444883A_ABST
Patent Text Reader

Abstract

The invention provides a halftone image generation method, device and equipment, and relates to the field of image hard copy copying. The problems of low generation efficiency and low precision of the halftone image in the existing halftone image processing process are solved. The halftone image generation method comprises the following steps: acquiring original image data; performing point-by-point scanning processing on the original image data, and determining an initial gray level value of each image point in the original image data; determining a dot table matrix according to a preset dot matrix; performing retrieval processing on a dot table matrix according to the initial gray level values, and determining a data block corresponding to each initial gray level value in the dot table matrix; and generating a halftone image according to the data block. According to the scheme of the invention, the method achieves the quick generation of the halftone image, improves the generation efficiency of the halftone image, and guarantees the generation precision of the halftone image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of image hard copy reproduction, and in particular to a method, device and equipment for generating a halftone image. Background Art

[0002] The hard copy reproduction of images mainly involves the screen plate-making technology of printers and high-end printing plate-making equipment. The screen technology used for hard copy reproduction of images is also called digital image halftone technology. Among the existing image hard copy reproduction technologies, the most widely used and widely used is the amplitude modulation halftone digital screen technology. Usually, the initial amplitude modulation halftone screen uses a single-cell screening algorithm. This algorithm has a large deviation in the control accuracy of the dot angle and the number of dot lines, and there is uncontrollability for the halftone screen level, so it is impossible to accurately realize the digital halftone electronic screen. If the full image is scanned and calculated multiple times when the image is halftoned, although the deviation can be reduced to a certain extent, it will seriously affect the speed of generating the halftone image; for example, in large-scale traditional printing or digital printing, this efficiency greatly lags and reduces the production cycle and production efficiency. Summary of the invention

[0003] The present invention provides a method, device and equipment for generating a halftone image, which solves the problems of low generation efficiency and low precision of the halftone image in the existing halftone image processing process.

[0004] In order to solve the above technical problems, the technical solution of the present invention is as follows:

[0005] An embodiment of the present invention provides a method for generating a halftone image, comprising:

[0006] Get the original image data;

[0007] Scan the original image data point by point to determine the initial grayscale value of each image point in the original image data;

[0008] Determine the dot table matrix according to the preset dot matrix;

[0009] According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the data block corresponding to each initial grayscale level value in the dot table matrix;

[0010] A halftone image is generated according to the data block.

[0011] Optionally, determining a dot table matrix according to a preset dot matrix includes:

[0012] Determine the width of the dot matrix according to the preset width of the dot matrix;

[0013] Determine the height of the dot table matrix according to the preset number of gray levels of the dot table matrix and the preset height of the dot matrix;

[0014] Determine the data format of the dot table matrix according to the heights of the preset dot matrix and the dot table matrix;

[0015] Determine a dot table entry matrix in a dot table matrix according to a preset dot matrix height and width;

[0016] The dot table matrix is ​​determined according to the preset grayscale level number, width, height, data format and the dot table item matrix in the dot table matrix.

[0017] Optionally, according to the heights of the preset dot matrix and the dot table matrix, determining the data format of the dot table matrix includes:

[0018] Determine the dot level of the dot table matrix according to the height of the dot table matrix;

[0019] Determine the dot level corresponding to each dot table entry matrix in the dot table matrix.

[0020] Optionally, determining the dot table entry matrix in the dot table matrix according to the preset height and width of the dot matrix includes:

[0021] Determine basic parameters of the dot table entry matrix in the dot table matrix according to the height and width of the preset dot matrix;

[0022] According to the preset dot matrix and preset rules, through the formula Determine each grid point data in each grid point table matrix Among them, i represents the corresponding dot level of the current dot table entry matrix in the dot table matrix; i∈[0,N-1], N is the preset grayscale level number; M represents the preset dot matrix, j is the index value in the preset dot matrix, j∈[0,W*H-1], W represents the width of the preset dot matrix, and H represents the height of the preset dot matrix.

[0023] Optionally, the preset rule is: the current dot table entry matrix is ​​constructed by using a preset dot matrix based on the grid point data of the previous dot table entry matrix.

[0024] Optionally, according to the initial grayscale level value, searching the dot table matrix to determine the data block corresponding to each initial grayscale level value in the dot table matrix includes:

[0025] According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the dot table entry matrix corresponding to each initial grayscale level value in the dot table matrix;

[0026] According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by a preset proportional coefficient.

[0027] Optionally, according to the dot table entry matrix, by preset proportional coefficients, determining the data block of each initial gray level value in the dot table matrix includes:

[0028] According to the height of the original image and the height of the halftone image to be generated, or according to the width of the original image and the width of the halftone image to be generated, the formula Determine the scale factor k; wherein d is the height or width of the halftone image dots to be generated, and s is the height or width of the original image dots;

[0029] According to the proportionality coefficient, determining a block matrix;

[0030] According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by taking the block matrix.

[0031] An embodiment of the present invention further provides a device for generating a halftone image, comprising:

[0032] An acquisition module, used for acquiring original image data;

[0033] The processing module is used to scan the original image data point by point to determine the initial grayscale value of each image point in the original image data; determine the dot table matrix according to the preset dot matrix; search the dot table matrix according to the initial grayscale value to determine the data block corresponding to each initial grayscale value in the dot table matrix; generate a halftone image according to the data block.

[0034] An embodiment of the present invention further provides a computing device, comprising: a processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the above method is executed.

[0035] An embodiment of the present invention further provides a computer-readable storage medium, comprising: storing instructions, and when the instructions are executed on a computer, the computer executes the above method.

[0036] The above solution of the present invention includes at least the following beneficial effects:

[0037] The halftone image generation method of the present invention obtains original image data; performs point-by-point scanning processing on the original image data to determine the initial grayscale value of each image point in the original image data; determines the dot table matrix according to the preset dot matrix; performs search processing on the dot table matrix according to the initial grayscale value to determine the data block corresponding to each initial grayscale value in the dot table matrix; generates a halftone image according to the data block. The method realizes the rapid generation of the halftone image, improves the generation efficiency of the halftone image, and ensures the generation accuracy of the halftone image. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 It is a schematic flow chart of a method for generating a halftone image of the present invention;

[0039] Figure 2 It is a structural schematic diagram of a preset dot matrix of a method for generating a halftone image of the present invention;

[0040] Figure 3 It is a structural schematic diagram of a dot table matrix of a method for generating a halftone image of the present invention;

[0041] Figure 4 It is a schematic diagram of generating a first data block according to an index in a method for generating a halftone image of the present invention;

[0042] Figure 5 It is a schematic diagram of generating a second data block according to an index in the method for generating a halftone image of the present invention;

[0043] Figure 6 is a schematic diagram of generating a third data block according to an index in the method for generating a halftone image of the present invention;

[0044] Figure 7 It is a schematic diagram of a process of quickly looking up a table to generate a halftone image in the method for generating a halftone image of the present invention;

[0045] Figure 8 It is a schematic diagram of generating a halftone image from an original image in the method for generating a halftone image of the present invention;

[0046] Fig. 9 It is a module block diagram of the device for generating a halftone image of the present invention. DETAILED DESCRIPTION

[0047] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0048] like Figures 1 to 8 As shown, an embodiment of the present invention provides a method for generating a halftone image, comprising:

[0049] Step 11, obtaining original image data;

[0050] Step 12, scanning the original image data point by point to determine the initial grayscale value of each image point in the original image data;

[0051] Step 13, determining a dot table matrix according to a preset dot matrix;

[0052] Step 14, searching the dot table matrix according to the initial gray level value, and determining the data block corresponding to each initial gray level value in the dot table matrix;

[0053] Step 15: Generate a halftone image according to the data block.

[0054] In this embodiment, the original image data includes data such as the height, width and initial grayscale value of the original image; the original image data is a two-dimensional array, in which each element represents the grayscale value of a pixel, and the grayscale value is usually between 0 and 255, 0 represents black, 255 represents white, and other values ​​represent different degrees of gray; use an image processing library (such as Python's OpenCV or PIL) to read the image data; obtain the width and height of the image for point-by-point scanning; use a double loop to traverse each pixel and extract its grayscale value; step 15 can specifically be to map each data block back to the corresponding position of the image to generate a halftone image; during the halftone processing, the halftone image generation method searches the dot table matrix through the dot table matrix and according to the initial grayscale value to determine the data block corresponding to each initial grayscale value in the dot table matrix. The design can convert the original complex point-by-point calculation and comparison operation into fast and simple data block operations such as retrieval, table lookup, and value acquisition, realize the image binary conversion and efficiently integrate the variable magnification processing calculation of the number of image pixels before and after the conversion, thereby greatly improving the efficiency of image processing. The method described in the present invention can efficiently and perfectly complete the halftone binary data conversion output of the image when outputting high-resolution and large image data volumes, thereby quickly generating a halftone image, which solves the existing problem that multiple scans are required in the halftone image processing process, and when faced with a large image data volume, the halftone image cannot be quickly generated. In the process of large-scale traditional printing or digital printing, the efficiency is greatly delayed and the production cycle and production efficiency are reduced. The method realizes the rapid generation of halftone images, improves the generation efficiency of halftone images, and at the same time ensures the generation accuracy of halftone images, and can accurately realize digital halftone electronic screening.

[0055] In an optional embodiment of the present invention, step 13 may include:

[0056] Step 131, determining the width of the dot matrix according to the preset width of the dot matrix;

[0057] Step 132, determining the height of the dot table matrix according to the preset number of gray levels of the dot table matrix and the preset height of the dot matrix;

[0058] Step 133, determining the data format of the dot table matrix according to the heights of the preset dot matrix and the dot table matrix;

[0059] Step 134, determining a dot table entry matrix in the dot table matrix according to a preset height and width of the dot matrix;

[0060] Step 135, determining the dot table matrix according to the preset grayscale level number, width, height, data format and the dot table item matrix in the dot table matrix.

[0061] like Figure 2 As shown, in this embodiment, the preset dot matrix M includes: a series of matrix data such as halftone dot type, screen angle, dot size, etc.; the width of the preset dot matrix M is W, and the height is H; the optional width and height of the preset dot matrix M are W=H=9, and the preset dot matrix M is as follows Figure 2 As shown; Step 131 is specifically that the width of the dot table matrix T is equal to the width W of the preset dot matrix M; Step 132 is specifically that the height of the dot table matrix T is N*H, wherein N is the preset number of gray levels of the dot table matrix; H is the height of the preset dot matrix M; Step 135 is specifically that according to the preset number of gray levels, width, height, data format of the dot table matrix and the dot table item matrix in the dot table matrix, the dot table item matrices are superimposed in sequence to obtain the dot table matrix.

[0062] In an optional embodiment of the present invention, step 133 may include:

[0063] Step 1331, determining the dot level of the dot table matrix according to the height of the dot table matrix;

[0064] Step 1332, determining the dot level corresponding to each dot table entry matrix in the dot table matrix.

[0065] In this embodiment, step 1331 is specifically to calculate the dot level N of the dot table matrix. i N i ∈[0,N-1], step 1332 specifically for each network point table matrix T i Each corresponds to a gray level N i, where i represents the index of the grid matrix T, and its value is i∈[0,N-1]; when N=81, Figure 3 As shown, Figure 3 The value in represents the dot level N in the dot table matrix i There are 80 floors in total; Figure 3 The dot entry matrix T corresponds to the dot level. i .

[0066] In an optional embodiment of the present invention, step 134 may include:

[0067] Step 1341, determining basic parameters of the dot table entry matrix in the dot table matrix according to the preset height and width of the dot matrix;

[0068] Step 1342, according to the preset dot matrix and preset rules, by formula Determine each grid point data in each grid point table matrix Wherein, i represents the dot level corresponding to the current dot table entry matrix in the dot table matrix; i∈[0,N-1], N is the preset grayscale level number; M represents the preset dot matrix, j is the index value in the preset dot matrix, j∈[0,W*H-1], W represents the width of the preset dot matrix, and H represents the height of the preset dot matrix;

[0069] The preset rule is that the current dot table entry matrix is ​​constructed by using a preset dot matrix based on the grid point data of the previous dot table entry matrix.

[0070] In this embodiment, the grid point entry matrix T i The basic parameters include the grid entry matrix T i The height and width of the dot table matrix T i and is a matrix with the same size as the preset dot matrix M; the dot table matrix T i Each grid point data in All are 0 or 1, each grid point data Specifically, for each dot level i (from 0 to N-1), each element M of the preset dot matrix M is traversed. j (from 0 to W×H-1): If the current dot level i is less than the corresponding preset dot matrix element M j ,but If the current dot level i is greater than the corresponding preset dot matrix M j ,but Thus, the network point entry matrix is ​​determined; when multiple network point entry matrices are determined, each adjacent network point entry matrix needs to be constructed in combination with a preset rule, specifically, each adjacent entry T i+1It is in the previous table entry T i Based on the construction of the specific T i+1 Will be in T i The number of data 1s added is determined by the data in the preset dot matrix M. Specifically, the value of each element in the preset dot matrix M determines how many data 1s need to be added when generating the next dot table matrix. The specific number of data 1s added can be determined by the formula For example, assuming that the value of a certain position in the preset dot matrix M is 2, it means that when the next dot table matrix is ​​generated, the dot table matrix of the current level will have two additional data 1 added to the dot table matrix T i+1 In this embodiment, the increasing relationship between adjacent entries enables the preset dot matrix T to effectively represent the dot distribution of different gray levels and provide the necessary basic data for subsequent image processing or design.

[0071] In an optional embodiment of the present invention, step 14 may include:

[0072] Step 141, searching the dot table matrix according to the initial gray level value, and determining the dot table entry matrix corresponding to each initial gray level value in the dot table matrix;

[0073] Step 142, according to the dot table entry matrix, by using a preset proportionality coefficient, determine the data block of each initial gray level value in the dot table matrix.

[0074] In an optional embodiment of the present invention, step 142 may include:

[0075] Step 1421, according to the height of the original image and the height of the halftone image to be generated or according to the width of the original image and the width of the halftone image to be generated, the formula Determine the scale factor k; wherein d is the height or width of the halftone image dots to be generated, and s is the height or width of the original image dots;

[0076] Step 1422, determining a block matrix according to the scale factor;

[0077] Step 1423, according to the dot table entry matrix, by taking the block matrix, determine the data block of each initial gray level value in the dot table matrix.

[0078] In this embodiment, step 141 specifically performs a hierarchical table lookup index calculation for the dot table matrix T; obtains an initial grayscale level value g corresponding to an original image data point, and retrieves the corresponding dot level N in the dot table matrix T. g , according to the network point table matrix and network point level N gThe one-to-one correspondence between the two can directly determine the corresponding network point table matrix T g , and then calculate the dot table entry matrix corresponding to each initial gray level value by one table lookup calculation according to the preset level table lookup rule; wherein the preset level table lookup rule can be to scan from left to right in rows and perform index calculation; step 1421 is specifically determined according to the number of dots of the original image and the number of dots of the target image, one pixel corresponds to one dot, for example, the ratio of the number of dots of the original image and the target image is 4, then k is 4; in this embodiment, step 1422 is specifically to set the width and height size of the block matrix Q to k*k;

[0079] like Figures 4 to 6 As shown, the specific implementation process of step 142 will be illustrated below with a specific embodiment:

[0080] Assume that the initial grayscale value corresponding to the first original point (x-1, y) of the original image data is 20, the second original point (x, y) is the point corresponding to the point after being translated one unit to the right, and the initial grayscale value corresponding to the second original point is 70, and the third original point (x, y+1) is the point corresponding to the point after being translated one unit downward, and the initial grayscale value corresponding to the third original point is 50; first, according to the initial grayscale value of 20 corresponding to the first original point, find the corresponding grayscale level N in the dot table matrix i That is N 20 , then according to N 20 Get the point table matrix T 20 ,like Figure 4 As shown, in the network point table matrix T 20 The first target point (u-1, v) corresponding to the first original point is found in the matrix Q. Based on the first target point (u-1, v), the size of the block matrix Q is taken as k*k (k=4) to obtain the first data block, and the first data block is output. Then, according to the initial gray level value of 70 corresponding to the second original point, the corresponding gray level N is found in the dot table matrix. i That is N 70 , and get the point table matrix T 70 ,like Figure 5 As shown, then based on the previous point (i.e., the first target point (u-1, v)), the second target point (u, v) is shifted to the right by one unit (the unit here is k*k), and the second target point (u, v) is taken as the basis, and the data block is taken according to the block matrix Q to obtain the second data block, and the second data block is output, and then the corresponding gray level N is found in the dot table matrix according to the initial gray level value corresponding to the third original point of 50 i That is N 50 , and get the point table matrix T 50,like Figure 6 As shown, then based on the previous point (i.e., the second target point (u, v)), the third target point (u+1, v) is determined by shifting downward by one unit (the unit here is 4*4), and based on the third target point (u+1, v), the data block is taken according to the block matrix Q to obtain the third data block, and the third data block is output; and so on, according to the initial grayscale value of the original image data, the data block of each initial grayscale value in the dot table matrix is ​​determined, and the order of the data blocks is mapped back to the corresponding position of the image to generate a halftone image.

[0081] The specific process of the method for generating a halftone image according to the present invention is described below by taking a specific embodiment as an example:

[0082] Assume that the width and height of the preset dot matrix M are W=H=9. Figure 2 As shown; the preset gray level number of the dot table matrix T is N = 81, such as Figure 3 As shown, the size of the dot table matrix T is 9 in width and 9x81 in height; the data format of the dot table matrix T can be described as follows: Each dot table entry matrix T i Corresponding to a network level N i , where N i ∈[0,81-1], each node table matrix T i The width and height size is 9x9, where i represents the index of the grid table matrix T, and its value is i∈[0,81-1]; the grid table matrix T i Each data in is 0 or 1, which is calculated from the data in the preset grid matrix M by the following method: Wherein j represents the index value in the preset dot matrix M, j∈[0,9x9-1]; assuming that the ratio of the height of the original image and the halftone image to be generated is 4, then k=4, and the size of the block matrix Q is 4x4; after determining the dot table matrix and the block matrix Q, the original image data is scanned point by point, and the gray level value of each point is obtained. In order to quickly realize the halftone processing of the image, the embodiment adopts a line-by-line fast image scanning method, that is, the scanning order of the original image coordinate value [x, y] is as follows:

[0083] [0, 0], [0, 1], …, [0, 8]

[0084] [1, 0], [1, 1], …, [1, 8]

[0085] ……,……,……,……

[0086] [8, 0], [8, 1], …, [8, 8]

[0087] After scanning to the initial gray level value g at the current coordinate (x, y), Figure 7 As shown, firstly, the dot level corresponding to the initial gray level value g is determined in the dot table matrix according to the initial gray level value g, and then the corresponding dot table entry matrix T is taken out according to the dot level. i , and then take the block according to the target point (u, v) corresponding to the current coordinate (x, y) and the block matrix Q, so as to obtain the corresponding data block. The coordinates corresponding to each grid of the data block taken out at this time are (in units of rows from left to right):

[0088] (4x, 4y), (4x+1, 4y), (4x+2, 4y), (4x+3, 4y);

[0089] (4x, 4y+1), (4x+1, 4y+1), (4x+2, 4y+1), (4x+3, 4y+1);

[0090] (4x, 4y+2), (4x+1, 4y+2), (4x+2, 4y+2), (4x+3, 4y+2);

[0091] (4x, 4y+3), (4x+1, 4y+3), (4x+2, 4y+3), (4x+3, 4y+3);

[0092] like Figure 8 As shown, the blocks are then scanned in sequence to obtain data blocks corresponding to all initial grayscale values ​​in the dot table matrix, and a halftone image is generated based on the data blocks.

[0093] The halftone image generation method of the present invention can convert the preset matrix into a multi-level binary dot table mode by dynamic calculation based on the preset dot matrix, and at the same time calculate and retain the multi-level grayscale and various inherent characteristics of the original dots in the preset matrix; when halftone processing, the original complex point-by-point calculation and comparison operation is converted into simple data operations such as retrieval, table lookup, and value acquisition, that is, the image binary conversion is realized and the variable magnification processing calculation of the image pixel number before and after the conversion is efficiently integrated, thereby greatly improving the efficiency of image processing. The method of the present invention can efficiently and perfectly complete the halftone binary data conversion output of the image when outputting high-resolution and large image data volume.

[0094] like Fig. 9 As shown, an embodiment of the present invention further provides a halftone image generating device 90, comprising:

[0095] An acquisition module 91, used for acquiring original image data;

[0096] The processing module 92 is used to perform point-by-point scanning processing on the original image data to determine the initial grayscale value of each image point in the original image data; determine the dot table matrix based on the preset dot matrix; search the dot table matrix based on the initial grayscale value to determine the data block corresponding to each initial grayscale value in the dot table matrix; and generate a halftone image based on the data block.

[0097] Get the original image data;

[0098] Scan the original image data point by point to determine the initial grayscale value of each image point in the original image data;

[0099] Determine the dot table matrix according to the preset dot matrix;

[0100] According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the data block corresponding to each initial grayscale level value in the dot table matrix;

[0101] A halftone image is generated according to the data block.

[0102] Optionally, determining a dot table matrix according to a preset dot matrix includes:

[0103] Determine the width of the dot matrix according to the preset width of the dot matrix;

[0104] Determine the height of the dot table matrix according to the preset number of gray levels of the dot table matrix and the preset height of the dot matrix;

[0105] Determine the data format of the dot table matrix according to the heights of the preset dot matrix and the dot table matrix;

[0106] Determine a dot table entry matrix in a dot table matrix according to a preset dot matrix height and width;

[0107] The dot table matrix is ​​determined according to the preset grayscale level number, width, height, data format and the dot table item matrix in the dot table matrix.

[0108] Optionally, according to the heights of the preset dot matrix and the dot table matrix, determining the data format of the dot table matrix includes:

[0109] Determine the dot level of the dot table matrix according to the height of the dot table matrix;

[0110] Determine the dot level corresponding to each dot table entry matrix in the dot table matrix.

[0111] Optionally, determining the dot table entry matrix in the dot table matrix according to the preset height and width of the dot matrix includes:

[0112] Determine basic parameters of the dot table entry matrix in the dot table matrix according to the height and width of the preset dot matrix;

[0113] According to the preset dot matrix and preset rules, through the formula Determine each grid point data in each grid point table matrix Among them, i represents the corresponding dot level of the current dot table entry matrix in the dot table matrix; i∈[0,N-1], N is the preset grayscale level number; M represents the preset dot matrix, j is the index value in the preset dot matrix, j∈[0,W*H-1], W represents the width of the preset dot matrix, and H represents the height of the preset dot matrix.

[0114] Optionally, the preset rule is: the current dot table entry matrix is ​​constructed by using a preset dot matrix based on the grid point data of the previous dot table entry matrix.

[0115] Optionally, according to the initial grayscale level value, searching the dot table matrix to determine the data block corresponding to each initial grayscale level value in the dot table matrix includes:

[0116] According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the dot table entry matrix corresponding to each initial grayscale level value in the dot table matrix;

[0117] According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by a preset proportional coefficient.

[0118] Optionally, according to the dot table entry matrix, by preset proportional coefficients, determining the data block of each initial gray level value in the dot table matrix includes:

[0119] According to the height of the original image and the height of the halftone image to be generated, or according to the width of the original image and the width of the halftone image to be generated, the formula Determine the scale factor k; wherein d is the height or width of the halftone image dots to be generated, and s is the height or width of the original image dots;

[0120] According to the proportionality coefficient, determining a block matrix;

[0121] According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by taking the block matrix.

[0122] It should be noted that the device is a device corresponding to the above method, and all implementation methods in the above method are applicable to the embodiments of the device and can achieve the same technical effects.

[0123] The embodiment of the present invention further provides a computing device, including: a processor, a memory storing a computer program, and when the computer program is executed by the processor, the above method is executed. All implementations in the above method embodiment are applicable to this embodiment and can achieve the same technical effect.

[0124] The embodiment of the present invention further provides a computer-readable storage medium, including: storing instructions, when the instructions are executed on a computer, the computer executes the above method. All implementations in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0125] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0126] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0127] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0128] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0129] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0130] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, ROM, RAM, disk or optical disk, etc., which can store program codes.

[0131] In addition, it should be noted that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it is understood that all or any steps or components of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or a network of computing devices in hardware, firmware, software or a combination thereof, which can be achieved by those of ordinary skill in the art using their basic programming skills after reading the description of the present invention.

[0132] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general-purpose device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code for implementing a method or device. That is to say, such a program product also constitutes the present invention, and a storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0133] The above are preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.

Claims

1. A method for generating a halftone image, characterized in that: include: Get the original image data; Scan the original image data point by point to determine the initial grayscale value of each image point in the original image data; Determine the dot table matrix according to the preset dot matrix; According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the data block corresponding to each initial grayscale level value in the dot table matrix; A halftone image is generated according to the data block.

2. The method for generating a halftone image according to claim 1, characterized in that: According to the preset dot matrix, determine the dot table matrix, including: Determine the width of the dot matrix according to the preset width of the dot matrix; Determine the height of the dot table matrix according to the preset number of gray levels of the dot table matrix and the preset height of the dot matrix; Determine the data format of the dot table matrix according to the heights of the preset dot matrix and the dot table matrix; Determine a dot table entry matrix in a dot table matrix according to a preset dot matrix height and width; The dot table matrix is ​​determined according to the preset grayscale level number, width, height, data format and the dot table item matrix in the dot table matrix.

3. The method for generating a halftone image according to claim 2, characterized in that: According to the height of the preset dot matrix and the dot table matrix, the data format of the dot table matrix is ​​determined, including: Determine the dot level of the dot table matrix according to the height of the dot table matrix; Determine the dot level corresponding to each dot table entry matrix in the dot table matrix.

4. The method for generating a halftone image according to claim 2, wherein: According to the height and width of the preset dot matrix, a dot table entry matrix in the dot table matrix is ​​determined, including: Determine basic parameters of the dot table entry matrix in the dot table matrix according to the height and width of the preset dot matrix; According to the preset dot matrix and preset rules, through the formula Determine each grid point data in each grid point table matrix Among them, i represents the corresponding dot level of the current dot table entry matrix in the dot table matrix; i∈[0,N-1], N is the preset grayscale level number; M represents the preset dot matrix, j is the index value in the preset dot matrix, j∈[0,W*H-1], W represents the width of the preset dot matrix, and H represents the height of the preset dot matrix.

5. The method for generating a halftone image according to claim 4, characterized in that: The preset rule is: the current dot table entry matrix is ​​constructed by using the preset dot matrix based on the grid point data of the previous dot table entry matrix.

6. The method for generating a halftone image according to claim 1, characterized in that: According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the data block corresponding to each initial grayscale level value in the dot table matrix, including: According to the initial grayscale level value, the dot table matrix is ​​searched and processed to determine the dot table entry matrix corresponding to each initial grayscale level value in the dot table matrix; According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by a preset proportional coefficient.

7. The method for generating a halftone image according to claim 2, characterized in that: According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by a preset proportional coefficient, including: According to the height of the original image and the height of the halftone image to be generated, or according to the width of the original image and the width of the halftone image to be generated, the formula Determine the scale factor k; wherein d is the height or width of the halftone image dots to be generated, and s is the height or width of the original image dots; According to the proportionality coefficient, determining a block matrix; According to the dot table entry matrix, the data block of each initial gray level value in the dot table matrix is ​​determined by taking the block matrix.

8. A device for generating a halftone image, characterized in that: include: An acquisition module, used for acquiring original image data; The processing module is used to scan the original image data point by point to determine the initial grayscale value of each image point in the original image data; determine the dot table matrix according to the preset dot matrix; perform retrieval processing on the dot table matrix according to the initial grayscale value to determine the data block corresponding to each initial grayscale value in the dot table matrix; A halftone image is generated according to the data block.

9. A computing device, characterized in that include: A processor and a memory storing a computer program, wherein when the computer program is executed by the processor, the method according to any one of claims 1 to 7 is performed.

10. A computer-readable storage medium, characterized in that: Instructions are stored, and when the instructions are executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image processing method and device

    CN101404714A

  • Method and device for multi-bit-depth halftone amplitude modulation dot generating

    CN103139440A

  • Frequency modulation amplitude modulation mixed network continuous modulation control method

    CN1913574A

  • Foreground / background document processing with dataglyphs

    US6641053B1