Disclosure of Invention
The invention discloses a method, a device and equipment for strengthening the outline of a printed image and a readable storage medium, aiming at solving the problems of fuzzy overall and weak layering of the printed image;
a first embodiment of the present invention provides a contour enhancement method for a printed image, including:
acquiring printing data of a current line of a printing image;
acquiring at least two lines of printing data behind the current line of printing data; wherein, a preset delay time is arranged between two adjacent lines of printing data;
carrying out contour enhancement processing on the printing data of the current line according to the printing data of the current line and at least two lines of printing data behind the printing data of the current line to generate an enhancement signal of the current line; after the outline enhancement processing, for the edge signals with sudden change in the printing data of the current line, the low signals are lower, and the high signals are higher;
printing the current line of the printing image according to the strengthening signal.
Preferably, the performing contour enhancement processing on the current line printing data according to the current line printing data and at least two lines of printing data behind the current line printing data, and the generating of the enhancement signal of the current line specifically includes:
recording the current line printing data as A, and recording the next two lines of printing data of the current line printing data as D and B;
summing A and B to generate a first intermediate signal C;
subtracting one half of the first intermediate signal C from D to generate a second intermediate signal E;
scaling the second intermediate signal E according to a strengthening factor to generate a third intermediate signal G;
generating a fourth intermediate signal F according to D;
and summing the fourth intermediate signal F and the third intermediate signal G to generate a reinforced signal H corresponding to A.
Preferably, the printing the current line of the printed image according to the enhanced signal is specifically:
replacing the current line printing data A of the printing image with the strengthening signal H, and printing the current line data according to the strengthening signal H.
Preferably, the third intermediate signal G is obtained by dividing the second intermediate signal E by a boosting factor.
A second embodiment of the present invention provides an outline enhancing apparatus for a printed image, including:
a first print data acquisition unit configured to acquire print data of a current line of a print image;
the second printing data acquisition unit is used for acquiring at least two lines of printing data behind the current line of printing data; wherein, a preset delay time is arranged between two adjacent lines of printing data;
the strengthening signal generating unit is used for carrying out contour strengthening processing on the printing data of the current line according to the printing data of the current line and at least two lines of printing data behind the printing data of the current line so as to generate a strengthening signal of the current line; after the outline enhancement processing, for the edge signals with sudden change in the printing data of the current line, the low signals are lower, and the high signals are higher;
and the printing unit is used for printing the current line of the printing image according to the strengthening signal.
Preferably, the enhancement signal generation unit is specifically configured to:
recording the current line printing data as A, and recording the next two lines of printing data of the current line printing data as D and B;
summing A and B to generate a first intermediate signal C;
subtracting one half of the first intermediate signal C from D to generate a second intermediate signal E;
scaling the second intermediate signal E according to a strengthening factor to generate a third intermediate signal G;
equating D to a fourth intermediate signal F;
and summing the fourth intermediate signal F and the third intermediate signal G to generate a reinforced signal H corresponding to A.
Preferably, the printing unit is specifically configured to:
replacing the current line printing data A of the printing image with the strengthening signal H, and printing the current line according to the strengthening signal H.
Preferably, the third intermediate signal G is obtained by dividing the second intermediate signal E by a boosting factor.
A third embodiment of the present invention provides a contour enhancement apparatus for a print image, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor executing the computer program to implement a contour enhancement method for a print image as described in any one of the above.
A fourth embodiment of the present invention provides a readable storage medium storing a computer program executable by a processor of an apparatus on which the storage medium is located to implement a method of contour enhancement of a printed image as described in any one of the above.
Based on the method, the device and the equipment for strengthening the outline of the printed image and the readable storage medium provided by the invention, the data of the current line of the image to be printed and the two lines of printed data behind the printed data of the current line are obtained, the outline strengthening operation is carried out on the data to generate the strengthening signal of the current line of the image to be printed, the strengthening signal is used for replacing the data of the current line, and the strengthening signal of the whole image to be printed is sequentially obtained and replaced, so that the edge signal with sudden change in the printed data of the current line is lower in low signal and higher in high signal, and the problems that the whole printed image is fuzzy and not strong in layering sense are solved.
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.
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all 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.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
The word "if" as used herein may be interpreted as "at 8230; \8230;" or "when 8230; \8230;" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
In the embodiments, the references to "first \ second" are merely to distinguish similar objects and do not represent a specific ordering for the objects, and it is to be understood that "first \ second" may be interchanged with a specific order or sequence, where permitted. It should be understood that "first \ second" distinguishing objects may be interchanged under appropriate circumstances such that the embodiments described herein may be implemented in sequences other than those illustrated or described herein.
The following detailed description of specific embodiments of the invention refers to the accompanying drawings.
The invention discloses a method, a device and equipment for strengthening the outline of a printed image and a readable storage medium, aiming at solving the problems of fuzzy overall and weak layering of the printed image;
referring to fig. 1, a first embodiment of the present invention provides a method for enhancing contours of a printed image, including:
s101, acquiring printing data of a current line of a printing image;
it should be noted that, in the process of printing an image by a printer, printing needs to be performed line by line, and before printing of each line of image is started, print data of a current line needs to be acquired first and sent to a printing module to print the data.
S102, acquiring at least two lines of printing data behind the current line of printing data; wherein, the printing data of two adjacent lines has a preset delay time.
It should be noted that the printer needs a certain printing time (or referred to as a heating time) for printing each line, and if the average printing time of each line is t, after sending the current line of printing data, the printer needs a delay time t and then sends the next line of printing data to the printing module. For example, when the time for sending the print data of the current line to the print module is T, the time for sending the print data of the next line to the print module is T +2T, and so on.
In this embodiment, in order to make the entire printed image more hierarchical and contoured, when printing the current line of data, the current line of print data needs to be processed by using a plurality of lines of print data. Preferably, the current line of print data and the print data two lines after the current line may be acquired, for example, 3 lines of data processing are taken each time, such as (line 1,line 2, line 3), (line 2, line 3, line 4), (line 3, line 4, line 5), in other embodiments, the next line of print data or the next three lines of print data may also be acquired, which is not limited in detail herein, but these schemes are within the protection scope of the present invention.
S103, performing contour enhancement processing on the current line printing data according to the current line printing data and at least two lines of printing data behind the current line printing data to generate an enhancement signal of the current line; after the outline enhancement processing, for the edge signal with sudden change in the printing data of the current line, the low signal is lower, and the high signal is higher.
In the thermal transfer photo printer, the image printed by the printer changes excessively smoothly due to the hysteresis of heat conduction during printing, and the whole image does not look strong in gradation, and therefore, it is necessary to perform contour enhancement processing on the print data to be input to the print module.
Referring to fig. 2 and 3, in the present embodiment, the print data contour enhancement process is as follows:
first, a first intermediate signal C, i.e., C = a + B, is generated by summing current line print data a (i.e., first line print data a), second line print data B following the current line print data a (i.e., third line print data).
And recording the current line of printing data as A, recording the last two lines of printing data of the current line of printing data as D and B, recording the time of inputting the A to the printing module as T, then inputting the D to the printing module as T + T, and inputting the B to the printing module as T +2T.
Then, a second intermediate signal E is generated by subtracting one half of the first intermediate signal C from the first line printing data D (i.e., the second line printing data) subsequent to the current line printing data a.
I.e. E = D-C/2.
Then, the second intermediate signal E is scaled according to the enhancement factor to generate a third intermediate signal G.
In this embodiment, the third intermediate signal G is obtained by dividing the second intermediate signal E by the enhancement factor, that is, by scaling according to a formula G = E/n, where n is the enhancement factor, and in other embodiments, the third intermediate signal G may also be obtained by performing an operation with the enhancement factor in other manners, which is not limited in this embodiment, but these solutions are within the protection scope of the present invention.
Then, a fourth intermediate signal F is generated from the second line print data D.
Wherein the fourth intermediate signal F is identical to the second line print data D, i.e. F = D.
Finally, the fourth intermediate signal F is summed with the third intermediate signal G to generate a reinforcement signal H corresponding to the current line of print data a, i.e., H = F + G.
And S104, printing the current line of the printing image according to the strengthening signal.
It should be noted that, after the enhancement signal H is generated, the first line of print data a to be input to the print module is replaced by the enhancement signal H, so as to increase the edge signal of the abrupt change of the current line.
In the present embodiment, it can be understood that, for the print data of the last two lines of the image, since the outline enhancement cannot be achieved by the above-described procedure, it is directly printed using the original print data without performing additional processing. Of course, in other embodiments, the data of the last two rows may also be processed in other manners, which are not limited herein, but these aspects are all within the scope of the present invention.
In summary, according to the contour enhancement method for the printed image of the embodiment, the data of the current line of the image to be printed and the at least two lines of print data behind the print data of the current line are obtained, the contour enhancement operation is performed on the data to generate the enhancement signal of the current line of the image to be printed, the data of the current line of the image to be printed is replaced by the enhancement signal, and the enhancement signal of the whole image to be printed is sequentially obtained and replaced, so that the edge signal of the sudden change in the print data of the current line is lower in low signal and higher in high signal, and the problems that the whole printed image is fuzzy and not strong in layering are solved.
Referring to fig. 4, a second embodiment of the present invention provides a contour enhancing apparatus for a printed image, including:
a first printdata acquisition unit 201 for acquiring the current line print data of the print image;
a second printdata acquiring unit 202 configured to acquire at least two lines of print data located after the current line of print data; wherein, a preset delay time is arranged between two adjacent lines of printing data;
a reinforcedsignal generating unit 203, configured to perform contour reinforcement processing on the current line print data according to the current line print data and at least two lines of print data located behind the current line print data, and generate a reinforced signal of the current line; after the outline enhancement processing, for the edge signals with sudden change in the printing data of the current line, the low signals are lower, and the high signals are higher;
aprinting unit 204, configured to print a current line of the print image according to the emphasis signal.
Preferably, the enhancementsignal generating unit 203 is specifically configured to:
recording the current line printing data as A, and recording the last two lines of printing data of the current line printing data as D and B;
summing A and B to generate a first intermediate signal C;
subtracting one half of the first intermediate signal C from D to generate a second intermediate signal E;
scaling the second intermediate signal E according to a strengthening factor to generate a third intermediate signal G;
equating D to a fourth intermediate signal F;
and summing the fourth intermediate signal F and the third intermediate signal G to generate a reinforced signal H corresponding to A.
Preferably, theprinting unit 204 is specifically configured to:
replacing the current line printing data A of the printing image with the strengthening signal H, and printing the current line according to the strengthening signal H.
Preferably, the third intermediate signal G is obtained by dividing the second intermediate signal E by a boosting factor.
A third embodiment of the present invention provides a contour enhancement apparatus for a print image, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor executing the computer program to implement a contour enhancement method for a print image as described in any one of the above.
A fourth embodiment of the present invention provides a readable storage medium storing a computer program executable by a processor of an apparatus on which the storage medium is located to implement a method of contour enhancement of a printed image as described in any one of the above.
Based on the method, the device and the equipment for strengthening the outline of the printed image and the readable storage medium provided by the invention, the data of the current line of the image to be printed and the two lines of printed data behind the printed data of the current line are obtained, the outline strengthening operation is carried out on the data to generate the strengthening signal of the current line of the image to be printed, the strengthening signal is used for replacing the data of the current line, and the strengthening signal of the whole image to be printed is sequentially obtained and replaced, so that the edge signal with sudden change in the printed data of the current line is lower in low signal and higher in high signal, and the problems that the whole printed image is fuzzy and not strong in layering sense are solved.
Illustratively, the computer programs described in the third and fourth embodiments of the present invention may be partitioned into one or more modules, which are stored in the memory and executed by the processor to implement the present invention. The one or more modules may be a series of computer program instruction segments capable of performing specific functions, the instruction segments being used to describe the execution of the computer program in the outline enhancement apparatus for implementing a printed image. For example, the device described in the second embodiment of the present invention.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, the processor is a control center of the method for enhancing the outline of the print image, and various interfaces and lines are used to connect the whole of the various parts for implementing the method for enhancing the outline of the print image.
The memory may be used to store the computer program and/or module, and the processor may implement various functions of the outline enhancement method for a printed image by running or executing the computer program and/or module stored in the memory and calling data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, a text conversion function, etc.), and the like; the storage data area may store data (such as audio data, text message data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein the implemented module, if implemented in the form of a software functional unit and sold or used as a stand-alone product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer-readable medium may contain suitable additions or subtractions depending on the requirements of legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer-readable media may not include electrical carrier signals or telecommunication signals in accordance with legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection therebetween, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement without inventive effort.
While the invention has been described with reference to specific preferred embodiments, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention as defined in the following claims. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.