CN109360164B - Picture ground color bleeding and denoising processing method - Google Patents

Picture ground color bleeding and denoising processing method Download PDF

Info

Publication number
CN109360164B
CN109360164B CN201811124180.9A CN201811124180A CN109360164B CN 109360164 B CN109360164 B CN 109360164B CN 201811124180 A CN201811124180 A CN 201811124180A CN 109360164 B CN109360164 B CN 109360164B
Authority
CN
China
Prior art keywords
picture
color
imagerect
value
dscimage
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
CN201811124180.9A
Other languages
Chinese (zh)
Other versions
CN109360164A (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.)
Zhejiang Wanpeng Digital Intelligence Technology Co.,Ltd.
Original Assignee
Zhejiang Wanpeng Education Science And Technology Stock Co ltd
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 Zhejiang Wanpeng Education Science And Technology Stock Co ltd filed Critical Zhejiang Wanpeng Education Science And Technology Stock Co ltd
Priority to CN201811124180.9A priority Critical patent/CN109360164B/en
Publication of CN109360164A publication Critical patent/CN109360164A/en
Application granted granted Critical
Publication of CN109360164B publication Critical patent/CN109360164B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • G06T5/94
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows

Abstract

The invention discloses a picture ground color bleeding and denoising processing method. The invention comprises the following steps: binaryzation is carried out on an original picture; providing the parameter value externally; creating a two-bit array DscImage; carrying out block statistics on the picture according to the edge length of the segmentation picture; acquiring the area information of the nth block; calculating a sampling point array DSB for the nth block diagram at a color sampling interval according to the RGB color values; counting the color threshold value of the nth block image; traversing each pixel point of the nth block diagram; obtaining the final DscImage; step (10), externally calculating the color threshold ratio, the sampling interval and the value of the side length of the segmentation graph through the parameter quality; repeating the steps by using the three parameter values to obtain DscImage1 and DscImage 2; sequentially traversing the pixels of the DscImage1 and DscImage2, judging, and using the traversed DscImage2 to generate a picture. The invention can prevent the problems of graying of the ground color, unclear characters and the like when the word is printed.

Description

Picture ground color bleeding and denoising processing method
Technical Field
The invention belongs to the field of computer image processing, and removes the background of an image or a shadow generated by light.
Background
At present, in the internet + age, from production to life, people need to use networks in all aspects. People gradually shift traditional offline behavior to online, as well as educational aspects. The students are not limited to on-line learning, but can also do homework on line, and teachers directly and remotely correct the homework. The shooting and uploading operation is combined online and offline, and has certain practicability. However, the taken picture may not be clearly affected by the factors such as light, and at this time, the picture needs to be optimized to whiten the ground color and remove noise.
Disclosure of Invention
The invention aims to provide a method for processing background color bleeding and denoising of an image, aiming at the defects of the prior art.
The technical scheme adopted by the invention for solving the technical problem comprises the following steps:
the method comprises the following steps of (1) binarizing an original picture, expressing an R value set in picture pixel RGB values by using SrcImage, expressing the R value of a certain pixel point (x, y) of the picture by using SrcImage [ x ] [ y ] (the x axis and the y axis respectively express the length and the width), and expressing the width and the height of the picture by using ImageWidth and Imageheight respectively;
step (2), externally providing parameter values: RGBThresholdPercent (color threshold ratio, unit float), SamplingInterval (sampling interval, unit int), ImageRect (segmentation graph side length, unit int)
Step (3), creating a two-bit array DscImage for storing R value information of each pixel point after picture processing, wherein the DscImage [ x ] [ y ] and the SrcImage [ x ] [ y ] coordinate correspond to each other one by one;
and (4) carrying out block statistics on the picture according to the segmentation image edge length value ImageRect in order to improve the accuracy of image processing. The width of the picture is divided into WidthNum, WidthNum ═ ImageWidth/ImageRect + (ImageWidth% ImageRect >01: 0); the height of the picture is divided into height num ═ ImageHeight/ImageRect + (ImageHeight% ImageRect >01: 0); pictures are divided into ImageNum, width num, height num.
Step (5), acquiring the area information of the nth block diagram:
the upper, lower, left and right values of the block are ItemTop, ItemBottom, ItemLeft, ItemRight, respectively:
ItemTop=n/WidthNum*ImageRect;
ItemBottom ═ ItemTop + ImageRect, ItemBottom ═ ImageHeight if ItemBottom > ImageHeight;
ItemLeft=n%WidthNum*ImageRect;
ItemRight ═ ItemLeft + ImageRect, ItemRight ═ ImageWidth if ItemRight > ImageWidth.
The total pixel point ItemPointTotalNum of the block:
ItemPointTotalNum=(ItemRight–ItemLeft+1)*(ItemBottom–ItemTop+1)。
step (6), according to the RGB color values, calculating a sampling point array DSB for the nth block diagram at a color sampling interval SamplingInterval: DSB { { Ai, Weight i } }; a. theiRepresenting the current sample color value, WeightiRepresenting the current sample color value as AiWhen the color value in the block map is AiThe number of the pixel points;
step (7), counting the color threshold RGBThreshold of the nth block diagram,
circularly sampling point array DSB, accumulating sampling color value A from i-0iStatistic value of (3)iThe loop is skipped until the accumulated value is greater than ItemPointTotalNum RGBThresholdPercent. RGBThreshold ═ (Weight 0+ Weight 1+ … + Weight i)
Step (8), traversing each pixel point of the nth block diagram, if SrcImage [ x ] [ y ] < (RGBThreshold) and DscImage [ x ] [ y ] < 0, otherwise, DscImage [ x ] [ y ] < 255
And (9) calculating each minimap according to the steps (5) to (8) to obtain the final DscImage.
Step (10), externally calculating the value of parameters such as RGBThresholdPercent and the like through parameter quality
RGBThresholdPercent1=0.6+0.15*quality;
ImageRect1=700*quality;
SamplingInterval1=RGBThresholdPercent1*4;
RGBThresholdPercent2=0.45+0.15*quality;
ImageRect2=35/quality;
SamplingInterval2=RGBThresholdPercent2*4;
Step (11), performing steps (2) to (9) by using RGBThresholdPercent1, SamplingInterval1 and ImageRect1 to obtain DscImage 1;
performing steps (2) - (9) with RGBThresholdPercent2, SamplingInterval2, ImageRect2 to obtain DsciImage 2;
and (12) sequentially traversing the pixels of the DscImage1 and DscImage2, wherein if the DscImage1[ x ] [ y ] ═ 255, the DscImage2[ x ] [ y ] ═ 255.
And (13) using the traversed DscImage2 to generate a picture.
The value of n according to the invention is from 0;
the quality of the invention can adjust the image processing effect, the quality is more than 0.0 and less than 1.0, the standard value is 0.8, more noise can be caused when the standard value is less than 0.8, and partial text information can be lost when the standard value is more than 0.8.
The invention has the following beneficial effects:
the method is different from other image processing software, aims at processing the character and the picture, binarizes the image, changes the background color of the image into white, highlights characters, removes interference points or lines, enhances the display effect of the title characters, and shields the influence of factors such as paper, light and the like on the picture. Therefore, when students assemble subjects into words for printing, the problems of graying of the background color, unclear characters and the like can be avoided. The method is currently applied to post-session web wrong answer books.
According to the invention, through steps (10) - (13), the image processing effect is adjusted through quality, the standard value is 0.8, noise is excessive when the standard value is less than 0.8, and partial text information is lost when the standard value is more than 0.8. The positioning is accurate through quality, and noise points and text information loss are reduced.
Detailed Description
The present invention will be further described with reference to the following examples.
A picture ground color bleeding and denoising processing method specifically comprises the following steps:
the method comprises the following steps of (1) binarizing an original picture, expressing an R value set in picture pixel RGB values by using SrcImage, expressing the R value of a certain pixel point (x, y) of the picture by using SrcImage [ x ] [ y ] (the x axis and the y axis respectively express the length and the width), and expressing the width and the height of the picture by using ImageWidth and Imageheight respectively;
step (2), externally providing parameter values: RGBThresholdPercent (color threshold ratio, unit float), SamplingInterval (sampling interval, unit int), ImageRect (segmentation graph side length, unit int)
Step (3), creating a two-bit array DscImage for storing R value information of each pixel point after picture processing, wherein the DscImage [ x ] [ y ] and the SrcImage [ x ] [ y ] coordinate correspond to each other one by one;
and (4) carrying out block statistics on the picture according to the segmentation image edge length value ImageRect in order to improve the accuracy of image processing. The width of the picture is divided into WidthNum, WidthNum ═ ImageWidth/ImageRect + (ImageWidth% ImageRect >01: 0); the height of the picture is divided into height num ═ ImageHeight/ImageRect + (ImageHeight% ImageRect >01: 0); pictures are divided into ImageNum, width num, height num.
Step (5), acquiring the area information of the nth block diagram:
the upper, lower, left and right values of the block are ItemTop, ItemBottom, ItemLeft, ItemRight, respectively:
ItemTop=n/WidthNum*ImageRect;
ItemBottom ═ ItemTop + ImageRect, ItemBottom ═ ImageHeight if ItemBottom > ImageHeight;
ItemLeft=n%WidthNum*ImageRect;
ItemRight ═ ItemLeft + ImageRect, ItemRight ═ ImageWidth if ItemRight > ImageWidth.
The total pixel point ItemPointTotalNum of the block:
ItemPointTotalNum=(ItemRight–ItemLeft+1)*(ItemBottom–ItemTop+1)。
step (6), according to the RGB color values, calculating a sampling point array DSB for the nth block diagram at a color sampling interval SamplingInterval: DSB { { Ai, Weight i } }; a. theiRepresenting the current sample color value, WeightiRepresenting the current sample color value as AiWhen the color value in the block map is AiThe number of the pixel points;
step (7), counting the color threshold RGBThreshold of the nth block diagram,
circularly sampling point array DSB, accumulating sampling color value A from i-0iStatistic value of (3)iThe loop is skipped until the accumulated value is greater than ItemPointTotalNum RGBThresholdPercent. RGBThreshold ═ (Weight 0+ Weight 1+ … + Weight i)
Step (8), traversing each pixel point of the nth block diagram, if SrcImage [ x ] [ y ] < (RGBThreshold) and DscImage [ x ] [ y ] < 0, otherwise, DscImage [ x ] [ y ] < 255
And (9) calculating each minimap according to the steps (5) to (8) to obtain the final DscImage.
Step (10), externally calculating the value of parameters such as RGBThresholdPercent and the like through parameter quality
RGBThresholdPercent1=0.6+0.15*quality;
ImageRect1=700*quality;
SamplingInterval1=RGBThresholdPercent1*4;
RGBThresholdPercent2=0.45+0.15*quality;
ImageRect2=35/quality;
SamplingInterval2=RGBThresholdPercent2*4;
Step (11), performing steps (2) to (9) by using RGBThresholdPercent1, SamplingInterval1 and ImageRect1 to obtain DscImage 1;
performing steps (2) - (9) with RGBThresholdPercent2, SamplingInterval2, ImageRect2 to obtain DsciImage 2;
and (12) sequentially traversing the pixels of the DscImage1 and DscImage2, wherein if the DscImage1[ x ] [ y ] ═ 255, the DscImage2[ x ] [ y ] ═ 255.
And (13) using the traversed DscImage2 to generate a picture.
The value of n according to the invention is from 0;
the quality of the invention can adjust the image processing effect, the quality is more than 0.0 and less than 1.0, the standard value is 0.8, more noise can be caused when the standard value is less than 0.8, and partial text information can be lost when the standard value is more than 0.8.

Claims (3)

1. A picture ground color bleeding and denoising processing method is characterized by comprising the following steps:
the method comprises the following steps of (1) binarizing an original picture, expressing an R value set in picture pixel RGB values by using SrcImage, expressing the R value of a certain pixel point (x, y) of the picture by using SrcImage [ x ] [ y ], and respectively expressing the width and the height of the picture by using ImageWidth and Imageheight;
step (2), externally providing parameter values: color threshold ratio RGBThresholdPercent, sampling interval SamplingInterval and segmentation graph edge length ImageRect;
step (3), creating a two-dimensional array DscImage for storing R value information of each pixel point after picture processing, wherein the DscImage [ x ] [ y ] and the SrcImage [ x ] [ y ] coordinate correspond to each other one by one;
step (4), carrying out block statistics on the picture according to the ImageRect of the edge length of the segmentation picture;
step (5), acquiring the area information of the nth block diagram;
step (6), according to the RGB color values, calculating a sampling point array DSB for the nth block diagram at a color sampling interval SamplingInterval: DSB { { Ai, Weight i } }; a. theiRepresenting the current sample color value, WeightiRepresenting the current sample color value as AiWhen the color value in the block map is AiThe number of the pixel points;
step (7), counting the color threshold RGBThreshold of the nth block diagram:
circularly sampling point array DSB, accumulating sampling color value A from i-0iStatistic value of (3)iJumping out of the loop until the accumulated value is greater than ItemPointTotalNum RGBThresholdPercent; RGBThreshold ═ (Weight 0+ Weight 1+ … + Weight i)
Step (8), traversing each pixel point of the nth block diagram, if SrcImage [ x ] [ y ] < (RGBThreshold) and DscImage [ x ] [ y ] < 0, otherwise, DscImage [ x ] [ y ] < 255
Step (9), calculating each minimap according to the steps (5) to (8) to obtain the final Dscimage;
step (10), calculating the values of RGBThresholdPercent, ImageRect1 and SamplingInterval parameters through the parameter quality:
RGBThresholdPercent1=0.6+0.15*quality;
ImageRect1=700*quality;
SamplingInterval1=RGBThresholdPercent1*4;
RGBThresholdPercent2=0.45+0.15*quality;
ImageRect2=35/quality;
SamplingInterval2=RGBThresholdPercent2*4;
step (11), performing steps (2) to (9) by using RGBThresholdPercent1, SamplingInterval1 and ImageRect1 to obtain DscImage 1;
performing steps (2) - (9) with RGBThresholdPercent2, SamplingInterval2, ImageRect2 to obtain DsciImage 2;
step (12), sequentially traversing the pixels of the DscImage1 and DscImage2, wherein if DscImage1[ x ] [ y ] is 255, DscImage2[ x ] [ y ] is 255;
and (13) using the traversed DscImage2 to generate a picture.
2. The method for processing under-color-fading and denoising of an image according to claim 1, wherein the block statistics of step (4) is implemented as follows:
the width of the picture is divided into WidthNum parts: (ii) WidthNum ═ ImageWidth/ImageRect + (ImageWidth% ImageRect >01: 0);
the height of the picture is divided into HeightNum parts: height num ═ ImageHeight/ImageRect + (ImageHeight% ImageRect >01: 0);
pictures were divided into ImageNum: ImageNum ═ WidthNum ═ HeightNum.
3. The method as claimed in claim 2, wherein the step (5) of obtaining the region information of the nth block map includes:
the four values of the block are respectively as follows: ItemTop, ItemBottom, ItemLeft, ItemRight:
ItemTop=n/WidthNum*ImageRect;
ItemBottom ═ ItemTop + ImageRect, ItemBottom ═ ImageHeight if ItemBottom > ImageHeight;
ItemLeft=n%WidthNum*ImageRect;
ItemRight ═ ItemLeft + ImageRect, ItemRight ═ ImageWidth if ItemRight > ImageWidth;
the total pixel point ItemPointTotalNum of the block:
ItemPointTotalNum=(ItemRight–ItemLeft+1)*(ItemBottom–ItemTop+1)。
CN201811124180.9A 2018-09-26 2018-09-26 Picture ground color bleeding and denoising processing method Active CN109360164B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811124180.9A CN109360164B (en) 2018-09-26 2018-09-26 Picture ground color bleeding and denoising processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811124180.9A CN109360164B (en) 2018-09-26 2018-09-26 Picture ground color bleeding and denoising processing method

Publications (2)

Publication Number Publication Date
CN109360164A CN109360164A (en) 2019-02-19
CN109360164B true CN109360164B (en) 2021-08-31

Family

ID=65347675

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811124180.9A Active CN109360164B (en) 2018-09-26 2018-09-26 Picture ground color bleeding and denoising processing method

Country Status (1)

Country Link
CN (1) CN109360164B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908330A (en) * 2010-07-26 2010-12-08 武汉大学 Method for display equipment with narrow dynamic range to reproduce image with wide dynamic range
CN102542528A (en) * 2011-12-26 2012-07-04 Tcl集团股份有限公司 Image conversion processing method and system
CN107016392A (en) * 2016-01-27 2017-08-04 四川效率源信息安全技术股份有限公司 A kind of method of text border in removal picture

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9008453B2 (en) * 2012-06-25 2015-04-14 Yissum Research Development Company Of The Hebrew University Of Jerusalem Ltd. Blur-kernel estimation from spectral irregularities

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101908330A (en) * 2010-07-26 2010-12-08 武汉大学 Method for display equipment with narrow dynamic range to reproduce image with wide dynamic range
CN102542528A (en) * 2011-12-26 2012-07-04 Tcl集团股份有限公司 Image conversion processing method and system
CN107016392A (en) * 2016-01-27 2017-08-04 四川效率源信息安全技术股份有限公司 A kind of method of text border in removal picture

Also Published As

Publication number Publication date
CN109360164A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
US11341757B2 (en) Training language models using text corpora comprising realistic optical character recognition (OCR) errors
CN107945125A (en) It is a kind of to merge spectrum estimation method and the fuzzy image processing method of convolutional neural networks
CN109325986B (en) Sketch drawing method and device
CN114418899B (en) Self-adaptive repairing method and system for self-color printing and readable storage medium
CN113505854B (en) Face image quality evaluation model construction method, device, equipment and medium
CN110516554A (en) A kind of more scene multi-font Chinese text detection recognition methods
CN116468640B (en) Video image enhancement method for Internet teaching
CN109191444A (en) Video area based on depth residual error network removes altering detecting method and device
CN110533026A (en) The competing image digitization of electricity based on computer vision and icon information acquisition methods
CN111476744B (en) Underwater image enhancement method based on classification and atmospheric imaging model
CN110909772B (en) High-precision real-time multi-scale dial pointer detection method and system
CN106815814B (en) Image pollution processing method applied to paper marking system
CN107256539B (en) Image sharpening method based on local contrast
CN109360164B (en) Picture ground color bleeding and denoising processing method
CN117333359A (en) Mountain-water painting image super-resolution reconstruction method based on separable convolution network
CN112215781A (en) Improved local binarization method
CN113315995B (en) Method and device for improving video quality, readable storage medium and electronic equipment
Phattarachairawee et al. An algorithm image Enhancement for Segmentation Palm-Leaf Manuscript
CN102685370B (en) De-noising method and device of video sequence
CN113408520B (en) Marking method, marking device and storage medium
CN113610940A (en) Ocean vector file and image channel threshold based coastal area color homogenizing method
CN109886276B (en) Half-word judging method for dial rolling digital character
CN106803238B (en) Answer sheet image noise reduction processing method
CN110060265A (en) A method of divide from painting and calligraphy cultural relic images and extracts seal
CN110532947A (en) A kind of method and apparatus for going colour cast to handle for car test table

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
CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee after: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.

Address before: Room 1406, Hangzhou e-commerce building, 118 Wensan West Road, Xihu District, Hangzhou City, Zhejiang Province, 310013

Patentee before: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.

CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee after: Zhejiang Wanpeng Digital Intelligence Technology Co.,Ltd.

Address before: 12 / F, building 8, No. 19, Jugong Road, Xixing street, Binjiang District, Hangzhou City, Zhejiang Province, 310051

Patentee before: ZHEJIANG WANPENG EDUCATION SCIENCE AND TECHNOLOGY STOCK CO.,LTD.