WO2023046112A1 - 文档图像增强方法、装置及电子设备 - Google Patents

文档图像增强方法、装置及电子设备 Download PDF

Info

Publication number
WO2023046112A1
WO2023046112A1 PCT/CN2022/121051 CN2022121051W WO2023046112A1 WO 2023046112 A1 WO2023046112 A1 WO 2023046112A1 CN 2022121051 W CN2022121051 W CN 2022121051W WO 2023046112 A1 WO2023046112 A1 WO 2023046112A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
background
document
area
background area
Prior art date
Application number
PCT/CN2022/121051
Other languages
English (en)
French (fr)
Inventor
王国志
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2023046112A1 publication Critical patent/WO2023046112A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30176Document

Definitions

  • the present application belongs to the technical field of image processing, and in particular relates to a document image enhancement method, device and electronic equipment.
  • the purpose of the embodiment of the present application is to provide a document image enhancement method, device and electronic equipment to solve the problem of poor scanning flexibility, high scanning cost and scanning based on non-professional scanning equipment in the prior art.
  • the embodiment of the present application provides a document image enhancement method, including:
  • An enhanced document image is generated according to the initial document image and the global background illumination map.
  • the embodiment of the present application provides a document image enhancement device, including:
  • An acquisition module configured to acquire the first background area of the initial document image according to the background area determination condition
  • a first generating module configured to perform image neighborhood analysis on the first background area to generate a local background illumination map
  • the second generation module is used to fill the local background light map with pixels to generate a global background light map
  • a third generating module configured to generate a document enhanced image according to the initial document image and the global background illumination map.
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored in the memory and operable on the processor, and the program or instruction is The processor implements the steps of the method described in the first aspect when executed.
  • an embodiment of the present application provides a readable storage medium, on which a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented .
  • the embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions, so as to implement the first aspect the method described.
  • the embodiment of the present application further provides an apparatus for enhancing a document image, and the apparatus is configured to perform the steps of the method described in the first aspect.
  • the embodiment of the present application provides a computer program product, the computer program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the method described in the first aspect step.
  • the first background area of the initial document image is obtained by determining the conditions according to the background area, and image neighborhood analysis is performed on the basis of the first background area to generate a local background illumination map. Perform pixel filling to generate a global background light map, process the initial document image based on the global background light map, and obtain the final enhanced document image, which can protect the details of the document content while achieving the scanning effect without the need for a scanning device, and can realize Perform image processing quickly to obtain enhanced images for documents.
  • FIG. 1 shows a schematic diagram of a document image enhancement method provided in an embodiment of the present application
  • Figure 2a shows a schematic diagram of identifying the foreground area and the background area in the image provided by the embodiment of the present application
  • Fig. 2b shows the three-channel histogram corresponding to the foreground area provided by the embodiment of the present application
  • Fig. 2c shows the three-channel histogram corresponding to the background area provided by the embodiment of the present application
  • FIG. 3 shows a schematic diagram of comparison of different regions of the initial document image provided by the embodiment of the present application
  • FIG. 4 shows a schematic diagram of a processed document enhanced image provided by an embodiment of the present application
  • FIG. 5 shows a schematic diagram of a document image enhancement device provided by an embodiment of the present application
  • Fig. 6 is one of the schematic block diagrams of the electronic device provided by the embodiment of the present application.
  • FIG. 7 is a second schematic block diagram of an electronic device provided by an embodiment of the present application.
  • the embodiment of the present application provides a document image enhancement method, as shown in FIG. 1, the method includes the following steps:
  • Step 101 Acquire a first background area of an initial document image according to a background area determination condition.
  • the document image enhancement method provided by the embodiment of the present application is applied to an electronic device.
  • the electronic device first uses a camera to capture a presentation or other text content based on a received shooting instruction to obtain an initial document image. After the initial document image is acquired, its corresponding first background area is determined for the initial document image. When determining the first background area of the initial document image, preset background area determination conditions may be used. Based on the background area determination condition, a search is performed in the initial document image to find a first background area.
  • Step 102 Perform image neighborhood analysis on the first background area to generate a local background illumination map.
  • the first background area determined based on the background area determination conditions is not necessarily the real background area
  • image neighborhood analysis is further performed on the basis of the first background area to The idea of the water filling algorithm is to judge the image blocks in the first background area, so as to screen out the local background area on the basis of the first background area, and generate a local background illumination map based on the determined local background area.
  • Step 103 filling the local background illumination map with pixels to generate a global background illumination map.
  • the image filling algorithm can be used to fill the pixels of the local background light map to generate the global background light map.
  • the process of filling the pixels of the local background light map can be understood as filling the non-background area of the local background light map with pixels.
  • the global background light map is generated by filling the pixels of the local background light map, so that the enhanced display of the document content can be performed based on the background light of the global background light map.
  • the local background lighting map and the global background lighting map are generated based on the initial document image, and the local background lighting map and the global background lighting map correspond to the initial document image respectively.
  • Step 104 generate a document enhanced image according to the initial document image and the global background illumination map.
  • the enhancement of the document image is mainly to enhance the brightness of the background area and enhance the contrast of the document content. Since the pixel value of the document area corresponding to the text and pattern of the document image is usually smaller than the pixel value of the background area, it can be based on the global background.
  • the illumination map processes the initial document image to achieve the effect of contrast enhancement between the document area and the background area, that is, the final enhanced document image can be obtained by processing the initial document image with the global background illumination map.
  • the above-mentioned implementation process of the present application obtains the first background area of the initial document image by determining the conditions according to the background area, and performs image neighborhood analysis on the basis of the first background area to generate a local background illumination map, and performs a local background illumination map Pixel filling generates a global background light map, and based on the global background light map, the initial document image is processed to obtain the final enhanced document image, which can protect the details of the document content while achieving the scanning effect without the need for a scanning device, and can achieve fast Perform image processing to obtain document enhanced images.
  • step 101 acquires the first background area of the initial document image according to the background area determination condition, including:
  • a plurality of first image blocks are selected from the preset number of image blocks, the background probability corresponding to at least one single-channel histogram of the first image block is greater than the preset probability value, the background Probability is used to indicate the probability of belonging to the first background region;
  • a first background area is determined according to the first image block.
  • the initial document image can be divided into image blocks, and the initial document image can be divided into a preset number of image blocks with the same size, such as 6 (referring to the number of pixels) )*6 image blocks, or divided into 8*8 image blocks, or 6*8 image blocks, in the embodiment of the present application, the size of the image block is N*N as an example for illustration.
  • the current image block For each image block in the preset number of divided image blocks, determine whether the current image block belongs to the first image block according to the RGB three-channel histogram corresponding to the current image block, and then filter out the first image block from the preset number of image blocks An image block, the first background area is determined based on the filtered first image block.
  • the background probability corresponding to at least one single-channel histogram thereof is greater than a preset probability value, it is determined that the current image block is the first image block.
  • the background probability is used to indicate the probability of belonging to the first background region
  • the background probability corresponding to the single-channel histogram can be understood as: determining the probability that the image block belongs to the first background region based on the single-channel histogram corresponding to the image block.
  • the principle of filtering out the first image block according to the RGB three-channel histogram corresponding to the image block will be described below.
  • the RGB three-channel histogram distribution corresponding to the image block fits a Gaussian distribution, as shown in Figure 2a, there are circular areas (area 1, ie the foreground area) and square areas (area 2, ie the background area) in the image,
  • the RGB three-channel histogram corresponding to area 1 is shown in Figure 2b
  • the RGB three-channel histogram corresponding to area 2 is shown in Figure 2c.
  • the abscissa is the pixel value, and the ordinate is the percentage of the number of pixels . It can be seen from this that the RGB three-channel histogram corresponding to the background area is more in line with the Gaussian distribution, and most of the pixels are gathered near the peak.
  • the detailed definition of the first background area is: for the image block, at least one single-channel histogram in the RGB three-channel histogram, K values around its peak value (the pixel value corresponding to the largest number of pixels)
  • K values around its peak value the pixel value corresponding to the largest number of pixels
  • the ratio of the total number of pixels corresponding to the pixel values within the range to the total number of pixels in the image block needs to be greater than a set value, where the value of K represents the value of the pixel value, and the size of the image block N* N in N has no relationship, and K can be greater than, less than or equal to N.
  • the calculation formula of the background probability of a single-channel histogram (the ratio of the total number of pixels corresponding to the pixel values within the K value range around the peak of the single-channel histogram to the total number of pixel points in the area) is as follows:
  • Pbp is the background probability
  • loc is the abscissa position where the histogram peak is located (the abscissa indicates the pixel value)
  • hist is the histogram corresponding to a single channel
  • hist(i) indicates the ordinate value of the histogram at the i coordinate (the ordinate The coordinate value is the number of pixels)
  • i is the abscissa of the histogram, representing the pixel value.
  • the process of determining the first background area is described below through a specific example.
  • the initial document image is traversed with 6*6 image blocks.
  • the background probability corresponding to the RGB three-channel histogram is calculated separately.
  • For the background probability of the graph first find the peak position (abscissa) of the single-channel histogram, and accumulate and sum the number of pixel points corresponding to the pixel values in the left and right adjacent K value ranges, denoted as S, K
  • S peak position
  • K K
  • the value of is preferably 6, if S/36>0.8 of any single channel, then the image block belongs to the first background area.
  • the above implementation process of the present application divides the initial document image into a preset number of image blocks of the same size, determines the first image block according to the RGB three-channel histogram corresponding to the image block, and determines the first background area according to the first image block, Image block screening may be implemented based on the background probability of the single-channel histogram of the image block, so as to determine the first background region based on the screened image blocks.
  • step 102 performs image neighborhood analysis on the first background area to generate a local background illumination map, including:
  • the first background area determined based on the background area determination conditions is not necessarily the real background area, so after the first background area is determined, based on the first background area, image neighborhood analysis is further performed to generate local background illumination picture. For example, as shown in Fig. 3, both the box 12 and the box 11 meet the conditions of the first background area, but the box 11 and the box 12 do not necessarily all belong to the real background area, so it is necessary to determine the first background area On the basis of the image, the image neighborhood analysis is further carried out to determine the background area.
  • the first background area is determined based on image blocks
  • image block screening can be performed among multiple first image blocks corresponding to the first background area.
  • the second image block is generated to generate a local background light map, based on the first background area, the scope of the background area is reduced, the local background area is obtained, and the local background light map is generated.
  • Two image blocks including:
  • each cache queue includes a second image block filtered out based on the traversal, and the second image blocks in the same cache queue correspond to the same type of background area;
  • the difference of the peak pixel value of the corresponding RGB three-channel histogram is within a preset threshold range.
  • the plurality of first image blocks in the target container can be selected according to preset rules.
  • Image block traversal is performed on the plurality of first image blocks to analyze candidate neighborhood image blocks of the first image blocks. During the traversal process, for the visited first image block, it is detected whether the corresponding candidate neighborhood image block belongs to the first image block in the first background area, and if so, further analysis is performed, otherwise, the candidate neighborhood image block is ignored .
  • the candidate neighborhood image block belonging to the first image block in the first background area access the candidate neighborhood image block to detect whether the candidate neighborhood image block and the currently accessed first image block belong to the same type of background area, if they belong to , the candidate neighborhood image block is determined to be the first neighborhood image block related to the current first image block.
  • the first neighborhood image block that belongs to the same type of background area as the current first image block can be understood as the RGB three-channel histogram corresponding to the current first image block and the RGB three-channel corresponding to the first neighborhood image block
  • the differences in the peak pixel values of the histogram are within a preset threshold.
  • the RGB three-channel histogram corresponding to the current first image block there are three peak pixel values of the RGB three-channel histogram corresponding to the current first image block, which are respectively the peak pixel value of the R channel histogram, the peak pixel value of the G channel histogram, and the peak pixel value of the B channel histogram ;
  • there are three peak pixel values of the RGB three-channel histogram corresponding to the candidate neighborhood image block which are respectively the peak pixel value of the R channel histogram, the peak pixel value of the G channel histogram and the peak value of the B channel histogram Pixel value, when calculating the difference, it is necessary to calculate the difference of the peak pixel value for the same channel, take the largest difference among the three differences as the final difference, and compare it with the preset threshold range, if the final difference is within the preset threshold range, the candidate neighborhood image block is determined to be the first neighborhood image block corresponding to the current first image block.
  • first neighborhood image block For the case that there is a first neighborhood image block among the candidate neighborhood image blocks corresponding to the current first image block, store the first neighborhood image block in the cache queue corresponding to the current first image block, and For each first neighborhood image block, access the corresponding candidate neighborhood image block to detect whether there is a background area that belongs to the first background area and belongs to the same type of background area as the current first neighborhood image block in the corresponding candidate neighborhood image block The second neighborhood image block of .
  • If there is a second neighborhood image block store the second neighborhood image block in the cache queue corresponding to the current first image block, and for each second neighborhood image block, access the corresponding candidate neighborhood image block Whether there is a third neighborhood image block that belongs to the first background area and belongs to the same type of background area as the current second neighborhood image block.
  • the current first image block before accessing the current first image block, it can be put into the first queue, and taken out from the first queue when accessing, and there is a first neighborhood in the candidate neighborhood image block corresponding to the current first image block
  • the first neighborhood image block can be stored in the first queue
  • the first neighborhood image block and the current first image block can be stored in the queue container at the same time
  • a first neighbor image block can be taken out of the first queue domain image block, accessing the corresponding candidate neighborhood image block to detect whether there is a second neighborhood that belongs to the first background area and belongs to the same type of background area as the current first neighborhood image block in the corresponding candidate neighborhood image block Image blocks.
  • the second neighborhood image block is stored in the first queue and in the queue container, and then continues to take out an image block in the first queue (it can be the first neighborhood image block or the first neighborhood image block)
  • Two neighborhood image blocks visit the corresponding candidate neighborhood image blocks to detect whether there is a neighborhood belonging to the first background area and belonging to the same type of background area as the current image block in the candidate neighborhood image blocks corresponding to the current image block Image block (can be the second neighborhood image block or the third neighborhood image block), if it exists, the neighborhood image block accessed will be stored in the first queue, and stored in the queue container at the same time, continuously from the first queue Take out the image block until the first queue is empty and stop. During this process, the adjacent image blocks are continuously stored in the queue container. At this time, the adjacent image blocks in the column container and the current first image block form a cache queue corresponding to the current first image block.
  • the corresponding neighborhood image block can be found for the current first image block, and then the corresponding neighborhood image block can be searched for other unvisited first image blocks, and another cache queue can be formed.
  • the first image block and the corresponding neighborhood image blocks are stored in the queue container.
  • the image blocks in the queue container all come from the target container, and for the current first image block, its corresponding neighborhood image blocks include other image blocks in the target container except the current first image block.
  • the traversal process when continuing to visit other first image blocks in the target container according to preset rules, only the first image blocks that have not been visited may be visited.
  • a cache queue that is, each time the first image block in the target container is reselected for access, a cache queue needs to be rebuilt.
  • the target container may correspond to multiple cache queues, and multiple cache queues are stored in the queue container.
  • each cache queue includes second image blocks filtered out based on the traversal, and the second image blocks are image blocks selected from the first image block corresponding to the first background area.
  • the second image block it includes corresponds to the same type of background area, that is, the difference between the peak pixel values of the RGB three-channel histograms of the two directly related second image blocks is within the preset threshold Within the range, the direct association here is the direct neighborhood relationship of the image block.
  • At least one background area can be obtained, and then the local background area is determined according to the at least one background area.
  • image neighborhood analysis is performed on the basis of the first background area, the scope of the background area is narrowed, and the local background area is obtained, so as to generate a local background illumination map.
  • the process of finding the neighborhood image block corresponding to the first image block is described below through a specific example.
  • For the current first image block access the candidate neighborhood image blocks in the surrounding 8 neighborhoods to detect whether there are candidate neighborhood image blocks in the surrounding 8 neighborhoods that belong to the first background area and are similar to the current first image block Neighborhood image patches belonging to the same type of background region.
  • For the detection of neighborhood image blocks belonging to the same type of background area as the current first image block it is necessary to calculate the RGB three-channel histogram between the current first image block and each candidate neighborhood image block belonging to the first background area Peak pixel value difference, that is, calculate the difference values of peak_r, peak_g, and peak_b of different image blocks. If the peak pixel value difference is within the preset threshold range, the current first image block and the candidate neighborhood image block belong to the same type of background area. At this time, the candidate neighborhood image block is the real neighborhood image block.
  • the specific process is as follows, first define the pixel value difference threshold t, and create a queue queue to traverse the candidate neighborhood image blocks of the 8 neighborhoods of the first image block, create a queue container queue_vector to store the cache queue; sequentially traverse the target container pbv
  • the first image block in the traversal process, firstly add the currently accessed first image block to the queue, take out the current first image block from the queue, and judge its 8 neighbors according to the row and column coordinates of the current first image block Whether there are candidate neighborhood image blocks in the area, and if so, access the candidate neighborhood image blocks in the surrounding 8 neighborhoods to detect whether there are candidate neighborhood image blocks in the surrounding 8 neighborhoods that belong to the first background area and are similar to the current
  • the first image block belongs to the neighborhood image blocks of the same type of background area, that is, calculate the maximum difference value of the peak pixel value of the RGB three-channel histogram of the current first image block and each candidate neighborhood image block (belonging to the first background area) , and compare it with the pixel value
  • i represents the current first image block
  • j represents the candidate neighborhood image block
  • diff represents the maximum difference value. If diff is smaller than the pixel value difference threshold t, it is determined that the current first image block and the candidate neighborhood pixel block belong to the same type of background area, then the candidate neighborhood image block is added to the queue queue, and the current first image block and Candidate neighborhood image blocks are added to the queue container queue_vector. Continuously take out the image blocks in the queue queue queue for neighborhood judgment and store the determined neighborhood pixel blocks in the queue queue. When the queue queue is empty, the search for the neighborhood image blocks of the current first image block ends. , a cache queue can be determined. Continue to traverse other unvisited first image blocks in the target container pbv, and the final result is that the queue container queue_vector contains multiple cache queues.
  • each cache queue corresponds to a connected region in the initial document image, and a local background illumination map is generated according to the second image block, including:
  • a local background illumination map is generated according to the connected region with the largest area in the at least one connected region.
  • the target container may correspond to at least one cache queue, and each cache queue corresponds to a connected region in the initial document image, the initial document image corresponds to at least one connected region.
  • the connected area with the largest area is the local background area. In this way, the areas of these connected areas can be calculated separately and selected The largest area is used as the local background area. For example, the blue connected region with the largest area is determined as the local background region.
  • the area areas of the connected regions can be calculated respectively, and the connected region with the largest area is determined among the multiple connected regions according to the area area, and the connected region with the largest area is determined as the local background area, and then generate a local background light map based on the determined local background area.
  • the local background area When determining the local background area, by using the characteristics of the document image, based on the area of the connected area, select the connected area with the largest area among multiple connected areas, which can quickly determine the local background area based on the area parameter. After determining the local background area , the local background light map can be generated according to the local background area.
  • the first background area is determined, the first image block in the first background area is traversed, and the neighboring image blocks are searched to determine at least one connected area. Based on the characteristics of the document image, the determined Finding the connected region with the largest area in at least one connected region to determine the local background region on the basis of the first background region, the local background region can be determined quickly and accurately, and then the local background illumination map can be generated.
  • step 103 performs pixel filling on the local background light map to generate a global background light map, including: determining the filling edge line of the area to be filled for the local background light map; determining the pixel points to be filled according to the filling edge line, And fill the pixels to be filled; update the filling edge line several times, and re-determine the pixels to be filled after each update until the filling of all the pixels to be filled is completed.
  • the local background light map can be filled with pixels to generate the global background light map.
  • the filling edge line of the area to be filled may be determined for the local background light map, and the pixel points to be filled are determined based on the filling edge line, and then the determined pixel points to be filled are filled. And after completing a filling, it is necessary to update the filling edge line, and then re-determine the pixels to be filled for filling.
  • the filling edge line continues to advance inward, that is, it is understood that the area corresponding to the filling edge line continues to expand. zoom out.
  • the local background illumination map obtain its corresponding mask mask image 1, expand the mask image 1 to obtain mask image 2, and subtract mask image 1 from mask image 2 to obtain the filled edge line .
  • the local background light map based on each edge pixel on the filled edge line, find the pixel to be filled that is closest to the edge pixel for filling.
  • the filling formula is as follows:
  • p represents the pixel point to be filled
  • I(p) represents the pixel value of the pixel point to be filled
  • B ⁇ is the neighborhood area of pixel point p
  • q is a certain pixel point in the neighborhood area of pixel point p
  • I (q) is the pixel value of pixel point q
  • (pq) is the coordinate difference between pixel p and pixel q (in vector form)
  • w(p, q) is used to calculate the contribution weight of each pixel in the neighborhood to be filled
  • w(p, q) is calculated as follows:
  • ⁇ p-q ⁇ refers to the distance between two pixels of pq
  • N(p) refers to the normal vector of point p
  • T(p) refers to the distance between point p and the edge pixel point (filling the pixel point on the edge line )
  • T(q) is the distance between point q and the edge pixel.
  • Filling of the pixels to be filled is realized based on the above filling formula. After completing a filling, re-determine the mask image 1, and then perform expansion to determine the mask image 2. Due to the pixel point filling, the determined mask image 1 is different from the last determined mask image 1, and then based on the newly determined Mask Figure 2 and mask Figure 1, the obtained filling edge line is different from the previous filling edge line. At this point, you can continue to determine the pixels to be filled to fill the pixels, and after completion, repeat the process of determining the mask image 1 and mask image 2, determining the filling edge line, and filling the pixels until all the pixels to be filled are completed. The padding of points to generate the global background illumination map.
  • the pixel points are filled on the basis of the local background light map, so as to realize the pixel point filling of the non-background light area, and then the global background light map can be generated, so that Enhanced display of document content based on the background lighting of the global background lighting map.
  • step 104 according to the initial document image and the global background illumination map, generates the enhanced document image, including: obtaining the first pixel values respectively corresponding to the first pixel points of the global background illumination map;
  • a document-enhanced image is generated based on the updated pixel values of the background area and the updated pixel values of the document area.
  • the initial document image corresponds to the global background light map, and the size and resolution of the initial document image and the global background light map are the same.
  • the first pixel values corresponding to each first pixel can be obtained for the global background illumination map, and the first pixel value is a certain pixel in the first range Value, such as the first range: [ ⁇ -y, ⁇ +y].
  • the second pixel values corresponding to the second pixel points where the second pixel value is a certain pixel value in the second range, for example, the second range is [ ⁇ -x, ⁇ + x].
  • the third pixel value corresponding to each third pixel point wherein the third pixel value is a certain pixel value in the third range, for example, the third range is [ ⁇ -t, ⁇ + t].
  • ⁇ and ⁇ are arbitrary constant values, and because the text pixel value in the document image is usually much smaller than the background pixel value, so 255> ⁇ >> ⁇ ; and because the pixel values of each point in the image are not exactly the same, so use t, x , y represent pixel fluctuation values, which are much smaller than ⁇ and ⁇ and x ⁇ y.
  • the pixel values of the background area and the pixel values of the document area in the enhanced document image it is necessary to determine the pixel value of the background area in the enhanced document image.
  • the pixel value of the background area in the enhanced document image it is necessary to determine the corresponding first pixel points in the global background illumination map for each second pixel point in the background area of the initial document image, and calculate the respective second pixel points Corresponding second pixel values (the second pixel values can be the same or different) and the first ratios of the first pixel values corresponding to the corresponding first pixel points respectively, to obtain a plurality of first ratios (the number of first ratios is the number of second pixels in the background area of the initial document image).
  • the updated pixel value of the background area of the initial document image that is, the pixel value of the background area in the enhanced document image.
  • the value range of the target pixel value may be 240 to 255, preferably 255 in the embodiment of the present application, so as to achieve a good enhancement effect.
  • the second ratio of the corresponding third pixel value (each third pixel value can be the same or different) and the first pixel value corresponding to each corresponding first pixel point respectively, to obtain a plurality of second ratios (the number of second ratios is the number of third pixels in the document area of the initial document image).
  • the updated pixel value of the document area of the initial document image that is, the pixel value of the document area in the enhanced document image is obtained.
  • the document enhanced image can be generated according to the updated pixel values of the background area and the updated pixel values of the document area, that is, the updated update the pixel values of the background area of the original document image, and update the pixel values of the document area of the original document image according to the updated pixel values of the determined document area, so as to generate the enhanced document image. That is, according to the initial document image and the global background illumination map, the process of generating a document enhanced image can be understood as: divide the pixel value of the initial document image by the pixel value of the global background illumination map, and multiply it by the target pixel value to obtain the document Enhances the pixel values of an image.
  • the above process is described below through a specific example, assuming that the pixel value of any pixel in the background area of the initial document image is ⁇ ij , and its range is [ ⁇ -x, ⁇ +x], the pixel of any pixel in the non-background area The value is ⁇ ij , and its range is [ ⁇ -t, ⁇ +t].
  • the pixel value of any pixel in the global background light map is l ij , and its pixel value range is [ ⁇ -y, ⁇ +y], where i , j stands for row and column number.
  • R ij and T ij is calculated as follows:
  • R ij By adjusting the gain coefficient ⁇ , R ij can be made closer to 255, reducing the existence of noise.
  • a gamma transformation can be performed on the document enhanced image I, wherein the value of the gamma factor ⁇ can be 1.5, and the transformation form can be:
  • I/255 is the ratio of the pixel value of the pixel point in the document enhanced image to 255.
  • the above implementation process of the present application can determine the pixel values corresponding to the background area and the document area in the enhanced document image according to the pixel values of the pixels in the global background illumination map and the pixel values of the background area and the document area of the initial document image , and then realize the generation of document enhancement image based on the global background illumination map and the initial document image; and the existence of noise in the image can be reduced by adjusting the gain coefficient, and the contrast between the background in the image and the content of the document can be made more vivid by transforming the image.
  • the document image enhancement method provided in the embodiment of the present application can realize the effect of scanning enhancement without the help of professional scanning equipment, and can well protect color patterns and details. It can not only scan documents containing text, but also scan hand-painted documents, etc. At the same time, the scanning speed is fast (for example, according to the test, it only takes 80ms to process an image with a resolution of 4000x3000), and the running memory occupies less, which improves the user's scanning experience.
  • the image neighborhood analysis is performed on the basis of the first background area to generate Local background light map, fill the local background light map with pixels to generate a global background light map, process the initial document image based on the global background light map, and obtain the final enhanced document image, which can achieve the scanning effect without the need for scanning equipment , to protect the details of the document content, and can realize rapid image processing and obtain enhanced document images.
  • the first background area can be determined based on the screened image block; after obtaining the first background area, based on the first background area, zoom out The range of the background area can generate a local background light map; after generating the local background light map, fill the pixels on the basis of the local background light map to fill the non-background light area, and then generate a global background light Figure; After generating the global background illumination map, determine the pixel values corresponding to the background area and the document area in the document enhancement image based on the global background illumination map and the pixel value information of the initial document image, and then realize the global background illumination map and the initial document image.
  • a document enhancement image is generated to realize the enhanced display of the document content based on the background illumination of the global background illumination map.
  • the embodiment of the present application also provides a document image enhancement device, as shown in FIG. 5 , including:
  • An acquisition module 501 configured to acquire the first background area of the initial document image according to the background area determination condition
  • the first generation module 502 is configured to perform image neighborhood analysis on the first background area to generate a local background illumination map
  • the second generating module 503 is configured to fill the local background illumination map with pixels to generate a global background illumination map
  • the third generation module 504 is configured to generate a document enhanced image according to the initial document image and the global background illumination map.
  • the acquisition module includes:
  • a division sub-module configured to divide the initial document image into a preset number of image blocks of the same size
  • the first screening submodule is used to filter out a plurality of first image blocks from the preset number of image blocks according to the RGB three-channel histogram corresponding to the image block, and at least one single image block of the first image block
  • the background probability corresponding to the channel histogram is greater than a preset probability value, and the background probability is used to indicate the probability belonging to the first background region;
  • the first determining submodule is configured to determine the first background area according to the first image block.
  • the first generation module includes:
  • the second screening submodule is configured to perform image neighborhood analysis on the first image block in the first background area, and select a second image block from a plurality of the first image blocks;
  • the first generation submodule is configured to generate the local background illumination map according to the second image block.
  • the second screening submodule includes:
  • a traversal unit configured to traverse a plurality of the first image blocks according to preset rules, so as to analyze neighboring image blocks of the first image block;
  • a first determination unit configured to determine at least one cache queue according to the traversal result, each of the cache queues includes the second image block filtered out based on the traversal, and the second image block in the same cache queue Corresponding to the same type of background area;
  • the difference of the peak pixel values of the corresponding RGB three-channel histograms of the two second image blocks that are directly related and belong to the same type of background area is within a preset threshold range.
  • each of the cache queues corresponds to a connected region in the initial document image
  • the first generating submodule includes:
  • a second determining unit configured to determine at least one connected area according to the at least one buffer queue
  • a generating unit configured to generate the local background illumination map according to the connected region with the largest area in the at least one connected region.
  • the second generation module includes:
  • the second determination submodule is used to determine the filling edge line of the area to be filled with respect to the local background light map
  • the processing sub-module is configured to perform multiple updates on the filling edge line, and re-determine the pixel points to be filled for filling after each update, until the filling of all the pixel points to be filled is completed.
  • the third generation module includes:
  • the first acquisition sub-module is configured to acquire the first pixel values corresponding to the first pixel points of the global background illumination map
  • the second obtaining sub-module is used to obtain the second pixel values corresponding to the second pixels in the background area of the initial document image, and the third pixel values corresponding to the third pixels in the document area of the initial document image. Pixel values;
  • the first calculation and determination sub-module is used to calculate the first ratio of the second pixel value corresponding to each of the second pixel points to the first pixel value corresponding to each of the first pixel points, according to each of the The product of the first ratio and the target pixel value determines the updated pixel value of the background area of the initial document image;
  • the second calculation and determination sub-module is used to calculate the second ratio of the third pixel value corresponding to each of the third pixel points to the first pixel value corresponding to each of the first pixel points, according to each of the The product of the second ratio and the target pixel value determines the updated pixel value of the document region of the initial document image;
  • the second generating submodule is configured to generate the enhanced document image according to the updated pixel values of the background area and the updated pixel values of the document area.
  • the above is the document image enhancement device provided by the embodiment of the present application, by obtaining the first background area of the initial document image according to the determination conditions of the background area, and performing image neighborhood analysis on the basis of the first background area to generate a local background illumination map , fill the local background light map with pixels to generate a global background light map, process the initial document image based on the global background light map, and obtain the final enhanced document image, which can protect the content of the document while achieving the scanning effect without the need for a scanning device details, and can achieve rapid image processing to obtain document enhanced images.
  • the first background area can be determined based on the screened image block; after obtaining the first background area, based on the first background area, zoom out The range of the background area can generate a local background light map; after generating the local background light map, fill the pixels on the basis of the local background light map to fill the non-background light area, and then generate a global background light Figure; After generating the global background illumination map, determine the pixel values corresponding to the background area and the document area in the document enhancement image based on the global background illumination map and the pixel value information of the initial document image, and then realize the global background illumination map and the initial document image.
  • a document enhancement image is generated to realize the enhanced display of the document content based on the background illumination of the global background illumination map.
  • the document image enhancement device in the embodiment of the present application may be a device, or may be a component, an integrated circuit or a chip in a terminal.
  • the device may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant).
  • non-mobile electronic devices can be servers, network attached storage (Network Attached Storage, NAS), personal computer (personal computer, PC), television (television, TV), teller machine or self-service machine, etc., this application Examples are not specifically limited.
  • Network Attached Storage NAS
  • personal computer personal computer, PC
  • television television
  • teller machine or self-service machine etc.
  • the document image enhancement device in the embodiment of the present application may be a device with an operating system.
  • the operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in this embodiment of the present application.
  • the document image enhancement device provided in the embodiment of the present application can realize various processes implemented in the embodiment of the document image enhancement method shown in FIG. 1 , and details are not repeated here to avoid repetition.
  • the embodiment of the present application further provides an electronic device 600, including a processor 601, a memory 602, and programs or instructions stored in the memory 602 and operable on the processor 601,
  • an electronic device 600 including a processor 601, a memory 602, and programs or instructions stored in the memory 602 and operable on the processor 601
  • the program or instruction is executed by the processor 601
  • each process of the above-mentioned embodiment of the document image enhancement method can be realized, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 7 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 700 includes but is not limited to: a radio frequency unit 701, a network module 702, an audio output unit 703, an input unit 704, a sensor 705, a display unit 706, a user input unit 707, an interface unit 708, a memory 709 and a processor 710, etc. .
  • the electronic device 700 can also include a power supply (such as a battery) for supplying power to various components, and the power supply can be logically connected to the processor 710 through the power management system, so as to manage charging, discharging and power consumption through the power management system. Management and other functions.
  • a power supply such as a battery
  • the structure of the electronic device shown in FIG. 7 does not constitute a limitation to the electronic device.
  • the electronic device may include more or fewer components than shown in the figure, or combine some components, or arrange different components, and details will not be repeated here. .
  • the processor 710 is configured to: acquire the first background area of the initial document image according to the background area determination condition; perform image neighborhood analysis on the first background area to generate a local background illumination map; Perform pixel point filling to generate a global background illumination map; generate a document enhanced image according to the initial document image and the global background illumination map.
  • the processor 710 when acquiring the first background area of the initial document image according to the background area determination condition, is further configured to perform the following steps: divide the initial document image into a preset number of image blocks of the same size; According to the RGB three-channel histogram corresponding to the image block, a plurality of first image blocks are selected from the preset number of image blocks, and the background probability corresponding to at least one single-channel histogram of the first image block is greater than A preset probability value, the background probability is used to indicate the probability of belonging to the first background area; the first background area is determined according to the first image block.
  • the processor 710 when performing image neighborhood analysis on the first background area to generate a local background illumination map, is further configured to perform the following steps: perform the following steps on the first image block in the first background area Image neighborhood analysis, selecting a second image block from a plurality of first image blocks; generating the local background illumination map according to the second image block.
  • the processor 710 further uses The following steps are performed: according to preset rules, traversing a plurality of the first image blocks to analyze the neighboring image blocks of the first image block; determining at least one cache queue according to the traversal result, each of the cache The queue includes the second image blocks filtered out based on traversal, and the second image blocks in the same cache queue correspond to the same type of background area; wherein, two of the same type of background area have a direct association relationship For the second image block, the difference of the peak pixel value of the corresponding RGB three-channel histogram is within a preset threshold range.
  • each cache queue corresponds to a connected region in the initial document image
  • the processor 710 is further configured to perform the following steps : Determine at least one connected region according to the at least one cache queue; generate the local background illumination map according to the connected region with the largest area in the at least one connected region.
  • the processor 710 when performing pixel filling on the local background light map to generate the global background light map, is further configured to perform the following step: for the local background light map, determine the filling edge line of the region to be filled ; Determine the pixel points to be filled according to the filling edge line, and fill the pixel points to be filled; update the filling edge line multiple times, and re-determine the pixel points to be filled after each update Filling is performed until the filling of all the pixels to be filled is completed.
  • the processor 710 when generating the enhanced document image according to the initial document image and the global background illumination map, is further configured to perform the following step: obtain the corresponding first pixels of the global background illumination map respectively the first pixel value of the initial document image; obtain the second pixel values respectively corresponding to the second pixel points of the background area of the initial document image, and the third pixel values corresponding to the third pixel points of the document area of the initial document image respectively ; Calculate the first ratio of the second pixel value corresponding to each of the second pixel points and the corresponding first pixel value corresponding to each of the first pixel points, according to the ratio of each of the first ratio and the target pixel value The product determines the updated pixel value of the background area of the initial document image; calculates the third pixel value corresponding to each of the third pixel points and the first pixel value corresponding to each of the corresponding first pixel points.
  • Two ratios determining the updated pixel value of the document area of the initial document image according to the product of each second ratio and the target pixel value; according to the updated pixel value of the background area and the updated document area
  • the pixel values of generating the enhanced image of the document.
  • the first background area of the initial document image is obtained, and on the basis of the first background area, image neighborhood analysis is performed to generate a local background illumination map, and the local background illumination map is filled with pixels to generate
  • the global background illumination map processes the initial document image based on the global background illumination map to obtain the final document enhancement image, which can protect the details of the document content without using a scanning device to achieve the scanning effect, and can realize rapid image processing. Get document augmented image.
  • the first background area can be determined based on the screened image block; after obtaining the first background area, based on the first background area, zoom out The range of the background area can generate a local background light map; after generating the local background light map, fill the pixels on the basis of the local background light map to fill the non-background light area, and then generate a global background light Figure; After generating the global background illumination map, determine the pixel values corresponding to the background area and the document area in the document enhancement image based on the global background illumination map and the pixel value information of the initial document image, and then realize the global background illumination map and the initial document image.
  • a document enhancement image is generated to realize the enhanced display of the document content based on the background illumination of the global background illumination map.
  • the input unit 704 may include a graphics processor (Graphics Processing Unit, GPU) 7041 and a microphone 7042, and the graphics processor 7041 is used by the image capture device in the video capture mode or the image capture mode (such as a camera) to process the image data of still pictures or videos.
  • the display unit 706 may include a display panel 7061, and the display panel 7061 may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 707 includes a touch panel 7071 and other input devices 7072 .
  • the touch panel 7071 is also called a touch screen.
  • the touch panel 7071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 7072 may include, but are not limited to, physical keyboards, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • Memory 709 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 710 may integrate an application processor and a modem processor, wherein the application processor mainly processes operating systems, user pages, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the foregoing modem processor may not be integrated into the processor 710 .
  • the embodiment of the present application also provides a readable storage medium, the readable storage medium stores a program or an instruction, and when the program or instruction is executed by a processor, each process of the above-mentioned embodiment of the document image enhancement method is realized, and can achieve The same technical effects are not repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiments.
  • the readable storage medium includes computer readable storage medium, such as computer read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • the embodiment of the present application further provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the above embodiment of the document image enhancement method Each process, and can achieve the same technical effect, in order to avoid repetition, will not repeat them here.
  • chips mentioned in the embodiments of the present application may also be called system-on-chip, system-on-chip, system-on-a-chip, or system-on-a-chip.
  • the embodiment of the present application also provides a document image enhancement device, which is configured to execute the processes of the above-mentioned document image enhancement method embodiments, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
  • the embodiment of the present application also provides a computer program product, the computer program product is stored in a non-volatile storage medium, and the program product is executed by at least one processor to implement the various processes in the above embodiment of the document image enhancement method, and The same technical effect can be achieved, so in order to avoid repetition, details will not be repeated here.
  • the term “comprising”, “comprising” or any other variation thereof is intended to cover a non-exclusive inclusion such that a process, method, article or apparatus comprising a set of elements includes not only those elements, It also includes other elements not expressly listed, or elements inherent in the process, method, article, or device. Without further limitations, an element defined by the phrase “comprising a " does not preclude the presence of additional identical elements in the process, method, article, or apparatus comprising that element.
  • the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved. Functions are performed, for example, the described methods may be performed in an order different from that described, and various steps may also be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种文档图像增强方法、装置及电子设备,涉及图像处理技术领域。文档图像增强方法包括:根据背景区域确定条件,获取初始文档图像的第一背景区域;对所述第一背景区域进行图像邻域分析,生成局部背景光照图;对所述局部背景光照图进行像素点填充,生成全局背景光照图;根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。

Description

文档图像增强方法、装置及电子设备
相关申请的交叉引用
本申请要求在2021年09月26日提交中国专利局、申请号为202111131930.7、名称为“文档图像增强方法、装置及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于图像处理技术领域,具体涉及一种文档图像增强方法、装置及电子设备。
背景技术
随着移动互联网的不断发展,图像作为媒介进行传播成为了工作及生活的日常,越来越多的工作通过电子设备进行,对文档扫描的需求也随之增加,职场办公时经常需要将一堆纸质文件进行扫描后存档或发送。
采用专业的扫描设备可以达到较好的扫描效果,但是扫描设备体积大、扫描灵活性差,成本高。在采用非专业扫描设备进行扫描时,侧重于文档图像的二值化,无法有效保留彩色图像和文档细节,扫描效果不佳。
由此可见,在采用专业扫描设备进行扫描时存在扫描灵活性差、扫描成本高的弊端,在采用非专业扫描设备进行扫描时存在无法达到良好的扫描效果的弊端。
发明内容
本申请实施例的目的是提供一种文档图像增强方法、装置及电子设备,以解决现有技术中基于专业设备进行扫描时存在的扫描灵活性差、扫描成本高,以及基于非专业扫描设备进行扫描时存在的扫描效果不佳的问题。
第一方面,本申请实施例提供了一种文档图像增强方法,包括:
根据背景区域确定条件,获取初始文档图像的第一背景区域;
对所述第一背景区域进行图像邻域分析,生成局部背景光照图;
对所述局部背景光照图进行像素点填充,生成全局背景光照图;
根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
第二方面,本申请实施例提供了一种文档图像增强装置,包括:
获取模块,用于根据背景区域确定条件,获取初始文档图像的第一背景区域;
第一生成模块,用于对所述第一背景区域进行图像邻域分析,生成局部背景光照图;
第二生成模块,用于对所述局部背景光照图进行像素点填充,生成全局背景光照图;
第三生成模块,用于根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,本申请实施例还提供一种文档图像增强装置,所述装置被配置为用于执行如第一方面所述的方法的步骤。
第七方面,本申请实施例提供一种计算机程序产品,所述计算机程序产品被存储在非易失的存储介质中,程序产品被至少一个处理器执行以实现如第一方面所述的方法的步骤。
在本申请实施例中,通过根据背景区域确定条件,获取初始文档图像的 第一背景区域,在第一背景区域的基础上,进行图像邻域分析,生成局部背景光照图,对局部背景光照图进行像素点填充生成全局背景光照图,基于全局背景光照图对初始文档图像进行处理,获得最终的文档增强图像,可以在无需借助扫描设备达到扫描效果的同时,保护文档内容的细节,且可以实现快速进行图像处理,获取文档增强图像。
附图说明
图1表示本申请实施例提供的文档图像增强方法的示意图;
图2a表示本申请实施例提供的图像中标识前景区域和背景区域的示意图;
图2b表示本申请实施例提供的前景区域对应的三通道直方图;
图2c表示本申请实施例提供的背景区域对应的三通道直方图;
图3表示本申请实施例提供的初始文档图像不同区域的比对示意图;
图4表示本申请实施例提供的处理后的文档增强图像的示意图;
图5表示本申请实施例提供的文档图像增强装置的示意图;
图6是本申请实施例提供的电子设备的示意框图之一;
图7是本申请实施例提供的电子设备的示意框图之二。
具体实施例
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为 一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的文档图像增强方法进行详细地说明。
本申请实施例提供一种文档图像增强方法,参见图1所示,该方法包括如下步骤:
步骤101、根据背景区域确定条件,获取初始文档图像的第一背景区域。
本申请实施例提供的文档图像增强方法应用于电子设备,电子设备首先基于接收到的拍摄指令,利用摄像头对演示文稿或者其他文本内容进行拍摄以获取初始文档图像。在获取初始文档图像之后,针对初始文档图像确定其对应的第一背景区域。在确定初始文档图像的第一背景区域时,可以利用预设的背景区域确定条件。基于背景区域确定条件,在初始文档图像中进行搜索,以查找第一背景区域。
步骤102、对第一背景区域进行图像邻域分析,生成局部背景光照图。
由于基于背景区域确定条件所确定的第一背景区域并不一定是真正的背景区域,因此在确定第一背景区域之后,在第一背景区域的基础上,进一步进行图像邻域分析,以基于漫水填充算法的思想,对第一背景区域中的图像块进行判断,从而在第一背景区域的基础上筛选出局部背景区域,基于确定的局部背景区域生成局部背景光照图。
步骤103、对局部背景光照图进行像素点填充,生成全局背景光照图。
在生成局部背景光照图之后,可以通过图像填充算法,对局部背景光照图进行像素点填充,以生成全局背景光照图。其中,对局部背景光照图进行像素点填充的过程可以理解为对局部背景光照图中的非背景区域进行像素点填充。通过对局部背景光照图进行像素点填充以生成全局背景光照图,以便于可基于全局背景图光照图的背景光照进行文档内容的增强显示。局部背景光照图、全局背景光照图基于初始文档图像生成,局部背景光照图、全局 背景光照图分别与初始文档图像对应。
步骤104、根据初始文档图像和全局背景光照图,生成文档增强图像。
在生成全局背景光照图之后,基于所生成的全局背景光照图以及初始文档图像进行图像处理,生成文档增强图像。其中,进行文档图像的增强主要是为了提升背景区域的亮度,增强文档内容的对比度,由于文档图像的文字及图案所对应的文档区域的像素值通常小于背景区域的像素值,因此可以基于全局背景光照图对初始文档图像进行处理,达到文档区域和背景区域对比增强的效果,即,采用全局背景光照图处理初始文档图像,便可以获得最终的文档增强图像。
本申请上述实施过程,通过根据背景区域确定条件,获取初始文档图像的第一背景区域,在第一背景区域的基础上,进行图像邻域分析,生成局部背景光照图,对局部背景光照图进行像素点填充生成全局背景光照图,基于全局背景光照图对初始文档图像进行处理,获得最终的文档增强图像,可以在无需借助扫描设备达到扫描效果的同时,保护文档内容的细节,且可以实现快速进行图像处理,获取文档增强图像。
可选地,步骤101根据背景区域确定条件,获取初始文档图像的第一背景区域,包括:
将初始文档图像划分为预设数目个尺寸相同的图像块;
根据图像块对应的RGB三通道直方图,在预设数目个图像块中筛选出多个第一图像块,第一图像块的至少一个单通道直方图对应的背景概率大于预设概率值,背景概率用于指示属于第一背景区域的概率;
根据第一图像块确定第一背景区域。
在获取初始文档图像的第一背景区域时,可以针对初始文档图像进行图像块的划分,将初始文档图像划分为预设数目个尺寸相同的图像块,如划分为6(指代像素点个数)*6的图像块,或者,划分为8*8的图像块,或者6*8的图像块,本申请实施例中以图像块的尺寸为N*N为例进行阐述。
针对划分的预设数目个图像块中的每一个图像块,根据当前图像块对应 的RGB三通道直方图确定当前图像块是否属于第一图像块,进而在预设数目个图像块中筛选出第一图像块,基于筛选出的第一图像块确定出第一背景区域。
针对任意一图像块而言,若其至少一个单通道直方图对应的背景概率大于预设概率值,则确定当前图像块为第一图像块。其中,背景概率用于指示属于第一背景区域的概率,单通道直方图对应的背景概率可以理解为:基于图像块对应的单通道直方图确定图像块属于第一背景区域的概率。
下面对根据图像块对应的RGB三通道直方图筛选出第一图像块的原理进行阐述。针对一个图像块,如果所有像素点都汇集在一个小像素值范围内,那么该图像块就属于第一背景区域。如,该图像块对应的RGB三通道直方图分布拟合高斯分布,参见图2a所示,图像中存在圆形区域(区域1,即前景区域)以及方形区域(区域2,即背景区域),区域1对应的RGB三通道直方图参见图2b所示,区域2对应的RGB三通道直方图参见图2c所示,图2b以及图2c中,横坐标为像素值,纵坐标为像素个数百分比。由此可见看出,背景区域对应的RGB三通道直方图更加符合高斯分布,并且峰值附近汇集了绝大部分像素点。
因此,第一背景区域的详细定义为:针对图像块而言,RGB三通道直方图中的至少一个单通道直方图,其峰值(对应的像素点个数最多的像素值)附近左右K个数值范围内的像素值所对应的像素点个数总数与图像块的区域像素点总数的比值需要大于一设定数值,其中,K的取值代表像素值的取值,与图像块的尺寸N*N中的N无关联关系,K可以大于、小于或者等于N。单通道直方图的背景概率(单通道直方图峰值附近左右K个数值范围内的像素值所对应的像素点个数总数与区域像素点总数的比值)的计算公式如下:
Figure PCTCN2022121051-appb-000001
其中,Pbp是背景概率,loc为直方图峰值所在的横坐标位置(横坐标表 示像素值),hist是单通道对应的直方图,hist(i)表示直方图位于i坐标的纵坐标值(纵坐标值为像素点个数),i是直方图的横坐标,表示像素值。如果任何一个单通道直方图的背景概率Pbp大于一设定数值,如0.8,那么该图像块就被视为第一图像块,即该图像块属于第一背景区域。这里的设定数值即为背景概率。
下面通过一具体实例对确定第一背景区域的过程进行阐述,以6*6图像块遍历初始文档图像,针对每个图像块,分别计算RGB三通道直方图对应的背景概率,在计算单通道直方图的背景概率时,首先找到单通道直方图的峰值位置(横坐标),并对左右相邻K个数值范围内的像素值所对应的像素点个数进行累加求和,记为S,K的取值优选为6,如果任意单通道的S/36>0.8,那么该图像块属于第一背景区域。
本申请上述实施过程,通过将初始文档图像划分为预设数目个尺寸相同的图像块,根据图像块对应的RGB三通道直方图确定第一图像块,根据第一图像块确定第一背景区域,可以实现基于图像块的单通道直方图的背景概率进行图像块筛选,以基于筛选出的图像块确定第一背景区域。
在确定第一图像块之后,定义表征第一图像块的结构体pb:pb={x,y,peak_r,peak_g,peak_b},其中x、y指的是该图像块的位置,peak_r、peak_g、peak_b指的是三通道直方图峰值的横坐标,即表示该图像块的像素值都集中在peak_r、peak_g、peak_b附近;创建一个存放第一图像块的目标容器(pbv),以存放第一图像块的结构体。通过创建目标容器存放第一图像块的相关信息,便于后续基于目标容器中的第一图像块生成局部背景光照图。
可选地,步骤102对第一背景区域进行图像邻域分析,生成局部背景光照图,包括:
对第一背景区域内的第一图像块进行图像邻域分析,在多个第一图像块中筛选出第二图像块;
根据第二图像块,生成局部背景光照图。
基于背景区域确定条件所确定的第一背景区域并不一定是真正的背景 区域,因此在确定第一背景区域之后,在第一背景区域的基础上,进一步进行图像邻域分析以生成局部背景光照图。例如,见图3所示,方框12以及方框11均满足第一背景区域的条件,但是方框11以及方框12并不一定都属于真正的背景区域,因此需要在确定第一背景区域的基础上,进一步进行图像邻域分析以确定背景区域。
由于第一背景区域基于图像块确定,在对第一背景区域进行图像邻域分析生成局部背景光照图时,可以在第一背景区域对应的多个第一图像块中进行图像块筛选,根据筛选出的第二图像块生成局部背景光照图,实现以第一背景区域为基础,缩小背景区域的范围,获取局部背景区域,生成局部背景光照图。
下面对在多个第一图像块中筛选出第二图像块的过程进行阐述,对第一背景区域内的第一图像块进行图像邻域分析,在多个第一图像块中筛选出第二图像块,包括:
按照预设规则,对多个第一图像块进行遍历,以分析第一图像块的邻域图像块;
根据遍历结果确定至少一个缓存队列,每个缓存队列包括基于遍历筛选出的第二图像块,且同一个缓存队列中的第二图像块对应于同一类型背景区域;
其中,属于同一类型背景区域的两个具有直接关联关系的第二图像块,对应的RGB三通道直方图的峰值像素值差异在预设阈值范围内。
在第一背景区域对应的多个第一图像块中筛选出第二图像块时,可以针对目标容器(存放第一图像块的容器)中的多个第一图像块,按照预设规则,对多个第一图像块进行图像块遍历,以分析第一图像块的候选邻域图像块。在遍历过程中,针对访问到的第一图像块,检测其对应的候选邻域图像块是否属于第一背景区域中的第一图像块,若属于,则进一步分析,否则忽略候选邻域图像块。针对属于第一背景区域中的第一图像块的候选邻域图像块,访问候选邻域图像块,以检测候选邻域图像块与当前访问的第一图像块是否 属于同一类型背景区域,若属于,则确定候选邻域图像块为当前第一图像块相关的第一邻域图像块。
与当前第一图像块属于同一类型背景区域的第一邻域图像块,可以理解为当前第一图像块对应的RGB三通道直方图的峰值像素值与第一邻域图像块对应的RGB三通道直方图的峰值像素值的差异在预设阈值范围内。其中,当前第一图像块对应的RGB三通道直方图的峰值像素值为三个,分别为R通道直方图的峰值像素值、G通道直方图的峰值像素值以及B通道直方图的峰值像素值;相应的,候选邻域图像块对应的RGB三通道直方图的峰值像素值为三个,分别为R通道直方图的峰值像素值、G通道直方图的峰值像素值以及B通道直方图的峰值像素值,在计算差异时,需要针对相同的通道,计算峰值像素值的差异,在三个差异中取最大的差异作为最终差异,并与预设阈值范围进行比较,若最终差异在预设阈值范围内,则确定候选邻域图像块为当前第一图像块对应的第一邻域图像块。
针对当前第一图像块对应的候选邻域图像块中存在第一邻域图像块的情况,将第一邻域图像块存入当前第一图像块对应的缓存队列中,并针对缓存队列中的每个第一邻域图像块,访问对应的候选邻域图像块,以检测对应的候选邻域图像块中是否存在属于第一背景区域、且与当前第一邻域图像块属于同一类型背景区域的第二邻域图像块。
若存在第二邻域图像块,则将第二邻域图像块存入当前第一图像块对应的缓存队列中,并针对每个第二邻域图像块,访问对应的候选邻域图像块中是否存在属于第一背景区域、且与当前第二邻域图像块属于同一类型背景区域的第三邻域图像块。
依次执行上述过程,直至完成对当前第一图像块对应的缓存队列中的全部邻域图像块(可以包括第一邻域图像块、第二邻域图像块、第三邻域图像块以及继续访问所得到的其他邻域图像块)的访问,至此完成了与当前第一图像块关联的全部邻域图像块的查找。
其中,在访问当前第一图像块之前,可以将其放入第一队列中,在访问 时从第一队列中取出,针对当前第一图像块对应的候选邻域图像块中存在第一邻域图像块的情况,可以将第一邻域图像块存入第一队列中,同时将第一邻域图像块以及当前第一图像块存入队列容器中,在第一队列中取出一个第一邻域图像块,访问对应的候选邻域图像块,以检测对应的候选邻域图像块中是否存在属于第一背景区域、且与当前第一邻域图像块属于同一类型背景区域的第二邻域图像块。
若存在第二邻域图像块,则将第二邻域图像块存入第一队列中以及队列容器中,然后继续在第一队列里取出一图像块(可以为第一邻域图像块或者第二邻域图像块),访问对应的候选邻域图像块,以检测当前图像块对应的候选邻域图像块中是否存在属于第一背景区域、且与当前图像块属于同一类型背景区域的邻域图像块(可以是第二邻域图像块或者第三邻域图像块),若存在则将访问到的邻域图像块存入第一队列中,同时存入队列容器中,不断从第一队列中取出图像块直至第一队列为空时停止。在此过程中,队列容器中不断存入邻域图像块,此时,对列容器中的邻域图像块与当前第一图像块形成当前第一图像块对应的缓存队列。
至此,可以针对当前第一图像块查找到对应的邻域图像块,然后可以针对未访问的其他第一图像块,继续查找对应的邻域图像块,可以形成另外的缓存队列,第一图像块以及对应的邻域图像块均存储于队列容器中。
其中,队列容器中的图像块均来源于目标容器,针对当前第一图像块而言,其对应的邻域图像块包括目标容器中的除当前第一图像块之外的其他图像块。在遍历过程中,继续按照预设规则对目标容器中的其他第一图像块进行访问时,可以仅对未经过访问的第一图像块进行访问。
针对当前第一图像块对应的候选邻域图像块中不存在第一邻域图像块的情况,可以继续按照预设规则对目标容器中未访问的第一图像块进行访问,此时需要重新确定一缓存队列,即,每重新选择目标容器中的第一图像块进行访问时,需要重建一缓存队列,目标容器可以对应于多个缓存队列,多个缓存队列存放于队列容器中。
在完成遍历之后,每个缓存队列包括基于遍历筛选出的第二图像块,第二图像块均为在第一背景区域对应的第一图像块中筛选出的图像块。针对同一个缓存队列而言,其所包括的第二图像块对应于同一类型背景区域,即两个有直接关联关系的第二图像块的RGB三通道直方图的峰值像素值差异在预设阈值范围内,这里的直接关联关系即为图像块直接邻域关系。
在确定至少一个缓存队列之后,可以得到至少一个背景区域,然后依据至少一个背景区域确定局部背景区域。
上述实施过程,以第一背景区域为基础进行图像邻域分析,缩小背景区域的范围,获取局部背景区域,进而可以生成局部背景光照图。
下面通过一具体实例对查找第一图像块对应的邻域图像块的过程进行阐述。针对当前第一图像块而言,访问其周围8邻域的候选邻域图像块,以检测周围8邻域的候选邻域图像块中是否存在属于第一背景区域、且与当前第一图像块属于同一类型背景区域的邻域图像块。针对检测与当前第一图像块属于同一类型背景区域的邻域图像块而言,需要计算当前第一图像块与属于第一背景区域的各候选邻域图像块之间的RGB三通道直方图的峰值像素值差异,即计算不同图像块的peak_r,peak_g,peak_b的差异值,如果峰值像素值差异在预设阈值范围内,则当前第一图像块与候选邻域图像块属于同一类型背景区域,此时的候选邻域图像块为真正的邻域图像块。
具体过程如下,首先定义像素值差异阈值t,并创建队列queue以遍历第一图像块的8邻域的候选邻域图像块、创建队列容器queue_vector用于存放缓存队列;顺序遍历目标容器pbv中的第一图像块,在遍历过程中,首先将当前访问的第一图像块加入到队列queue中,在队列queue中取出当前第一图像块,并根据当前第一图像块的行列坐标判断其8邻域内是否存在候选邻域图像块,若存在,则访问其周围8邻域的候选邻域图像块,以检测周围8邻域的候选邻域图像块中是否存在属于第一背景区域、且与当前第一图像块属于同一类型背景区域的邻域图像块,即计算当前第一图像块与各候选邻域图像块(属于第一背景区域)的RGB三通道直方图的峰值像素值的最大 差异值,并与像素值差异阈值t进行比较。其计算公式如下:
diff=max(abs(peak_r i-peak_r j),abs(peak_g i-peak_g j),abs(peak_b i-peak_b j))
其中,i表示当前第一图像块,j表示候选邻域图像块,diff表示最大差异值。如果diff小于像素值差异阈值t,确定当前第一图像块与候选邻域像素块属于同一类型背景区域,那么就把该候选邻域图像块加入到队列queue中,同时将当前第一图像块以及候选邻域图像块加入队列容器queue_vector中。不断取出队列queue中的图像块进行邻域判断并将确定的邻域像素块存入队列queue中,当队列queue为空的时候,针对当前第一图像块的邻域图像块的查找结束,此时,可以确定一缓存队列。继续遍历目标容器pbv中的未经过访问的其他第一图像块,最终的结果是队列容器queue_vector里包含多个缓存队列。
以上介绍了筛选第二图像块的情况,下面对生成局部背景光照图的情况进行介绍。可选地,每个缓存队列对应于初始文档图像中的一连通区域,根据第二图像块,生成局部背景光照图,包括:
根据至少一个缓存队列确定至少一个连通区域;
根据至少一个连通区域中面积最大的连通区域,生成局部背景光照图。
由于目标容器可以对应于至少一个缓存队列,每个缓存队列对应于初始文档图像中的一连通区域,因此初始文档图像中对应于至少一个连通区域。例如,初始文档图像中分别有黄色、白色、绿色和蓝色的连通区域。由于文档图片一般多以文字为主,背景区域面积大,基于文档图像的这个特征,做出以下假定:面积最大的连通区域为局部背景区域,如此,可以分别计算这些连通区域的面积,并选择面积最大的作为局部背景区域。例如,将面积最大的蓝色连通区域确定为局部背景区域。
即,针对初始文档图像中存在多个连通区域的情况,可以分别计算连通区域的区域面积,根据区域面积在多个连通区域中确定面积最大的连通区域,将面积最大的连通区域确定为局部背景区域,进而基于所确定的局部背景区 域生成局部背景光照图。
在确定局部背景区域时,通过利用文档图像的特性,基于连通区域的面积,在多个连通区域中选择面积最大的连通区域,可以实现基于面积参数快速确定局部背景区域,在确定局部背景区域之后,可以根据局部背景区域生成局部背景光照图。
本申请上述实施过程,在确定第一背景区域之后,针对第一背景区域中的第一图像块进行遍历,查找邻域图像块,以确定至少一个连通区域,基于文档图像的特性,在确定的至少一个连通区域中查找面积最大的连通区域,以在第一背景区域的基础上确定局部背景区域,可以快速、准确的确定局部背景区域,进而生成局部背景光照图。
可选地,步骤103对局部背景光照图进行像素点填充,生成全局背景光照图,包括:针对局部背景光照图,确定待填充区域的填充边缘线;根据填充边缘线,确定待填充像素点,并对待填充像素点进行填充;对填充边缘线进行多次更新,并在每次更新后重新确定待填充像素点进行填充,直至完成全部待填充像素点的填充。
在确定布局背景光照图之后,可以对局部背景光照图进行像素点填充,以生成全局背景光照图。在生成全局背景光照图时,可以针对局部背景光照图确定待填充区域的填充边缘线,基于填充边缘线确定待填充像素点,进而对确定的待填充像素点进行填充。且在完成一次填充之后,需要更新填充边缘线,然后重新确定待填充像素点进行填充,在更新填充边缘线时,填充边缘线不断向里推进,即,理解为填充边缘线对应的区域范围不断缩小。
在确定填充边缘线之后,针对填充边缘线上的每个边缘像素点,找到距离该边缘像素点最近的像素点进行填充,其中,距离该边缘像素点最近的像素点为填充边缘线对应的区域范围内的像素点。
下面对具体过程进行阐述,针对局部背景光照图,获取其对应的掩模mask图1,对mask图1进行膨胀得到mask图2,利用mask图2减去mask图1,可以得到填充边缘线。针对局部背景光照图而言,基于填充边缘线上 的各边缘像素点,找到距离该边缘像素点最近的待填充像素点以进行填充,填充公式如下所示:
Figure PCTCN2022121051-appb-000002
其中,p表示待填充像素点,I(p)表示待填充像素点的像素值,B 为像素点p的邻域区域,q为像素点p的邻域区域中的某个像素点,I(q)为像素点q的像素值,
Figure PCTCN2022121051-appb-000003
为像素点q的梯度向量,(p-q)为像素点p和像素点q的坐标差(为向量形式),w(p,q)用来计算邻域各像素点对待填充像素点的贡献权值,w(p,q)的计算方法如下:
Figure PCTCN2022121051-appb-000004
其中,‖p-q‖指的是pq两个像素点之间的距离,N(p)指的是p点的法向量,T(p)是p点距离边缘像素点(填充边缘线上的像素点)的距离,T(q)是q点距离边缘像素点的距离。
基于上述填充公式实现对待填充像素点的填充。在完成一次填充之后,重新确定mask图1,然后进行膨胀确定mask图2,由于进行了像素点填充,此次确定的mask图1与上一次确定的mask图1不同,进而使得基于新确定的mask图2与mask图1,得到的填充边缘线与之前的填充边缘线相区别。此时可以继续确定待填充像素点以进行像素点的填充,并在完成后,重复执行确定mask图1和mask图2、确定填充边缘线、进行像素点填充的流程,直至完成全部待填充像素点的填充,以生成全局背景光照图。
本申请上述实施过程,在生成局部背景光照图之后,在局部背景光照图的基础上进行像素点的填充,以实现对非背景光照区域进行像素点填充,进而可以生成全局背景光照图,以便于基于全局背景光照图的背景光照进行文档内容的增强显示。
可选地,步骤104根据初始文档图像和全局背景光照图,生成文档增强图像,包括:获取全局背景光照图的各第一像素点分别对应的第一像素值;
获取初始文档图像的背景区域的各第二像素点分别对应的第二像素值、 初始文档图像的文档区域的各第三像素点分别对应的第三像素值;
计算各第二像素点分别对应的第二像素值与对应的各第一像素点分别对应的第一像素值的第一比值,根据各第一比值与目标像素值的乘积确定初始文档图像的背景区域更新后的像素值;
计算各第三像素点分别对应的第三像素值与对应的各第一像素点分别对应的第一像素值的第二比值,根据各第二比值与目标像素值的乘积确定初始文档图像的文档区域更新后的像素值;
根据背景区域更新后的像素值和文档区域更新后的像素值,生成文档增强图像。
初始文档图像和全局背景光照图对应,初始文档图像和全局背景光照图的尺寸、分辨率相同。在根据初始文档图像和全局背景光照图生成文档增强图像时,可以针对全局背景光照图,获取各第一像素点分别对应的第一像素值,第一像素值为第一范围内的某个像素值,如第一范围为:[β-y,β+y]。针对初始文档图像的背景区域,获取各第二像素点分别对应的第二像素值,其中第二像素值为第二范围内的某个像素值,如第二范围为[β-x,β+x]。针对初始文档图像的文档区域,获取各第三像素点分别对应的第三像素值,其中第三像素值为第三范围内的某个像素值,如第三范围为[α-t,α+t]。其中,α和β为任意常数值,且因为通常文档图像中文字像素值远小于背景像素值,因此255>β>>α;又因为图像中各个点像素值不是完全相同,因此用t、x、y表示像素波动值,其都远小于α和β且x≈y。
在生成文档增强图像时,需要确定文档增强图像中背景区域的像素值和文档区域的像素值。在确定文档增强图像中背景区域的像素值时,需要针对初始文档图像的背景区域的各第二像素点,在全局背景光照图中确定对应的各第一像素点,计算各第二像素点分别对应的第二像素值(各第二像素值可以相同或者相区别)与对应的各第一像素点分别对应的第一像素值的第一比值,得到多个第一比值(第一比值的数量为初始文档图像的背景区域中第二像素点的数量)。针对每个第一比值与目标像素值的乘积,获取初始文档图 像的背景区域更新后的像素值,即文档增强图像中背景区域的像素值。目标像素值的取值范围可以为240至255,本申请实施例中优选255,以实现良好的增强效果。
在确定文档增强图像中文档区域的像素值时,需要针对初始文档图像的文档区域的各第三像素点,在全局背景光照图中确定对应的各第一像素点,计算各第三像素点分别对应的第三像素值(各第三像素值可以相同或者相区别)与对应的各第一像素点分别对应的第一像素值的第二比值,得到多个第二比值(第二比值的数量为初始文档图像的文档区域中第三像素点的数量)。针对每个第二比值与目标像素值的乘积,获取初始文档图像的文档区域更新后的像素值,即文档增强图像中文档区域的像素值。
在确定背景区域更新后的像素值和文档区域更新后的像素值之后,可以根据背景区域更新后的像素值和文档区域更新后的像素值生成文档增强图像,即,根据确定的背景区域更新后的像素值对原始文档图像的背景区域进行像素值的更新,根据确定的文档区域更新后的像素值对原始文档图像的文档区域进行像素值的更新,以生成文档增强图像。即,根据初始文档图像和全局背景光照图,生成文档增强图像的过程可以理解为:利用初始文档图像的像素值除以全局背景光照图的像素值,并与目标像素值相乘,以获取文档增强图像的像素值。
下面通过一具体实例对上述过程进行介绍,假设初始文档图像的背景区域任意像素点的像素值为β ij,其范围为[β-x,β+x],非背景区域的任意像素点的像素值为α ij,其范围为[α-t,α+t],全局背景光照图的任意像素点的像素值为l ij,其像素值范围为[β-y,β+y],其中i,j代表行列号。假定文档增强图像中与初始文档图像的背景区域相对应的任意像素点的像素值为R ij,与初始文档图像的文档区域相对应的任意像素点的像素值为T ij,则,R ij以及T ij的计算方式如下所示:
Figure PCTCN2022121051-appb-000005
Figure PCTCN2022121051-appb-000006
由于x和y无限接近,因此R ij无限接近255,意味着背景区域无限接近于白色;由于β>>α,t、x、y表示像素波动值,因此T ij远小于255,实现文档区域与背景区域形成鲜明对比。
需要说明的是,考虑到像素波动x以及y的存在,可能导致较多的像素点的像素值R ij<255,文档增强图像表现出较多的噪点。基于以上情况,可以对全部背景光照图添加一个增益系数δ且δ<1,那么文档增强图像的背景区域的像素值可以表示为:
Figure PCTCN2022121051-appb-000007
通过调整增益系数δ,可以使得R ij更接近255,减少噪点的存在。
进一步的,为了凸显文字的对比度,可以对文档增强图像I进行伽马变换,其中伽马因子γ的取值可以为1.5,其变换形式可以为:
Figure PCTCN2022121051-appb-000008
其中I/255为文档增强图像中的像素点的像素值与255之比,通过上述变化可以使得文档区域与背景区域的对比更加鲜明,如参见图4所示,为对文档增强图像I进行变换后的示意图,可以看出,背景区域更接近于白色,而文档区域的颜色更深,实现鲜明的对比。
本申请上述实施过程,可以根据全局背景光照图的像素点的像素值和初始文档图像的背景区域、文档区域的像素点的像素值,确定文档增强图像中背景区域和文档区域分别对应的像素值,进而实现基于全局背景光照图以及初始文档图像生成文档增强图像;且通过调整增益系数可以减少图像中噪点的存在,通过对图像进行变换可以使得图像中背景与文档内容的对比更加鲜明。
本申请实施例提供的文档图像增强方法,可以无需借助专业的扫描设备实现扫描增强的效果,且能很好的保护彩色图案和细节,不仅可以扫描包含文字的文档,也可以扫描手绘等文档,同时扫描速度快(如,经测试可知,在处理4000x3000分辨率的图像时,仅耗费80ms的时长),运行内存占用少,提升了用户的扫描体验。
以上为本申请实施例提供的文档图像增强方法的整体实施过程,通过根据背景区域确定条件,获取初始文档图像的第一背景区域,在第一背景区域的基础上,进行图像邻域分析,生成局部背景光照图,对局部背景光照图进行像素点填充生成全局背景光照图,基于全局背景光照图对初始文档图像进行处理,获得最终的文档增强图像,可以在无需借助扫描设备达到扫描效果的同时,保护文档内容的细节,且可以实现快速进行图像处理,获取文档增强图像。
进一步地,通过基于图像块的单通道直方图的背景概率进行图像块筛选,可以基于筛选出的图像块确定第一背景区域;在获取第一背景区域之后,以第一背景区域为基础,缩小背景区域的范围,可以生成局部背景光照图;在生成局部背景光照图之后,在局部背景光照图的基础上进行像素点的填充,以实现对非背景光照区域进行填充,进而可以生成全局背景光照图;在生成全局背景光照图之后,基于全局背景光照图和初始文档图像的像素值信息确定文档增强图像中背景区域和文档区域分别对应的像素值,进而实现基于全局背景光照图以及初始文档图像生成文档增强图像,以实现基于全局背景光照图的背景光照进行文档内容的增强显示。
本申请实施例还提供一种文档图像增强装置,如图5所示,包括:
获取模块501,用于根据背景区域确定条件,获取初始文档图像的第一背景区域;
第一生成模块502,用于对所述第一背景区域进行图像邻域分析,生成局部背景光照图;
第二生成模块503,用于对所述局部背景光照图进行像素点填充,生成全局背景光照图;
第三生成模块504,用于根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
可选地,所述获取模块包括:
划分子模块,用于将所述初始文档图像划分为预设数目个尺寸相同的图 像块;
第一筛选子模块,用于根据所述图像块对应的RGB三通道直方图,在预设数目个所述图像块中筛选出多个第一图像块,所述第一图像块的至少一个单通道直方图对应的背景概率大于预设概率值,所述背景概率用于指示属于所述第一背景区域的概率;
第一确定子模块,用于根据所述第一图像块确定所述第一背景区域。
可选地,所述第一生成模块包括:
第二筛选子模块,用于对所述第一背景区域内的所述第一图像块进行图像邻域分析,在多个所述第一图像块中筛选出第二图像块;
第一生成子模块,用于根据所述第二图像块,生成所述局部背景光照图。
可选地,所述第二筛选子模块包括:
遍历单元,用于按照预设规则,对多个所述第一图像块进行遍历,以分析所述第一图像块的邻域图像块;
第一确定单元,用于根据遍历结果确定至少一个缓存队列,每个所述缓存队列包括基于遍历筛选出的所述第二图像块,且同一个所述缓存队列中的所述第二图像块对应于同一类型背景区域;
其中,属于同一类型背景区域的两个具有直接关联关系的所述第二图像块,对应的RGB三通道直方图的峰值像素值差异在预设阈值范围内。
可选地,每个所述缓存队列对应于所述初始文档图像中的一连通区域,所述第一生成子模块包括:
第二确定单元,用于根据所述至少一个缓存队列确定至少一个连通区域;
生成单元,用于根据所述至少一个连通区域中面积最大的连通区域,生成所述局部背景光照图。
可选地,所述第二生成模块包括:
第二确定子模块,用于针对所述局部背景光照图,确定待填充区域的填充边缘线;
确定填充子模块,用于根据所述填充边缘线,确定待填充像素点,并对 所述待填充像素点进行填充;
处理子模块,用于对所述填充边缘线进行多次更新,并在每次更新后重新确定所述待填充像素点进行填充,直至完成全部所述待填充像素点的填充。
可选地,所述第三生成模块包括:
第一获取子模块,用于获取所述全局背景光照图的各第一像素点分别对应的第一像素值;
第二获取子模块,用于获取所述初始文档图像的背景区域的各第二像素点分别对应的第二像素值、所述初始文档图像的文档区域的各第三像素点分别对应的第三像素值;
第一计算确定子模块,用于计算各所述第二像素点分别对应的第二像素值与对应的各所述第一像素点分别对应的第一像素值的第一比值,根据各所述第一比值与目标像素值的乘积确定所述初始文档图像的背景区域更新后的像素值;
第二计算确定子模块,用于计算各所述第三像素点分别对应的第三像素值与对应的各所述第一像素点分别对应的第一像素值的第二比值,根据各所述第二比值与所述目标像素值的乘积确定所述初始文档图像的文档区域更新后的像素值;
第二生成子模块,用于根据所述背景区域更新后的像素值和所述文档区域更新后的像素值,生成所述文档增强图像。
以上为本申请实施例提供的文档图像增强装置,通过根据背景区域确定条件,获取初始文档图像的第一背景区域,在第一背景区域的基础上,进行图像邻域分析,生成局部背景光照图,对局部背景光照图进行像素点填充生成全局背景光照图,基于全局背景光照图对初始文档图像进行处理,获得最终的文档增强图像,可以在无需借助扫描设备达到扫描效果的同时,保护文档内容的细节,且可以实现快速进行图像处理,获取文档增强图像。
进一步地,通过基于图像块的单通道直方图的背景概率进行图像块筛选,可以基于筛选出的图像块确定第一背景区域;在获取第一背景区域之后,以 第一背景区域为基础,缩小背景区域的范围,可以生成局部背景光照图;在生成局部背景光照图之后,在局部背景光照图的基础上进行像素点的填充,以实现对非背景光照区域进行填充,进而可以生成全局背景光照图;在生成全局背景光照图之后,基于全局背景光照图和初始文档图像的像素值信息确定文档增强图像中背景区域和文档区域分别对应的像素值,进而实现基于全局背景光照图以及初始文档图像生成文档增强图像,以实现基于全局背景光照图的背景光照进行文档内容的增强显示。
本申请实施例中的文档图像增强装置可以是装置,也可以是终端中的部件、集成电路或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的文档图像增强装置可以为具有操作***的装置。该操作***可以为安卓(Android)操作***,可以为iOS操作***,还可以为其他可能的操作***,本申请实施例不作具体限定。
本申请实施例提供的文档图像增强装置能够实现图1所示的文档图像增强方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图6所示,本申请实施例还提供一种电子设备600,包括处理器601,存储器602,存储在存储器602上并可在所述处理器601上运行的程序或指令,该程序或指令被处理器601执行时实现上述文档图像增强方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图7为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备700包括但不限于:射频单元701、网络模块702、音频输出单元703、输入单元704、传感器705、显示单元706、用户输入单元707、接口单元708、存储器709以及处理器710等部件。
本领域技术人员可以理解,电子设备700还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理***与处理器710逻辑相连,从而通过电源管理***实现管理充电、放电以及功耗管理等功能。图7中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器710用于:根据背景区域确定条件,获取初始文档图像的第一背景区域;对所述第一背景区域进行图像邻域分析,生成局部背景光照图;对所述局部背景光照图进行像素点填充,生成全局背景光照图;根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
可选地,在根据背景区域确定条件,获取初始文档图像的第一背景区域时,处理器710还用于执行以下步骤:将所述初始文档图像划分为预设数目个尺寸相同的图像块;根据所述图像块对应的RGB三通道直方图,在预设数目个所述图像块中筛选出多个第一图像块,所述第一图像块的至少一个单通道直方图对应的背景概率大于预设概率值,所述背景概率用于指示属于所述第一背景区域的概率;根据所述第一图像块确定所述第一背景区域。
可选地,对所述第一背景区域进行图像邻域分析,生成局部背景光照图时,处理器710还用于执行以下步骤:对所述第一背景区域内的所述第一图像块进行图像邻域分析,在多个所述第一图像块中筛选出第二图像块;根据所述第二图像块,生成所述局部背景光照图。
可选地,所述对所述第一背景区域内的所述第一图像块进行图像邻域分析,在多个所述第一图像块中筛选出第二图像块时,处理器710还用于执行以下步骤:按照预设规则,对多个所述第一图像块进行遍历,以分析所述第一图像块的邻域图像块;根据遍历结果确定至少一个缓存队列,每个所述缓 存队列包括基于遍历筛选出的所述第二图像块,且同一个所述缓存队列中的所述第二图像块对应于同一类型背景区域;其中,属于同一类型背景区域的两个具有直接关联关系的所述第二图像块,对应的RGB三通道直方图的峰值像素值差异在预设阈值范围内。
可选地,每个所述缓存队列对应于所述初始文档图像中的一连通区域,在根据所述第二图像块,生成所述局部背景光照图时,处理器710还用于执行以下步骤:根据所述至少一个缓存队列确定至少一个连通区域;根据所述至少一个连通区域中面积最大的连通区域,生成所述局部背景光照图。
可选地,在对所述局部背景光照图进行像素点填充,生成全局背景光照图时,处理器710还用于执行以下步骤:针对所述局部背景光照图,确定待填充区域的填充边缘线;根据所述填充边缘线,确定待填充像素点,并对所述待填充像素点进行填充;对所述填充边缘线进行多次更新,并在每次更新后重新确定所述待填充像素点进行填充,直至完成全部所述待填充像素点的填充。
可选地,在根据所述初始文档图像和所述全局背景光照图,生成文档增强图像时,处理器710还用于执行以下步骤:获取所述全局背景光照图的各第一像素点分别对应的第一像素值;获取所述初始文档图像的背景区域的各第二像素点分别对应的第二像素值、所述初始文档图像的文档区域的各第三像素点分别对应的第三像素值;计算各所述第二像素点分别对应的第二像素值与对应的各所述第一像素点分别对应的第一像素值的第一比值,根据各所述第一比值与目标像素值的乘积确定所述初始文档图像的背景区域更新后的像素值;计算各所述第三像素点分别对应的第三像素值与对应的各所述第一像素点分别对应的第一像素值的第二比值,根据各所述第二比值与所述目标像素值的乘积确定所述初始文档图像的文档区域更新后的像素值;根据所述背景区域更新后的像素值和所述文档区域更新后的像素值,生成所述文档增强图像。
这样,通过根据背景区域确定条件,获取初始文档图像的第一背景区域, 在第一背景区域的基础上,进行图像邻域分析,生成局部背景光照图,对局部背景光照图进行像素点填充生成全局背景光照图,基于全局背景光照图对初始文档图像进行处理,获得最终的文档增强图像,可以在无需借助扫描设备达到扫描效果的同时,保护文档内容的细节,且可以实现快速进行图像处理,获取文档增强图像。
进一步地,通过基于图像块的单通道直方图的背景概率进行图像块筛选,可以基于筛选出的图像块确定第一背景区域;在获取第一背景区域之后,以第一背景区域为基础,缩小背景区域的范围,可以生成局部背景光照图;在生成局部背景光照图之后,在局部背景光照图的基础上进行像素点的填充,以实现对非背景光照区域进行填充,进而可以生成全局背景光照图;在生成全局背景光照图之后,基于全局背景光照图和初始文档图像的像素值信息确定文档增强图像中背景区域和文档区域分别对应的像素值,进而实现基于全局背景光照图以及初始文档图像生成文档增强图像,以实现基于全局背景光照图的背景光照进行文档内容的增强显示。
应理解的是,在本申请实施例中,输入单元704可以包括图形处理器(Graphics Processing Unit,GPU)7041和麦克风7042,图形处理器7041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元706可包括显示面板7061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板7061。用户输入单元707包括触控面板7071以及其他输入设备7072。触控面板7071,也称为触摸屏。触控面板7071可包括触摸检测装置和触摸控制器两个部分。其他输入设备7072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器709可用于存储软件程序以及各种数据,包括但不限于应用程序和操作***。处理器710可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作***、用户页面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器710中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述文档图像增强方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述文档图像增强方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为***级芯片、***芯片、芯片***或片上***芯片等。
本申请实施例还提供一种文档图像增强装置,所述装置被配置为用于执行上述文档图像增强方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
本申请实施例还提供一种计算机程序产品,所述计算机程序产品被存储在非易失的存储介质中,程序产品被至少一个处理器执行以实现上述文档图像增强方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可 包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (13)

  1. 一种文档图像增强方法,其中,所述方法包括:
    根据背景区域确定条件,获取初始文档图像的第一背景区域;
    对所述第一背景区域进行图像邻域分析,生成局部背景光照图;
    对所述局部背景光照图进行像素点填充,生成全局背景光照图;
    根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
  2. 根据权利要求1所述的方法,其中,所述根据背景区域确定条件,获取初始文档图像的第一背景区域,包括:
    将所述初始文档图像划分为预设数目个尺寸相同的图像块;
    根据所述图像块对应的RGB三通道直方图,在预设数目个所述图像块中筛选出多个第一图像块,所述第一图像块的至少一个单通道直方图对应的背景概率大于预设概率值,所述背景概率用于指示属于所述第一背景区域的概率;
    根据所述第一图像块确定所述第一背景区域。
  3. 根据权利要求2所述的方法,其中,所述对所述第一背景区域进行图像邻域分析,生成局部背景光照图,包括:
    对所述第一背景区域内的所述第一图像块进行图像邻域分析,在多个所述第一图像块中筛选出第二图像块;
    根据所述第二图像块,生成所述局部背景光照图。
  4. 根据权利要求3所述的方法,其中,所述对所述第一背景区域内的所述第一图像块进行图像邻域分析,在多个所述第一图像块中筛选出第二图像块,包括:
    按照预设规则,对多个所述第一图像块进行遍历,以分析所述第一图像块的邻域图像块;
    根据遍历结果确定至少一个缓存队列,每个所述缓存队列包括基于遍历筛选出的所述第二图像块,且同一个所述缓存队列中的所述第二图像块对应于同一类型背景区域;
    其中,属于同一类型背景区域的两个具有直接关联关系的所述第二图像块,对应的RGB三通道直方图的峰值像素值差异在预设阈值范围内。
  5. 根据权利要求4所述的方法,其中,每个所述缓存队列对应于所述初始文档图像中的一连通区域,所述根据所述第二图像块,生成所述局部背景光照图,包括:
    根据所述至少一个缓存队列确定至少一个连通区域;
    根据所述至少一个连通区域中面积最大的连通区域,生成所述局部背景光照图。
  6. 根据权利要求1所述的方法,其中,所述对所述局部背景光照图进行像素点填充,生成全局背景光照图,包括:
    针对所述局部背景光照图,确定待填充区域的填充边缘线;
    根据所述填充边缘线,确定待填充像素点,并对所述待填充像素点进行填充;
    对所述填充边缘线进行多次更新,并在每次更新后重新确定所述待填充像素点进行填充,直至完成全部所述待填充像素点的填充。
  7. 根据权利要求1所述的方法,其中,所述根据所述初始文档图像和所述全局背景光照图,生成文档增强图像,包括:
    获取所述全局背景光照图的各第一像素点分别对应的第一像素值;
    获取所述初始文档图像的背景区域的各第二像素点分别对应的第二像素值、所述初始文档图像的文档区域的各第三像素点分别对应的第三像素值;
    计算各所述第二像素点分别对应的第二像素值与对应的各所述第一像素点分别对应的第一像素值的第一比值,根据各所述第一比值与目标像素值的乘积确定所述初始文档图像的背景区域更新后的像素值;
    计算各所述第三像素点分别对应的第三像素值与对应的各所述第一像素点分别对应的第一像素值的第二比值,根据各所述第二比值与所述目标像素值的乘积确定所述初始文档图像的文档区域更新后的像素值;
    根据所述背景区域更新后的像素值和所述文档区域更新后的像素值,生 成所述文档增强图像。
  8. 一种文档图像增强装置,其中,所述装置包括:
    获取模块,用于根据背景区域确定条件,获取初始文档图像的第一背景区域;
    第一生成模块,用于对所述第一背景区域进行图像邻域分析,生成局部背景光照图;
    第二生成模块,用于对所述局部背景光照图进行像素点填充,生成全局背景光照图;
    第三生成模块,用于根据所述初始文档图像和所述全局背景光照图,生成文档增强图像。
  9. 一种电子设备,其中,所述电子设备包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至7任一项所述的文档图像增强方法的步骤。
  10. 一种可读存储介质,其中,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至7任一项所述的文档图像增强方法的步骤。
  11. 一种文档图像增强装置,其中,所述文档图像增强装置被配置为用于执行如权利要求1至7任一项所述的文档图像增强方法的步骤。
  12. 一种芯片,其中,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至7任一项所述的文档图像增强方法的步骤。
  13. 一种计算机程序产品,其中,所述计算机程序产品被存储在非易失的存储介质中,程序产品被至少一个处理器执行以实现如权利要求1至7任一项所述的文档图像增强方法的步骤。
PCT/CN2022/121051 2021-09-26 2022-09-23 文档图像增强方法、装置及电子设备 WO2023046112A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111131930.7A CN113822817A (zh) 2021-09-26 2021-09-26 文档图像增强方法、装置及电子设备
CN202111131930.7 2021-09-26

Publications (1)

Publication Number Publication Date
WO2023046112A1 true WO2023046112A1 (zh) 2023-03-30

Family

ID=78915547

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/121051 WO2023046112A1 (zh) 2021-09-26 2022-09-23 文档图像增强方法、装置及电子设备

Country Status (2)

Country Link
CN (1) CN113822817A (zh)
WO (1) WO2023046112A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116704516A (zh) * 2023-08-07 2023-09-05 山东禾之源现代农业发展有限公司 一种用于水溶肥料包装的视觉检测方法
CN116758081A (zh) * 2023-08-18 2023-09-15 安徽乾劲企业管理有限公司 一种无人机道路桥梁巡检图像处理方法
CN117237596A (zh) * 2023-11-15 2023-12-15 广州市易鸿智能装备股份有限公司 图像识别方法、装置、计算机设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113822817A (zh) * 2021-09-26 2021-12-21 维沃移动通信有限公司 文档图像增强方法、装置及电子设备
CN116682112B (zh) * 2023-07-28 2023-10-17 青岛虹竹生物科技有限公司 一种多糖测试数据存储及数字化方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523364A (zh) * 2011-12-02 2012-06-27 方正国际软件有限公司 一种文档图像透印清除方法及***
CN103854299A (zh) * 2014-03-05 2014-06-11 清华大学 一种基于全局能量函数优化的图像层次提取与编辑方法
CN110008954A (zh) * 2019-03-29 2019-07-12 重庆大学 一种基于多阈值融合的复杂背景文本图像提取方法及***
CN113822817A (zh) * 2021-09-26 2021-12-21 维沃移动通信有限公司 文档图像增强方法、装置及电子设备

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7177483B2 (en) * 2002-08-29 2007-02-13 Palo Alto Research Center Incorporated. System and method for enhancement of document images
EP2299726B1 (en) * 2008-06-17 2012-07-18 Huawei Device Co., Ltd. Video communication method, apparatus and system
CN106033528A (zh) * 2015-03-09 2016-10-19 富士通株式会社 从彩色文档图像中提取特定区域的方法和设备
CN108257104B (zh) * 2018-01-26 2020-03-06 维沃移动通信有限公司 一种图像处理方法及移动终端
CN111507352B (zh) * 2020-04-16 2021-09-28 腾讯科技(深圳)有限公司 一种图像处理方法、装置、计算机设备以及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102523364A (zh) * 2011-12-02 2012-06-27 方正国际软件有限公司 一种文档图像透印清除方法及***
CN103854299A (zh) * 2014-03-05 2014-06-11 清华大学 一种基于全局能量函数优化的图像层次提取与编辑方法
CN110008954A (zh) * 2019-03-29 2019-07-12 重庆大学 一种基于多阈值融合的复杂背景文本图像提取方法及***
CN113822817A (zh) * 2021-09-26 2021-12-21 维沃移动通信有限公司 文档图像增强方法、装置及电子设备

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116704516A (zh) * 2023-08-07 2023-09-05 山东禾之源现代农业发展有限公司 一种用于水溶肥料包装的视觉检测方法
CN116704516B (zh) * 2023-08-07 2023-10-24 山东禾之源现代农业发展有限公司 一种用于水溶肥料包装的视觉检测方法
CN116758081A (zh) * 2023-08-18 2023-09-15 安徽乾劲企业管理有限公司 一种无人机道路桥梁巡检图像处理方法
CN116758081B (zh) * 2023-08-18 2023-11-17 安徽乾劲企业管理有限公司 一种无人机道路桥梁巡检图像处理方法
CN117237596A (zh) * 2023-11-15 2023-12-15 广州市易鸿智能装备股份有限公司 图像识别方法、装置、计算机设备及存储介质

Also Published As

Publication number Publication date
CN113822817A (zh) 2021-12-21

Similar Documents

Publication Publication Date Title
WO2023046112A1 (zh) 文档图像增强方法、装置及电子设备
CN108550101B (zh) 图像处理方法、装置及存储介质
US9491366B2 (en) Electronic device and image composition method thereof
CN109191395B (zh) 图像对比度增强方法、装置、设备及存储介质
US20170091524A1 (en) Identifying video content via color-based fingerprint matching
US10847073B2 (en) Image display optimization method and apparatus
CN108701351B (zh) 一种图像显示增强方法及装置
CN107507144B (zh) 肤色增强的处理方法、装置及图像处理装置
WO2020177584A1 (zh) 一种图文排版方法及其相关装置
CN112037160A (zh) 图像处理方法、装置及设备
JP2004362443A (ja) パラメータ決定方式
CN110969583A (zh) 一种图像背景处理方法及***
CN113989396A (zh) 图片渲染方法、装置、设备、存储介质和程序产品
CN113052923A (zh) 色调映射方法、装置、电子设备和存储介质
KR20130134546A (ko) 동영상의 섬네일 이미지 생성 방법 및 그 전자 장치
JP7143649B2 (ja) 画像処理装置、画像処理システム、画像処理方法、及びプログラム
CN113393391B (zh) 图像增强方法、图像增强装置、电子设备和存储介质
CN111754411B (zh) 图像降噪方法、图像降噪装置及终端设备
CN113284199A (zh) 图像灰度区域确定方法、电子设备及服务器
CN111047533A (zh) 一种人脸图像的美化方法和装置
CN113129400B (zh) 图像处理方法、装置、电子设备和可读存储介质
JP2012094067A (ja) 画像処理装置、画像処理方法、およびプログラム
Liu et al. Image colorization based on texture map
JP2014067129A (ja) スケール毎の特徴量と色分布との関係を考慮した色変換処理プログラム、装置及び方法
JP2002208013A (ja) 画像領域抽出装置及び画像領域抽出方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22872156

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE