CN111145126B - Image character fast erasing method - Google Patents

Image character fast erasing method Download PDF

Info

Publication number
CN111145126B
CN111145126B CN201911405784.5A CN201911405784A CN111145126B CN 111145126 B CN111145126 B CN 111145126B CN 201911405784 A CN201911405784 A CN 201911405784A CN 111145126 B CN111145126 B CN 111145126B
Authority
CN
China
Prior art keywords
background
pixel
color
value
characters
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201911405784.5A
Other languages
Chinese (zh)
Other versions
CN111145126A (en
Inventor
陈文海
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to CN201911405784.5A priority Critical patent/CN111145126B/en
Publication of CN111145126A publication Critical patent/CN111145126A/en
Application granted granted Critical
Publication of CN111145126B publication Critical patent/CN111145126B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T5/77
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention discloses a method for quickly erasing image characters, which comprises the steps of inputting an image to be processed; judging and selecting the background color type of the character area to be erased, drawing a selection frame to select the characters to be erased: if the background is a monochromatic background, automatically sampling and selecting pixel points from the initial position of the selecting frame by the system, continuously copying the background blocks with preset pixel width to the end point direction of the selecting frame and covering character pixel points; if the background is the gradient color background, the system adds a preset expansion value to the RGB value of the pixel point at the starting point of the culling frame to serve as a background protection color gamut, sequentially reads the RGB values of all the pixel points in the culling frame, judges whether the RGB values are in the range of the background protection color gamut, and if so, does not perform any operation; if not, replacing the RGB value covering the current pixel point by the RGB value of the adjacent protective color pixel point of the pixel point, adding a preset expansion value to the RGB value of the pixel point after replacement to serve as a new background protective color gamut, and repeating the steps.

Description

Image character fast erasing method
Technical Field
The invention relates to the technical field of image processing, in particular to a method for quickly erasing image characters.
Background
In the field of image processing, adobe Photoshop is highly favored by the industry, especially the image restoration function is very powerful, but the efficiency of restoring the erased image text is very low. Image processing software other than Adobe Photoshop is similar to the repair concept of Adobe Photoshop, and is basically ignored in the erasing technique of image characters.
The existing image repairing tool uses a non-specific erasing technique, such as a Photoshop stamp or a repairing tool, and when erasing characters on an image, a user manually samples an image background block pattern around the characters (or the size of a brush set by the user) to cover the characters, thereby achieving the effect of erasing the characters. As shown in fig. 1, particularly such images containing a gradient-colored background, erasing a segment of text on the image may require the image processor to play by sampling, clicking or dragging, smearing several tens, or even hundreds of times around the text. For a person who does not perform professional image processing or a common user, the characters can be erased, but the background leaves various modified mottled traces, the background is not better restored, and the time is very long.
In view of the above, it is desirable to provide a new method for erasing graphic characters quickly.
Disclosure of Invention
In order to solve the above technical problems, the technical solution of the present invention is to provide a method for erasing image and text quickly, comprising the following steps:
s1, inputting an image to be processed;
s2, judging and selecting the background color type of the character area to be erased, drawing a selecting frame to select the character to be erased;
s3, if the background is a monochrome background, turning to the step S4, and if the background is a gradient color background, turning to the step S5;
s4, according to the preset pixel point covering direction, automatically sampling and selecting pixel points from the initial position of the selecting frame by the system, continuously copying and covering character pixel points to the end point direction of the selecting frame by a background block with the preset width of 1-10 pixels, and outputting and displaying the processed image;
s5, according to the preset pixel coverage direction, the system takes the RGB value of the pixel at the starting point of the selecting frame plus a preset expansion value as the boundary RGB value of the background protection color gamut, and the RGB value pixels outside the boundary value are all non-background protection color gamuts; when processing characters with light color, background and deep color, the background protection color gamut is from pure white to boundary RGB value; when processing the characters with dark color background and light color, the background protection color gamut is from the boundary RGB value to pure black;
the preset expansion value is set according to the background color of the characters to be erased and the periphery of the corresponding characters in the image judged by the user, if the characters are light-color backgrounds of dark characters, the preset expansion value is set to be not more than 0 by the user, and if the characters are light-color backgrounds of dark characters, the preset expansion value is set to be not less than 0 by the user;
traversing to obtain all RGB pixel points contained in the selection frame; in the traversing process, if the RGB value of the current pixel point is contained in the background protection color gamut, no processing is carried out, and the remaining pixel points are continuously traversed; if the current pixel point is not contained in the background protection color gamut, replacing and covering the current pixel point by using an RGB value pixel point which is adjacent to the current pixel point and belongs to the background protection color gamut; the RGB value of the pixel point after replacement plus a preset expansion value is used as a new boundary RGB value of the background protection color gamut; continuously repeating the steps until all pixel points in the selection frame are traversed, compared and processed; and outputs and displays the processed image.
In the method, the shape of the marquee is a rectangular frame or a user-defined multi-frame.
In the method, the traversal order of the RGB color values of all the pixel points included in the marquee obtained by the traversal of the gradient background is from left to right, from right to left, from top to bottom, or from bottom to top.
In the above method, the coverage direction includes any angle from left to right, from right to left, from top to bottom, or from bottom to top, depending on the setting.
In the method, the selection of the range of the adjacent pixel points of the gradient color background can be set as the pixel points with the interval of 1-10 pixel points around the replaced pixel point according to the requirement, and the RGB value of the pixel point is in the background protection color gamut.
In the method, the expansion value of the gradient background is set to-255, if one of the values of R, G and B is less than 0 after being expanded by using a negative value, the value is counted as 0, and if one of the values of R, G and B is greater than 255 after being expanded by using a positive value, the value is counted as 255.
In the method, the range of the adjacent pixel points of the gradient background is selected as the pixel points with the interval of 1-10 pixels around the replaced pixel point.
In the method, the monochrome background automatically uses the background block to sample pixels with the width of 1-300 pixels, if the monochrome marquee is a rectangle, the height is the height of the rectangle, and if the monochrome marquee is a polygon, the height is the length from the highest point to the lowest point multiplied by 1.5 times.
In the above method, the preset pixel width range may be set to 1 to 10 pixels.
The image erasing technology of the invention determines a monochromatic background or a gradient color background according to different types of processed image backgrounds, if the background is the monochromatic background, a system automatically samples and selects pixel points from the starting position of a selecting frame and continuously copies and covers character pixel points to the end point direction of the selecting frame by using background blocks with preset pixel widths; if the background is the gradient color background, the system sets a boundary RGB value of the background protection color gamut by selecting a starting point pixel RGB value of a frame and a preset expansion value, then reads the RGB color values of all pixel points in a traversing manner, replaces the pixel points meeting the replacement condition according to the protection color RGB color values between the pixels with the preset interval, and takes the RGB value of the pixel points after replacement and the preset expansion value as the boundary RGB value of the new background protection color gamut; the method is repeated to the end point, so as to achieve the effect of erasing the characters rapidly. Since the background color pixels which are very close to the text color pixels are used for replacement, the pixel points which are replaced after the text is erased are more naturally fused with the background color. The automatic sampling of the present invention solves this problem if a large number of manual fine repair operations between 1-10 pixels are used, which is very costly and inefficient. The invention has wide use population, can erase characters and line patterns on images and video frame images, and has simple operation method and high erasing efficiency.
Drawings
FIG. 1 is a flow chart provided in the present invention;
FIG. 2 is a schematic illustration of the background type provided in the present invention;
FIG. 3 is an image to be processed in the case provided by the present invention;
FIG. 4 is a diagram illustrating an image of a portion to be erased selected by a selecting frame according to an embodiment of the present invention;
FIG. 5 is a diagram of the first erasure result in the case of the present invention;
FIG. 6 is a diagram of the second erasing result in the case of the present invention.
Detailed Description
The invention is described in detail below with reference to specific embodiments and the accompanying drawings.
As shown in FIG. 1, the present invention provides a method for erasing graphic text rapidly, which comprises the following steps:
s1, inputting an image to be processed;
s2, judging and selecting the background color type of the character region to be erased; in this embodiment, the different regions of the image may include a monochrome background or a gradient color background; as shown in fig. 2, the diagrams (a) - (b) are single-color backgrounds (single pure-color backgrounds) formed by single RGB lines, and the diagrams (c) - (d) are single-color backgrounds formed by multiple single RGB color blocks longitudinally and transversely, respectively; the gradient color is a complex background with an arbitrary color from light to dark, or from dark to light, or from one color to another color, and the diagrams (e) to (f) are background with gradient color.
In this embodiment, since the text backgrounds in different areas of the image to be processed have both a gradient color background and a monochrome background, the user can visually determine and determine the background, and then select the monochrome check frame or the gradient color check frame to perform the text erasing operation.
S3, if the background is a monochrome background, turning to the step S4, and if the background is a gradient color background, turning to the step S5;
s4, according to the preset or selected pixel point covering direction, automatically sampling and selecting pixel points from the initial position of the selecting frame by the system, continuously copying and covering character pixel points to the end point direction of the selecting frame by a background block with the preset width of 1-10 pixels, and outputting and displaying the processed image; in this embodiment, it is preferable that the background block with a width of 5 pixels is continuously copied to the end point direction of the culling box and covers the text pixels.
For example, the background color of the processed image is shown in fig. 2 (c), and the background color is a monochrome background formed by a plurality of single RGB value color blocks longitudinally, so the selected coverage direction is from top to bottom or from bottom to top, if the background color of the processed image is shown in fig. 2 (d), the selected coverage direction is from left to right or from right to left, and if the background color of the processed image is a monochrome background formed by single RGB value color blocks, the coverage direction at this time is any direction, such as the types of fig. 2 (a) and (b).
In this embodiment, in order to adapt to various application environments, the shape of the marquee may be a rectangle or a custom polygon according to the shape of the font, the rule of the text arrangement, or the shape of the pattern.
S5, according to a preset pixel point coverage direction, the system takes the RGB value of the pixel point at the starting point of the selecting frame and a preset expansion value as a boundary RGB value of the background protection color gamut, and the RGB value pixel points outside the boundary value are all non-background protection color gamuts; when processing light background dark characters, the background protection color gamut is pure white to boundary RGB values. When processing the characters with dark color background and light color, the background protection color gamut is from the boundary RGB value to pure black;
traversing to obtain all RGB pixel points contained in the selection frame; in the traversing process, if the RGB value of the current pixel point is contained in the background protection color gamut, no processing is carried out, and the remaining pixel points are continuously traversed; if the current pixel point is not contained in the background protection color gamut, replacing and covering the current pixel point by using an RGB value pixel point which is adjacent to the current pixel point and belongs to the background protection color gamut; the RGB value of the pixel point after replacement plus a preset expansion value is used as a new boundary RGB value of the background protection color gamut; continuously repeating the steps until all pixel points in the selection frame are traversed, compared and processed; and outputs and displays the processed image.
The following description describes the different cases under the gradient background and the monochromatic background, respectively.
In this embodiment, the RGB values of the pixels are formed by mixing red, blue, and green according to a certain ratio, which is also called three primary colors, and the three primary colors are represented by english as R (red), G (green), and B (blue). On a computer display, the values of RGB refer to luminance and are expressed using integers. Typically, RGB has 256 levels of brightness, and is represented numerically from 0 to 255. Although the number is 255 at the highest, 0 is also one of the numbers, for 256 levels. The total number of colors is 256 × 256=16777216, so each pixel in an image has a corresponding unique RGB value.
For the gradient background image, in order to identify that the character color and the background color have RGB value difference certainly, the character can be divided into light background dark characters or dark background light characters for simple classification, wherein the background is any color background; in this embodiment, the preset spreading value selection is set as: -255 to 255; the preset expansion value is set so that a user can conveniently take protection according to the shade difference of the background colors of different local parts of the image selection area, and meanwhile, the protection color boundary value of the background colors is dynamically updated along with the change of the shade difference of the background, so that the situation that only characters are smeared or lines or other elements which are not background colors are smeared can be better realized aiming at the contrast of the characters and the background colors.
Setting a preset expansion value according to the background color of the characters to be erased in the image and the periphery of the corresponding characters judged by a user, setting the preset expansion value to be less than or equal to 0 by the user if the characters are light-colored background and dark-colored (the color depth is compared according to the characters and the background), setting the boundary RGB value of the background protection color gamut to be the RGB value of the pixel point plus the preset expansion value, and setting the boundary RGB value of the current background protection color gamut to be pure white RGB (255 ) to the boundary RGB value of the background protection color gamut; if the characters are dark background light color characters, setting a preset expansion value to be more than or equal to 0 by a user, wherein the boundary RGB value of the background protection color gamut is the RGB value of the pixel point plus the preset expansion value, and the current background protection color gamut is the boundary RGB value from pure black RGB (0, 0) to the background protection color gamut;
for example, the image to be processed is a light-color background and a dark-color text, when a rectangular selection frame is drawn on the light-color background, assuming that the pixel color value of the starting point is RGB (211, 191, 160), the preset expansion value is-10, and all RGB values of the color gamut ranging from RGB (255 ) to RGB (201, 181, 150) are background protection colors, in the process of reading the pixel color value, RGB pixel points of the dark-color text, each value of which is smaller than the RGB (201, 181, 150) color value, of the RGB three colors all belong to non-protection colors, satisfy an erasure condition, and are replaced by color values of pixel points of adjacent background protection colors, and after the replacement, the replaced pixel points + the preset expansion value are used again to redefine the protection color gamut. By analogy, the background protection color gamut is continuously and dynamically updated, all the dark color pixel points meeting the erasing condition are replaced, and finally the effect of erasing the dark color characters is achieved. Similarly, if the image to be processed is a dark background and light characters, when a rectangular selection frame is drawn on the dark background, it is assumed that the pixel color value of the starting point is RGB (23, 1, 19), the preset expansion value is 10, and the pixel color value is all RGB values of the color gamut from RGB (0, 0) to RGB (33, 11, 29), i.e. the background protection color, then in the process of reading the pixel color value, RGB pixel points of the light characters whose RGB three color values are all greater than RGB (33, 11, 29) color values all belong to the non-protection color, satisfy the erased condition, will be replaced by the adjacent pixel points of the background protection color, after replacement, re-define the protection color gamut again by using the replaced pixel point + the preset expansion value, and so on, the background protection color gamut is continuously and dynamically updated, all the light pixel points satisfying the erased condition are replaced, and finally the effect of erasing the light characters is achieved.
For a monochrome background image, the system automatically samples and selects pixel points directly from the start of a monochrome marquee, and continuously copies and covers character pixel points in the direction of the end point of the marquee by using a background block with the preset value of 5 pixel widths. In addition, the distance from the starting point to the character is ensured to be larger than the preset width of 5 pixels, so that the system obtains the character copy of the pure background pattern from the starting point to the end point direction and covers the character copy. If the distance from the starting point to the character is less than 5 pixels, the x and y coordinate positions of the selecting frame can be finely adjusted to enlarge the distance, or the width of the automatically sampled block is adjusted to 1-4 pixels, and the system can copy and cover the character pixel points to the end point from any angle of left to right, right to left, top to bottom and bottom to top according to the set covering direction and the starting point of the selecting frame.
For example, the background color of the characters in the selected area to be processed is light gray of RGB (160 ), the character colors are three, RGB (0, 0), RGB (100 ), RGB (255 ), the width and height of the selected rectangular frame range is 380 × 260 pixels, the covering direction is from left to right as default, and the system automatically samples and selects pixel points directly from the top left of the monochrome selection frame and continuously copies the rectangular background block with preset width of 5 pixels and height of 260 pixels to the right end point and covers the above three color-matched characters. The monochrome background image can erase the characters quickly by using the automatically sampled block because the monochrome background image directly covers the characters without distinguishing the background protected color gamut from the non-background protected color gamut and without distinguishing the light background dark characters from the dark background light characters.
In this embodiment, if the pixel width of the background block is not set before the smearing operation, the pixel width of the monochrome background automatically sampled by the background block is 1-300 pixels, and if the frame is rectangular, the height is the height of the rectangle; in the case of a polygonal box, the height is 1.5 times the length from the highest point to the lowest point, but the replacement coverage only acts on the area pixels in the marquee.
Meanwhile, it can be known that the embodiment can be applied to not only smearing characters, but also smearing out other elements including lines, symbols and the like in the image can be realized by the same method, which is different from the character recognition technology, so that the erasable characters are not limited to any fonts.
The difference between the present embodiment and the existing PS or other image modifying software is that the existing image modifying software removes the text by manually selecting the block samples and then erasing the text, and particularly for image processing of the gradient background, the method of erasing the text using the existing block samples requires that the image processor smear around the text by dozens or even hundreds of background color samples, which is difficult and very inefficient. The central idea of the present embodiment is to combine the gradient background automatically sampled by pixels or the single-color background automatically sampled by blocks, so as to cope with various complicated image backgrounds in a flexible and versatile way. For a complicated gradient color background area, the method is realized by the principle of chromatic aberration of characters and the background, a monochrome selecting frame selects the characters needing to be erased and simultaneously directly copies and covers the characters, the gradient selecting frame traverses the RGB values of all pixel points contained in the selected area, the RGB values of the pixel points can be read in the traversing process, the RGB values of the pixel points of a non-background protection color gamut are sequentially replaced by the RGB values of the pixel points contained in the adjacent background protection color gamut, automatic sampling is adopted in the whole process to erase the characters on the monochrome or gradient color background, and the method is simple to operate and high in efficiency.
In this embodiment, when the range of the culling frame is the gradient background, the traversal direction of the RGB color values of all the pixel points included in the traversal culling frame may be determined according to a preset rule, that is, the traversal order may be set from left to right, from right to left, from top to bottom, or from bottom to top according to the system program, and the traversal may be performed according to the direction from the starting point to the ending point of the culling frame.
In this embodiment, the pixel point covering direction in the marquee includes from left to right according to the setting, from right to left, from top to bottom or from bottom to top arbitrary angle, if scribble the in-process and not set up pixel point covering direction, then pixel point covering direction can be according to system setting predetermine for from left to right, from right to left, from top to bottom or from bottom to top arbitrary angle.
If the pixel coverage direction is set from left to right, the direction of the coverage process selects the RGB value of the background protection color pixel in the left preset range to replace the RGB value of the pixel read in the current traversal under the condition of meeting the coverage condition; if the pixel coverage direction is set from top to bottom, the direction of the coverage process selects the RGB value of the pixel in the upper preset range to replace the RGB value of the pixel read during the current traversal under the condition of meeting the coverage condition, thereby realizing the transition and repair of erasing characters and background colors.
In this embodiment, it should be noted that, since the image is two-dimensional (x, y), the reading and the covering of the RGB values of the pixels may be performed sequentially in a row or a column.
In an optimal embodiment, under the condition of a background with gradually changed colors, the adjacent pixel points in the selection frame are detected pixel points in a preset range of the to-be-replaced pixel points, the range of the adjacent pixel points can be selected to be set as pixel points with the interval of 1-10 pixel points around the to-be-replaced pixel points according to requirements, and if the adjacent pixel points are not set before smearing, the preset value is 5 pixel point intervals; the condition can be set according to the complexity of the background color, and a proper range can be selected for smearing the characters, so that the color transition of the background after smearing is more natural. In addition, when the pixel point is read to be the non-protection color (namely the RGB value of the current pixel point is not in the range of the background protection color gamut), once the coverage condition is met, any pixel point RGB value which is adjacent to the current pixel and has the RGB value of the pixel point in the range of the background protection color gamut is obtained according to the preset coverage direction to be used as the RGB value of the coverage point; if the adjacent pixel points do not find the meeting conditions, traversing all the pixel points with the radius of the current pixel point as 5 pixel points until the available RGB value of the background protection color gamut pixel point is found to be used as a replacement.
In this embodiment, for a monochrome marquee, the system will automatically sample and select pixel points directly from the start of the marquee and copy and cover the text pixel points continuously to the end of the marquee with a background block with a preset width of 5 pixels. The system can copy and cover the characters to the end point at any angle from left to right, from right to left, from top to bottom and from bottom to top according to the starting point of the frame selected by the menu color.
The operation of the present invention will be described in detail below.
Firstly, selecting an image to be processed, preliminarily judging a character removing area and a shape of a selecting box to be selected by a user according to elements such as the background color type, character color, character arrangement, background color difference of different areas and the like of the image, setting the background color type of the character area to be erased, and setting the pixel width, the pixel coverage direction, the expansion value and the range of adjacent pixels of a background block;
according to the background color type of the selected character region to be erased: if the background is a monochromatic background, selecting the character to be erased through the selecting frame, directly selecting pixel points from the initial position of the selecting frame by the system according to the set covering direction, continuously covering and replacing other pixel points in the end point direction of the selecting frame by a block with the preset pixel width, and outputting and displaying the image coated with the character;
if the background is the gradient color background, selecting characters by using the marquee, starting the system to traverse and obtain RGB color values of all pixel points contained in the marquee, determining a background protection color gamut by the system according to the RGB value of a pixel at the starting point of the marquee and a preset expansion value, and using the principle of replacing adjacent background protection colors when encountering pixels of a non-background protection color gamut (as a character color gamut): sequentially reading RGB values of the pixel points according to a preset pixel point coverage direction; and if the RGB value of the current pixel point is not in the range of the background protection color gamut, replacing the RGB value covering the current pixel point by the RGB value of the adjacent pixel point of the current pixel point (traversing the current pixel point serving as the center radius of the dot and taking the center radius as the range of 5 pixels, and acquiring the nearest RGB value of the pixel point of the background protection color gamut according to the preset direction). By analogy, after traversing all the pixel points in the selection frame, the image after the characters are smeared is obtained.
The present embodiment will be described below by way of specific examples.
As shown in fig. 3-4, for the image to be processed in this embodiment, all the characters and the line patterns in the middle area on the right side in the image need to be erased, as the colors of the characters and the line patterns are both greatly different from the background color, and the two types of differences exist between the character color and the background color, and the layout of another character is more regular, as shown in the figure, for the monochrome background area (for example, the bottommost character part and the white-black character part on the upper right corner, since the pure color background is a single color, and the covering direction does not need to be set), a rectangular selecting frame is directly drawn on the characters from the upper left to the lower right by using the monochrome selecting frame, so as to ensure that the space between the left side and the characters is larger than the preset 5 pixel width, and if the space is smaller than 5 pixel width, the x, y coordinates of the selecting frame is finely adjusted or the width of the modifying space is 1-4 pixel width, so that the system can obtain the pure background pattern to copy and cover the characters on the right side. This example requires the lines under the text to be preserved so that the left side of the marquee contains background and lines of greater than 5 pixel area, and the end point is also within the line. If the link bars are also to be erased together, the pick box may start to pick outside the leftmost bar, with the end outside the bars. And setting the pixel point coverage direction to be from left to right for the gradient color background area, presetting an expansion value to be-10 (because the pixel points are light-color background dark characters), setting the background color to be gradient color with a changed background color, and acquiring adjacent pixel points and setting the coverage range to be 5 pixels according to a default value.
As shown in fig. 5, the characters and line patterns to be erased are selected by setting different parameters and using the selection frame, respectively, and the effect of complete erasing is shown in fig. 5, it can be seen that the line patterns are not erased, the line patterns are erased by resetting the protection color expansion value, because the color of the line patterns is lighter than that of the characters compared with the background color, the expansion value is modified to-2, the RGB boundary value of the background protection color gamut is reduced, and then the line patterns are selected by the selection frame to be erased, as shown in fig. 6, which is the erasing result.
The present invention is not limited to the above preferred embodiments, and any structural changes made under the teaching of the present invention shall fall within the protection scope of the present invention.

Claims (9)

1. A method for erasing image and text quickly is characterized by comprising the following steps:
s1, inputting an image to be processed;
s2, judging and selecting the background color type of the character area to be erased, drawing a selection frame and selecting the characters to be erased;
s3, if the background is a monochromatic background, turning to the step S4, and if the background is a gradient color background, turning to the step S5;
s4, according to the preset pixel point covering direction, automatically sampling and selecting pixel points from the initial position of the selecting frame by the system, continuously copying and covering character pixel points to the end point direction of the selecting frame by using a background block with the preset pixel width, and outputting and displaying the processed image;
s5, according to the preset pixel coverage direction, the system takes the RGB value of the pixel at the starting point of the selecting frame plus a preset expansion value as the boundary RGB value of the background protection color gamut, and the RGB value pixels outside the boundary value are all non-background protection color gamuts; when processing characters with light color, background and deep color, the background protection color gamut is from pure white to boundary RGB value; when processing the characters with dark background and light color, the background protection color gamut is from a boundary RGB value to pure black;
the preset expansion value is set according to the background color of the characters to be erased and the periphery of the corresponding characters in the image judged by the user, if the characters are light-color backgrounds of dark characters, the preset expansion value is set to be not more than 0 by the user, and if the characters are light-color backgrounds of dark characters, the preset expansion value is set to be not less than 0 by the user;
traversing to obtain all RGB pixel points contained in the selection frame; in the traversing process, if the RGB value of the current pixel point is contained in the background protection color gamut, no processing is carried out, and the remaining pixel points are continuously traversed; if the current pixel point is not contained in the background protection color gamut, replacing and covering the current pixel point by using the RGB value pixel point which is adjacent to the current pixel point and belongs to the background protection color gamut; the RGB value of the pixel point after replacement plus a preset expansion value is used as a new boundary RGB value of the background protection color gamut; continuously repeating the steps until all the pixel points in the selection frame are traversed, compared and processed; and outputs and displays the processed image.
2. The method for erasing image and text quickly of claim 1, wherein the shape of the pick frame is rectangular or custom multi-frame.
3. The method for erasing image and text quickly as claimed in claim 1, wherein the traversal of the gradient background obtains the RGB color values of all the pixels included in the cull box in a traversal order of from left to right, from right to left, from top to bottom, or from bottom to top.
4. The method for erasing image and text quickly of claim 1, wherein the covering direction includes any angle from left to right, from right to left, from top to bottom or from bottom to top according to the setting.
5. The method for erasing image and text quickly as claimed in claim 1, wherein the selection of the adjacent pixel range of the gradient background can be set as the pixel with the distance of 1-10 pixel around the replaced pixel as required, and the RGB value of the pixel is in the background protection color gamut.
6. The method for erasing image and text quickly as claimed in claim 1, wherein the spreading value of the gradient background is set to-255, and is counted as 0 if one of the R, G, B values is less than 0 after spreading with a negative value, and is counted as 255 if one of the R, G, B values is greater than 255 after spreading with a positive value.
7. The method for erasing image and text quickly as claimed in claim 1, wherein the range of adjacent pixels of the gradient background is selected to be pixels with a distance of 1-10 pixels around the replaced pixel.
8. The method of claim 1, wherein the monochrome background automatically uses background blocks to sample pixels with a width of 1-300 pixels, and if the frame is rectangular, the height is rectangular; in the case of a polygonal box, the height is the length from highest to lowest point multiplied by 1.5 times.
9. The method for erasing image and text quickly of claim 1, wherein the predetermined pixel width range is set to 1-10 pixels.
CN201911405784.5A 2019-12-31 2019-12-31 Image character fast erasing method Active CN111145126B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911405784.5A CN111145126B (en) 2019-12-31 2019-12-31 Image character fast erasing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911405784.5A CN111145126B (en) 2019-12-31 2019-12-31 Image character fast erasing method

Publications (2)

Publication Number Publication Date
CN111145126A CN111145126A (en) 2020-05-12
CN111145126B true CN111145126B (en) 2023-04-07

Family

ID=70522804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911405784.5A Active CN111145126B (en) 2019-12-31 2019-12-31 Image character fast erasing method

Country Status (1)

Country Link
CN (1) CN111145126B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112258416A (en) * 2020-10-27 2021-01-22 维沃移动通信有限公司 Image processing method and device and electronic equipment
CN112465931A (en) * 2020-12-03 2021-03-09 科大讯飞股份有限公司 Image text erasing method, related equipment and readable storage medium
CN112887730A (en) * 2021-01-21 2021-06-01 百果园技术(新加坡)有限公司 Video coding and decoding method and device

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002056355A (en) * 2000-08-08 2002-02-20 Nippon Telegr & Teleph Corp <Ntt> Character region extracting method, character region extracting device, and recording medium
EP1574987A2 (en) * 2004-03-10 2005-09-14 Fujitsu Limited Character recognition method
CN103049756A (en) * 2012-11-16 2013-04-17 健雄职业技术学院 Method for automatically extracting and removing words in color image on basis of CEMA (Cellular Message Encryption Algorithm) and texture matching repairing technology
CN106204424A (en) * 2016-06-30 2016-12-07 厦门美图之家科技有限公司 Image removes water mark method, applies and calculating equipment
CN108320265A (en) * 2018-01-31 2018-07-24 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium
CN109255355A (en) * 2018-05-28 2019-01-22 北京京东尚科信息技术有限公司 Image processing method, device, terminal, electronic equipment and computer-readable medium
CN109447086A (en) * 2018-09-19 2019-03-08 浙江口碑网络技术有限公司 A kind of extracting method and device of picture character color

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002056355A (en) * 2000-08-08 2002-02-20 Nippon Telegr & Teleph Corp <Ntt> Character region extracting method, character region extracting device, and recording medium
EP1574987A2 (en) * 2004-03-10 2005-09-14 Fujitsu Limited Character recognition method
CN103049756A (en) * 2012-11-16 2013-04-17 健雄职业技术学院 Method for automatically extracting and removing words in color image on basis of CEMA (Cellular Message Encryption Algorithm) and texture matching repairing technology
CN106204424A (en) * 2016-06-30 2016-12-07 厦门美图之家科技有限公司 Image removes water mark method, applies and calculating equipment
CN108320265A (en) * 2018-01-31 2018-07-24 努比亚技术有限公司 A kind of image processing method, terminal and computer readable storage medium
CN109255355A (en) * 2018-05-28 2019-01-22 北京京东尚科信息技术有限公司 Image processing method, device, terminal, electronic equipment and computer-readable medium
CN109447086A (en) * 2018-09-19 2019-03-08 浙江口碑网络技术有限公司 A kind of extracting method and device of picture character color

Also Published As

Publication number Publication date
CN111145126A (en) 2020-05-12

Similar Documents

Publication Publication Date Title
CN111145126B (en) Image character fast erasing method
EP1056052B1 (en) User-defined erasure brush for modifying digital image
EP1284471B1 (en) Display equipment, display method, and recording medium for recording display control program
EP1174854B1 (en) Display equipment, display method, and storage medium storing a display control program using sub-pixels
EP1962224B1 (en) Applying traps to a printed page specified in a page description language format
US5172423A (en) Methods and apparatus for defining contours in colored images
EP0786757B1 (en) Adjusting contrast in antialiasing
US20070253640A1 (en) Image manipulation method and apparatus
JPH0750752A (en) Method and device for converting picture density
US20060239548A1 (en) Segmentation of digital images
US9792695B2 (en) Image processing apparatus, image processing method, image processing system, and non-transitory computer readable medium
JP5880767B2 (en) Region determination apparatus, region determination method, and program
JP2006031688A (en) Image processing device, method, and program
WO2018151043A1 (en) Image processing method and computer program
EP0477904B1 (en) Method and apparatus for generating images of reduced size
US20110187721A1 (en) Line drawing processing apparatus, storage medium storing a computer-readable program, and line drawing processing method
US6496198B1 (en) Color editing system
JPH04139589A (en) Graphic processor
JP4084105B2 (en) Character creation method and character creation program
JP2016181111A (en) Image processing apparatus and image processing program
EP1733377B1 (en) Sub-component based rendering of objects having spatial frequency dominance parallel to the striping direction of the display
JP2004226679A (en) Character display method and system
KR101666131B1 (en) Vector Font Rendering with considering sub-pixel pattern
JP4736489B2 (en) Image processing device
JP3304381B2 (en) Image processing device having contour extraction function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant