A kind of text printing method, system and storage medium

文档序号:1741668 发布日期:2019-11-26 浏览:14次 中文

阅读说明:本技术 一种文本打印方法、系统和存储介质 (A kind of text printing method, system and storage medium ) 是由 冯一文 于 2019-07-19 设计创作,主要内容包括:本发明公开了一种文本打印方法、系统和存储介质,方法包括以下步骤:获取扫描模块上传的文本信息的扫描图像作为第一图像;对第一图像分别进行灰度化处理和二值化处理,得到第二图像;将第二图像发送到打印模块,使打印模块打印第二图像。本发明通过扫描模块扫描上传文本信息的扫描图像,使得用户不用手动拍照、上传复印的文本信息,简化复印操作过程,然后在对扫描图像进行灰度化处理和二值化处理,使扫描图像呈现出明显的黑白效果,从而使得打印出来的文本信息更加清晰。本发明可广泛应用于打印技术领域。(The invention discloses a kind of text printing method, system and storage medium, method is the following steps are included: obtain the scan image for the text information that scan module uploads as the first image;Gray processing processing and binary conversion treatment are carried out to the first image respectively, obtain the second image;Print module is sent by the second image, print module is made to print the second image.The present invention scans the scan image for uploading text information by scan module, so that user does not have to take pictures manually, uploads the text information duplicated, simplify copying operation, then gray processing processing and binary conversion treatment are being carried out to scan image, scan image is set to show apparent black and white effect, so that the text information printed is more clear.It the composite can be widely applied to printing technique field.)

1. a kind of text printing method, it is characterised in that: the following steps are included:

The scan image for the text information that scan module uploads is obtained as the first image;

Gray processing processing and binary conversion treatment are carried out to the first image respectively, obtain the second image;

Print module is sent by the second image, print module is made to print the second image.

2. a kind of text printing method according to claim 1, it is characterised in that: the text for obtaining scan module and uploading The scan image of this information is specifically included as the first image:

Obtain the video data for the text information that scan module uploads;

The scan image of text information is obtained as the first image according to video data.

3. a kind of text printing method according to claim 1, it is characterised in that: the first image is color image.

4. a kind of text printing method according to claim 1, it is characterised in that: described to carry out ash respectively to the first image Degreeization processing and binary conversion treatment, obtain the second image, specifically include:

Three components of the first image are obtained, three components are respectively RGB;

Processing is weighted and averaged to three components of the first image respectively, obtains the gray level image of scan image;

Obtain first threshold;

Binary conversion treatment is carried out to gray level image according to first threshold, obtains the second image.

5. a kind of text printing method according to claim 4, it is characterised in that: the acquisition first threshold is specific Include:

It calculates in gray level image and belongs to the number of pixels in each grayscale;

The number of pixels for traversing each grayscale obtains the inter-class variance maximum of the number of pixels of each grayscale as first threshold.

6. a kind of text printing method according to claim 1, it is characterised in that: carried out respectively described to the first image Gray processing processing and binary conversion treatment, the step for obtaining the second image with it is described by the second image be sent to print module this It is further comprising the steps of between step:

First terminal is sent by the second image;

Receive the modification information for the second image that first terminal uploads;

It is modified according to the modification information to the second image.

7. a kind of text printing method according to claim 6, it is characterised in that: described to send printing for the second image Module, specifically:

The second image after being modified according to modification information is sent to print module.

8. a kind of text printing system, it is characterised in that: include:

Module is obtained, for obtaining the scan image for the text information that scan module uploads as the first image;

Image processing module obtains the second image for carrying out gray processing processing and binary conversion treatment respectively to the first image;

Sending module makes print module print the second image for sending print module for the second image.

9. a kind of text printing system, it is characterised in that: include:

At least one processor, for storing program;

At least one processor is beaten for loading described program with executing the described in any item a kind of texts of claim 1-7 such as Impression method.

10. a kind of storage medium, wherein being stored with the executable instruction of processor, it is characterised in that: the processor is executable Instruction when executed by the processor for realizing a kind of described in any item text printing methods of such as claim 1-7.

Technical field

The present invention relates to printing technique field, especially a kind of text printing method, system and storage medium.

Background technique

For a electronic document, when user needs to obtain a or more parts of paper documents, can by printing or The mode that person duplicates obtains.But for a paper document, when user needs to obtain more parts of paper documents, user is with regard to only It can be obtained by way of duplicating or photo print.However, in the prior art, being obtained by duplicating or photo print Paper document, clarity will be greatly reduced, to will affect the visual effect of user.And during photo print, need It first to take pictures to paper document and upload to terminal device, then carry out printing again, operating process is more troublesome.

Summary of the invention

In order to solve the above technical problems, it is an object of the invention to: hard copy clarity can be increased by providing one kind Text printing method, system and storage medium.

The first technical solution of the present invention is:

A kind of text printing method, comprising the following steps:

The scan image for the text information that scan module uploads is obtained as the first image;

Gray processing processing and binary conversion treatment are carried out to the first image respectively, obtain the second image;

Print module is sent by the second image, print module is made to print the second image.

Further, the scan image for obtaining the text information that scan module uploads is specific as the first image Include:

Obtain the video data for the text information that scan module uploads;

The scan image of text information is obtained as the first image according to video data.

Further, the first image is color image.

Further, described that gray processing processing and binary conversion treatment are carried out respectively to the first image, the second image is obtained, It specifically includes:

Three components of the first image are obtained, three components are respectively RGB;

Processing is weighted and averaged to three components of the first image respectively, obtains the gray level image of scan image;

Obtain first threshold;

Binary conversion treatment is carried out to gray level image according to first threshold, obtains the second image.

Further, the acquisition first threshold, specifically includes:

It calculates in gray level image and belongs to the number of pixels in each grayscale;

The number of pixels for traversing each grayscale obtains the inter-class variance maximum of the number of pixels of each grayscale as the first threshold Value.

Further, gray processing processing and binary conversion treatment are carried out to the first image described respectively, obtain the second image The step for and described the step for sending print module for the second image between, it is further comprising the steps of:

First terminal is sent by the second image;

Receive the modification information for the second image that first terminal uploads;

It is modified according to the modification information to the second image.

It is further, described to send print module for the second image, specifically:

The second image after being modified according to modification information is sent to print module.

Second of technical solution of the present invention is:

A kind of text printing system, comprising:

Module is obtained, for obtaining the scan image for the text information that scan module uploads as the first image;

Image processing module obtains the second figure for carrying out gray processing processing and binary conversion treatment respectively to the first image Picture;

Sending module makes print module print the second image for sending print module for the second image.

The third technical solution of the present invention is:

A kind of text printing system, comprising:

At least one processor, for storing program;

At least one processor executes a kind of text printing method for loading described program.

4th kind of technical solution of the present invention is:

A kind of storage medium, wherein be stored with the executable instruction of processor, the executable instruction of the processor by For realizing a kind of text printing method when processor executes.

The beneficial effects of the present invention are: the present invention scans the scan image for uploading text information by scan module, so that User does not have to take pictures manually, uploads the text information duplicated, simplifies copying operation, is then carrying out gray scale to scan image Change processing and binary conversion treatment, so that scan image is showed apparent black and white effect, so that the text information printed It is more clear.

Detailed description of the invention

Fig. 1 is a kind of flow chart of text printing method of the specific embodiment of the invention;

Fig. 2 is the module frame chart of the application system of the specific embodiment of the invention.

Specific embodiment

The present invention is described in further detail in the following with reference to the drawings and specific embodiments.In for the examples below Number of steps is arranged only for the purposes of illustrating explanation, does not do any restriction to the sequence between step, each in embodiment The execution sequence of step can be adaptively adjusted according to the understanding of those skilled in the art.

Referring to Fig.1, the embodiment of the invention provides a kind of text printing methods, comprising the following steps:

S101, the scan image for the text information that scan module uploads is obtained as the first image;The text information is The content of text for needing to duplicate.The scan image is the video counts uploaded during the scanning process by first obtaining scan module According to being then converted to scan image by video data.The text information that this step needs to duplicate by scan module scanning, To simplify text copying process.

S102, gray processing processing and binary conversion treatment are carried out to the first image respectively, obtain the second image;First figure It seem color image.The progress gray processing processing is in order to which color image is become gray level image.At the progress binaryzation Reason is to make gray level image show apparent black and white effect.By the treatment process of this step, the text for running off and may make Originally the text that duplicating mode compared with the existing technology obtains is more clear.

S103, print module is sent by the second image, print module is made to print the second image.Second image is One image completes the image obtained after gray processing processing and binary conversion treatment.

The present embodiment by scan module scan upload text information scan image so that user do not have to take pictures manually, The text information duplicated is uploaded, copying operation is simplified, is then carried out at gray processing processing and binaryzation to scan image Reason, makes scan image show apparent black and white effect, so that the text information printed is more clear.

It is further used as preferred embodiment, the scan image conduct for obtaining the text information that scan module uploads First image, specifically includes:

Obtain the video data for the text information that scan module uploads;Specifically user will need the text duplicated to be placed on The scan position of scan module, wherein scan position can be marked with wire, and then scan module passes through videograph text This information, and the video data recorded is uploaded into server-side, server-side receives the video data that scan module uploads.

The scan image of text information is obtained as the first image according to video data.Server-side receives on scan module After the video data of biography, video data is handled, for example the more visible text information of video data internal ratio is extracted, It is converted into picture format, the image after finally converting format is as the first image.

The present embodiment is obtained by video data needs the text information that duplicates, family can be used in copying process not With the process for text information of being taken pictures, uploaded manually, to improve duplicating efficiency.

It is further used as preferred embodiment, the first image is color image.By obtaining color image, can make It is more accurate to obtain the information that server-side is extracted.

It is further used as preferred embodiment, it is described that first image is carried out at gray processing processing and binaryzation respectively Reason, obtains the second image, specifically includes:

Three components of the first image are obtained, three components are respectively RGB;The first image is color image. The RGB is the color mode of color image.

Processing is weighted and averaged to three components of the first image respectively, obtains the gray level image of scan image;Because Human eye to green susceptibility highest, to blue susceptibility it is minimum, therefore, by three components to the first image respectively into Row weighted average processing, to obtain relatively reasonable gray level image, wherein weighting processing formula are as follows:

F (i, j)=0.30R (i, j)+0.59G (i, j)+0.11B (i, j)

Wherein, (i, j) indicates that position point, f indicate gray value of the black white image at point (i, j) point after conversion, R Indicate red, G indicates green, and B indicates blue.

Obtain first threshold;The first threshold is that gray level image is very big in the inter-class variance of the number of pixels of each grayscale Value.

Binary conversion treatment is carried out to gray level image according to first threshold, obtains the second image.This step passes through first threshold Binary conversion treatment is carried out to gray level image to distinguish image mainly using the difference of target image and background image in image Two different ranks are set, so that image be made to show apparent black and white effect.

It is further used as preferred embodiment, the acquisition first threshold specifically includes:

It calculates in gray level image and belongs to the number of pixels in each grayscale;This step is specifically to calculate to belong to 0- on gray level image The corresponding number of pixels of 255 each grayscale, is saved into the same array, then, the subscript of the array is marked using gray value, should The content that array saves is the corresponding pixel of current grayvalue.

The number of pixels for traversing each grayscale obtains the inter-class variance maximum of the number of pixels of each grayscale as the first threshold Value.This step first have to obtain the average gray of background image and the average gray of pixel proportion and target image and Then pixel proportion traverses the number of pixels of each grayscale again, by the average gray and pixel proportion of background image, And the average gray and pixel proportion of target image determine the inter-class variance maximum conduct of the number of pixels of each grayscale First threshold to beat indirectly to guarantee that two different ranks again can be accurately arranged in target image and background image The text come is printed off to be more clear.

It is further used as preferred embodiment, first image is carried out at gray processing processing and binaryzation respectively described It further include following between the step for managing, obtaining the second image and described the step for sending print module for the second image Step:

First terminal is sent by the second image;The first terminal can be the microcomputer terminal on printer, It can be the computer terminal of user.This step can show second picture in first terminal, allow user to the content of display It is checked or is modified.

Receive the modification information for the second image that first terminal uploads;The modification information is that user checks at the terminal After the content of second image, when modifying to the content of the second image, sent to server-side one instruction of first terminal.

It is modified according to the modification information to the second image.This step is that the text printed can be made to meet use The requirement at family, so as to reduce duplicate printing.

It is further used as preferred embodiment, it is described to send print module for the second image, specifically:

The second image after being modified according to modification information is sent to print module.The present embodiment to print Content of text meet the requirement of user, meanwhile, the clarity for the text that the clarity of text is also printed than the prior art It is high.

The present invention can also simultaneously duplicate multiple texts, during carrying out multiple text duplicating, first by institute The scan image of the text information of duplicating in need uploads to server-side, then successively carries out at gray processing to all scan images Reason and binary conversion treatment generate control information, control printing after determining the image procossing that all scan images have all carried out Module successively carries out printing.

It is illustrated in figure 2 application system of the present invention on specific embodiment, the present invention is applied particularly to application system Server-side, the application system include scan module, print module, first terminal and server-side, the scan module, impression block Block, first terminal are connect with server-side;Wherein, operating process of the present invention in the application system is as follows:

The first step, after first terminal selects copy function, server-side can generate a start command, starting scan module into Row scan operation;

Second step, scan module successively carry out videoscanning at least a text, generate view corresponding with text number Frequency evidence, and all video datas are uploaded into server-side;

Third step, server-side successively convert all video datas, obtain scanning figure corresponding with video data Then picture successively carries out gray processing processing and binary conversion treatment to all scan images, obtains having obvious black and white effect Gray level image;

4th step, after determining that all scan images are completed image procossing, after will successively completing image procossing Scan image is sent to first terminal, and first terminal is made successively to show scan image;

5th step successively receives the modification information for the scan image that first terminal uploads, is successively modified according to modification information Scan image for example, receiving the modification information a of scan image A, and receives the modification information b of scan image B, then root Scan image A is modified according to modification information a, scan image B is modified according to modification information b, without being swept according to modification information a modification Tracing is as B;

6th step generates control signal after determining that all scan images have all completed image procossing and information modification, And print module is sent by control signal and scan image;

7th step receives server-side the control signal and scanned picture that issue, according to control signal successively print scanned figure Piece.

The embodiment of the invention also provides a kind of text printing systems corresponding with Fig. 1 method comprising:

Module is obtained, for obtaining the scan image for the text information that scan module uploads as the first image;

Image processing module obtains the second figure for carrying out gray processing processing and binary conversion treatment respectively to the first image Picture;

Sending module makes print module print the second image for sending print module for the second image.

Suitable for this system embodiment, this system embodiment is implemented content in above method embodiment Function is identical as above method embodiment, and the beneficial effect reached and above method beneficial effect achieved are also identical.

The embodiment of the invention also provides a kind of text printing systems corresponding with Fig. 1 method comprising:

At least one processor, for storing program;

At least one processor executes a kind of text printing method for loading described program.

Suitable for this system embodiment, this system embodiment is implemented content in above method embodiment Function is identical as above method embodiment, and the beneficial effect reached and above method beneficial effect achieved are also identical.

In addition, the embodiment of the invention also provides a kind of storage mediums, wherein being stored with the executable instruction of processor, institute The executable instruction of processor is stated when executed by the processor for realizing a kind of text printing method.

In conclusion the present invention scans the scan image for uploading text information by scan module, so that user does not have to hand It is dynamic to take pictures, upload the text information duplicated, simplify copying operation, gray processing processing and two then is being carried out to scan image Value processing, makes scan image show apparent black and white effect, so that the text information printed is more clear;Into One step, the present invention modifies to scan image by receiving the modification information that first terminal uploads, so that print Text information meets the requirement of user.

It is to be illustrated to preferable implementation of the invention, but the present invention is not limited to the embodiment above, it is ripe Various equivalent deformation or replacement can also be made on the premise of without prejudice to spirit of the invention by knowing those skilled in the art, this Equivalent deformation or replacement are all included in the scope defined by the claims of the present application a bit.

8页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:多倍墨量打印控制方法、装置、打印机和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类