WO2013136546A1 - 画像処理装置、及び画像処理方法 - Google Patents

画像処理装置、及び画像処理方法 Download PDF

Info

Publication number
WO2013136546A1
WO2013136546A1 PCT/JP2012/068631 JP2012068631W WO2013136546A1 WO 2013136546 A1 WO2013136546 A1 WO 2013136546A1 JP 2012068631 W JP2012068631 W JP 2012068631W WO 2013136546 A1 WO2013136546 A1 WO 2013136546A1
Authority
WO
WIPO (PCT)
Prior art keywords
character
pixels
image
component
character candidate
Prior art date
Application number
PCT/JP2012/068631
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 株式会社東芝
Priority to CN201280070746.9A priority Critical patent/CN104137119B/zh
Publication of WO2013136546A1 publication Critical patent/WO2013136546A1/ja
Priority to US14/461,511 priority patent/US9275279B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/14Image acquisition
    • G06V30/148Segmentation of character regions
    • G06V30/155Removing patterns interfering with the pattern to be recognised, such as ruled lines or underlines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/18Extraction of features or characteristics of the image
    • G06V30/18086Extraction of features or characteristics of the image by performing operations within image blocks or by using histograms
    • G06V30/18095Summing image-intensity values; Projection and histogram analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/28Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet
    • G06V30/287Character recognition specially adapted to the type of the alphabet, e.g. Latin alphabet of Kanji, Hiragana or Katakana characters

Definitions

  • Embodiments described herein relate generally to an image processing apparatus and an image processing method for extracting characters from image data.
  • the present invention has been made in view of the above, and it is an object of the present invention to provide an image processing apparatus capable of appropriately extracting characters from image data regardless of the bordering mode.
  • an image processing apparatus includes an acquisition unit that acquires image data and a set of character candidate components from the image data based on a predetermined first criterion. Are extracted for each gradation of the image data, and a removing unit for removing non-character components from the set of character candidate components based on a predetermined second criterion.
  • the image processing apparatus includes a character measuring unit that measures the number of character pixels representing the number of pixels included in the character candidate component after removing the non-character component, and an edge pixel adjacent to the character candidate component after removing the non-character component An edge measuring unit that measures the number of edge pixels representing the number of pixels.
  • the image processing apparatus When there is a significant difference in the difference between the number of character pixels having the largest number of character pixels and the number of character pixels having the second number of character pixels, the image processing apparatus The character candidate component in the gradation having the largest number of pixels after the removal is selected as the output image. Further, the image processing apparatus determines that the difference between the number of character pixels having the largest number of character pixels and the number of character pixels having the second number of character pixels is not significantly different. A character candidate component in a gradation having the smallest number of edge pixels after removing is selected as an output image. Then, the image processing apparatus outputs the selected output image.
  • FIG. 1 is a functional block diagram of an image processing system including an image processing device in an embodiment. It is a flowchart which shows the flow of an image process in embodiment. It is a figure which shows an example of image data in embodiment. It is a flowchart which shows the flow of a division process in embodiment. It is a figure which shows an example of the image data divided
  • FIG. 1 is a block diagram illustrating a configuration of an image processing system 100 including an image processing apparatus 10 according to the present embodiment.
  • a scanner 1 as an input device, a handwriting input unit 2, an HDD recorder 3, and the like are connected to an image processing apparatus 10. Image data from these input devices is input to the image processing device 10.
  • the image processing apparatus 10 includes general-purpose hardware such as a CPU, a memory, a hard disk, and an input / output interface.
  • the image processing apparatus 10 includes an image acquisition unit 21, a storage unit 22, a sorting unit 23, an extraction unit 24, a removal unit 25, a pixel measurement unit 26, an edge measurement unit 27, and an output unit 28.
  • the storage unit 22 is realized by a storage memory or a hard disk. Further, the image acquisition unit 21, the classification unit 23, the extraction unit 24, the removal unit 25, the pixel measurement unit 26, the edge measurement unit 27, and the output unit 28 are realized as functions of an image processing program stored in a hard disk, for example. Yes.
  • the image acquisition unit 21 acquires image data to be processed input from the input device, and writes the acquired image data in the storage unit 22.
  • the division unit 23 reads the image data from the storage unit 22 and divides the image data into one or more division regions.
  • the sorting unit 23 writes the coordinate information of the start position and the end position in each divided region of the sorted image data in the storage unit 22.
  • the extraction unit 24 reads the image data and the start position and end position of each segmented area from the storage unit 22, extracts character pixels from the image data included in each segmented area, and writes them to the storage unit 22.
  • the removal unit 25 removes borders, non-character components, and the like from the character pixels extracted by the extraction unit 24, and writes the removed character pixels in the storage unit 22.
  • the pixel measurement unit 26 and the edge measurement unit 27 measure the number of pixels included in the character candidate component and function in cooperation with the extraction unit 24. Details will be described later.
  • the output unit 28 reads out character pixels from the storage unit 22 as an output image, and outputs it to a character recognition device 30 that can recognize characters such as OHP.
  • the image processing apparatus 10 When acquiring image data of a character string from the input device, the image processing apparatus 10 writes the acquired image data in the storage unit 22 (step S100).
  • FIG. 3 shows an example of image data, which is a grayscale image having a width of 1100 pixels, a height of 215 pixels, and a possible pixel value of 0 or more and 255 or less.
  • the image data may be a color image or a binary image.
  • the division unit 23 reads the image data from the storage unit 22, divides the image data into one or more division regions, and writes the start position and end position of each division region in the image data to the storage unit 22. (Step S101).
  • the extraction unit 24 selects one segment area from the storage unit 22 (step S102).
  • the partitioned areas are selected in the order written in the storage unit 22.
  • the extraction unit 24 extracts a set of character candidate components to be described later from the segment area selected in step S102, and the removal unit 25 removes non-character components to be described later from the character candidate components.
  • a character pixel extraction process for writing the character pixels constituting the component in the storage unit 22 is performed (step S103).
  • the extraction unit 24 deletes the segment area selected in step S102 from the storage unit 22 (step S104).
  • the segmented area stored next in the storage unit 22 is selected when the segmented area is selected in the next step S102.
  • the next segmented area may be selected, for example, by changing the pointer of the memory address.
  • the extraction unit 24 determines whether or not the character pixel extraction process has been performed in all the divided areas (step S105).
  • step S105: Yes the output unit 28 reads the character pixel from the storage unit 22, and outputs it to the character recognition device 30 as an output image.
  • step S106 the process from step S102 is repeated again.
  • step S101 the process of dividing the image data into a plurality of divided areas in step S101 will be described with reference to FIG.
  • an area obtained by dividing the image data at a constant interval is set as a divided area, or an area including a predetermined color is extracted from the image data and extracted.
  • an area where pixel values of image data are continuously similar is set as a divided area of the image data.
  • the sorting unit 23 performs an initialization process. (Step S201).
  • the sorting unit 23 divides the image data into small areas smaller than the sectioned area by dividing the image data into equal numbers of small areas N R according to the reading direction of the image data. What is necessary is just to set the space
  • the character reading direction may be determined in advance or automatically determined.
  • the reading direction is determined as the horizontal direction if the long side of the image data is the upper side and the lower side, and the reading direction is determined as the vertical direction if it is the left side and the right side.
  • the reading direction is the horizontal direction.
  • i is set to 0, which is a variable indicating the number of the small area currently being processed.
  • b which is a variable indicating the position of the small area that becomes the boundary of the divided area, is set to 0.
  • s which is a variable indicating the number of the segmented area, is set to 0.
  • FIG. 5 shows a state of the image data 500 divided into small areas.
  • the image data 500 is divided into a total of 15 small areas from 0 to 14.
  • the number of small areas may be a predetermined value or may be calculated using the value of image data.
  • the number N R of small regions is calculated using the following formula 1.
  • Equation 1 s is the length of the short side of the image data, l is the length of the long side of the image, r R is a value predetermined as a parameter, and integer is a function that converts the input value into an integer.
  • s is 215 pixels, l is 1100 pixels, are set 0.34 as the r R, resulting 15 calculations.
  • 5 shows an example in which the image data is divided into rectangular areas that do not overlap with each other. However, as another example, small areas may overlap each other, and other examples such as an ellipse or a triangle may be used instead of a rectangle. You may make it divide
  • the sorting unit 23 generates a histogram of pixel values for each area for the N R small areas (step S201).
  • the graphs denoted by reference numerals 501 and 502 schematically represent a histogram of pixel values in the 0th and 5th small regions as an example.
  • the histogram for the i-th small region is denoted as H i
  • the set of histograms for the 0th to N R ⁇ 1th small regions is denoted as H.
  • the classifying unit 23 calculates a difference d between the histogram obtained by averaging the b-th to (i ⁇ 1) -th histograms and the i-th histogram (step S202).
  • b is a variable indicating the start position of the segmented area currently being processed
  • the calculated value is obtained from the histogram of a certain small region up to the small region immediately before the small region belonging to the segmented region. This is a value indicating whether or not there is a change in the tendency of a large pixel value with respect to the histogram.
  • Equation 2 is used to calculate the difference d.
  • D is a function that outputs the difference between two histograms given by the first argument and the second argument.
  • the averaging of a plurality of histograms is realized by calculating an average value or median value for each bin value of the histogram. In this embodiment, an average value is given to each bin as an example.
  • the function D is realized as shown in Equation 3 as an example.
  • H A, j indicates the value of the j th bin of the histogram H A
  • H B, j indicates the value of the j th bin of the histogram H B.
  • j is an integer of 0 ⁇ j ⁇ N H and N H is the number of bins in the histogram.
  • the sorting unit 23 determines whether i is greater than 0 and the difference d calculated in step is equal to or greater than a predetermined threshold value t d (step S203). When it is determined that i is greater than 0 and the degree of difference d is greater than or equal to a predetermined threshold value t d (step S203: Yes), the tendency of the histogram has changed.
  • the segmenting unit 23 determines the start position and end position of the sth segmented area and writes them to the storage unit 22 (step S204). As a calculation method of the start position and the end position, Expression 4 is used in the present embodiment.
  • A are parameters that adjust the start position and end position in advance
  • min is a function that outputs the minimum value of the arguments.
  • the sorting unit 23 substitutes the current i variable for the value of b as the start position of the next sorting area, and adds 1 to S, which is the number of the sorting area (step S205). Then, the process proceeds to step S206. If it is determined that i is 0 or the difference d is not greater than or equal to the predetermined threshold t d (step S203: No), the process proceeds to step S206.
  • step S206 the sorting unit 23 increases i by 1 and proceeds to processing for the next small area (step S206). Then, division unit 23, i determines whether N R and equivalence (step S207). When i is equal to N R , that is, when it is determined that the sorting process for all the small areas has been completed (step S207: Yes), the sorting unit 23, like step 204, starts and ends the sorting area. Is calculated and written to the storage unit 22, and the current number of divisions s + 1 is written to the storage unit 22 as the total number of division regions, and the process ends (step S208). On the other hand, when it is determined that i is not the same value as N R (step S207: No), the processing from step S202 is repeated.
  • FIG. 3 is image data
  • the sub-regions up to the fifth divided in FIG. 5 are similar to each other in the tendency of histograms calculated from characters, borders, and background luminance, so i is 0 ⁇ i ⁇ .
  • the difference d in step S202 is a relatively small value.
  • a segmented area 510 and a second segmented area 520 are obtained in this example.
  • the extraction unit 24 first reads out the image data from the storage unit 22 and the start position and end position of the segment area selected in step S102, and determines the range of the segment area of the image data as a binary image. (Step S300). Thereafter, the converted image data and the transformed image I B.
  • image conversion for example, a known color clustering method may be used, a known image binarization method may be used, or another image binarization method or multi-value quantization method may be used. Also good. Note that the image may be converted to a color image or a grayscale image instead of a binary image.
  • the pixel value of the pixel in the range of the segmented area is less than a predetermined threshold value, the pixel value is converted to 0, otherwise the pixel value is converted to 1, and the converted result is converted to a converted image. exported as I B.
  • Step S301 the extraction unit 24 i and 0 to initialize the a variable indicating which processing the transformed image I B of which pixel values currently. That is, if i is 0, it means that processing is being performed on a converted image having a pixel value of 0, and if i is 1, processing is being performed on a converted image having a pixel value of 1. Means. In this embodiment, since it is a binary image, the maximum value of i is 1, but in the case of a color image, the value of i is larger than 1.
  • the extraction unit 24 extracts character candidates components from the transformed image I B, to obtain a set of character candidates component (step S302).
  • the character candidate component is a pixel determined to be a candidate recognized as character information based on a predetermined first criterion.
  • the first reference is taken as an example, and a character candidate component is extracted by a known image connection component extraction method.
  • a set of connected components including pixels having a pixel value i is used as a character candidate component.
  • the extraction unit 24 assigns consecutive identification numbers starting from 0 to the character candidate components.
  • the pixel values in this manner transformed image I B extracts connected components of the same pixel between a character candidate component to pixel values may be extracted connected components between pixels that are similar, the pixel value
  • the target for extracting the connected component may be determined according to another criterion, such as extracting connected components between odd-numbered pixels or even-numbered pixels.
  • Figure 8 is a diagram showing a state transition of the transformed image I B when carrying out the character pixel extraction processing in the present embodiment.
  • the character candidate component extracted from the segmented region is a black pixel and other than the character candidate component.
  • Each part is composed of white pixels.
  • From transformed image I B a total of 10 character candidates components to the 9th from 0 th are extracted.
  • a set of character candidate components when the pixel value obtained by the character candidate component extraction process in step S302 is i is denoted as C i .
  • a set of character candidate components is defined as a character candidate component set.
  • step S303 the character candidate components not like the character component from the character candidate component set C i, i.e. the process of removing the non-character components is performed.
  • the second reference whether or not the position of the character candidate component in the image data is exceptional compared to other character candidate components, and the size of the character candidate component is other character candidate component Whether the line width of the character candidate component is exceptional compared to other character candidate components, and the number of pixels included in the character candidate component is other character candidates Criteria such as whether or not it is exceptional compared to the ingredients are used. However, if there is no non-character component to be removed in each step, no processing is performed.
  • the position performs an enclosing component removal process of removing the exceptional non-character components from the character candidate component set C i (step S303).
  • the left end of the transformed image I B as an example, the right end, the character candidate component set C i the character candidate components including the pixel as a non-character components at either end of the 4 edges of the image, such as the upper and lower ends Remove. That is, in the case of ordinary character, since it is considered that it takes never some characters in the vertical and horizontal ends of the transformed image I B, the character candidate components including a pixel at the position of such end non-character Determined to be a component. In FIG. 8A, since there is no character candidate component including the pixels at the left end, the right end, the upper end, and the lower end, the character candidate component is not removed and the process proceeds to the next step.
  • removing portion 25 performs size criteria removal size is removed from the character candidate component set C i unusual character candidate components as non-character components.
  • the length of the long side of the circumscribed rectangle surrounding the respective character candidates component removes a threshold or more character candidates component from the character candidate component set C i as an example.
  • This threshold value may be a predetermined value or may be automatically obtained.
  • the threshold t w of the length of the long side of the circumscribed rectangle is calculated using equation 5.
  • FIG. 9 shows the circumscribed rectangles of two character candidate components having a long long side length of the circumscribed rectangle among the extracted character candidate components, and indicates the length of the long side of the circumscribed rectangle. Yes.
  • t w from the length of the long side of the circumscribed rectangle is 210 characters candidate components
  • character candidate component 1 does not exceed the t w in the length of the long sides 165
  • step S304 In FIG. 5 the character candidate component 0 is removed.
  • removing unit 25 performs the line width removal process linewidth removes exceptional character candidate components from the character candidate component set C i (step S305).
  • candidate character components whose line width exceeds the upper threshold or falls below the lower threshold are removed from the candidate character component set C i .
  • a known approximate calculation method reference: IEICE technical report PRMU2010-237-PRMU2010-296, described in P112 is used.
  • character candidate component C i of the j-th C i an integer of 0 ⁇ j ⁇ 9
  • the line width w i of j, the j is calculated using Equation 6.
  • Equation 6 S i, j is the number of pixels constituting the character candidate component C i, j , and L i, j is the circumference of the character candidate component C i, j . Circumference is the number of black pixels in contact with white pixels, for example, converting the image I B.
  • the upper limit threshold and the lower limit threshold of the line width may be predetermined values or may be automatically obtained. In the present embodiment, as an example, the upper limit threshold tu and the lower limit threshold t b of the line width are calculated by Expression 7 and Expression 8.
  • Equations 7 and 8 r u and r b is a predetermined value is a parameter.
  • r u is 2.0R b is 0.6.
  • FIG. 10 illustrates the character candidate component immediately after step S304.
  • the character candidate component 6 is the character candidate component having the largest line width
  • the character candidate component 9 is the character candidate component having the smallest line width. is there.
  • the character candidate component 6 is composed of 1380 black pixels, and the number of black pixels in contact with the white pixels is 150.
  • the character candidate component 9 is composed of 250 black pixels, and the number of black pixels in contact with the white pixels is 160. Therefore, according to Equation 6, the line width of the character candidate component 6 is about 18, and the line width of the character candidate component 9 is about 3. Similarly, when the line widths of the other character candidate components are calculated, the line widths of the other character candidate components are approximately 5.
  • FIG. 8B shows the state of the converted image after the processing in step S305 is completed.
  • the removal unit 25 includes a character including many pixels having exceptional values from the character candidate component belonging to the character candidate component set C i on the basis of a certain pixel value in the image data 500 before the conversion processing in step s300.
  • Color reference removal processing for removing candidate components is performed (step S306).
  • the pixel value in the image data 500 is the value of the pixel in the image data 500 that is in the same position as the pixel that forms the character candidate component. That is, when the pixel value of an arbitrary coordinate (x, y) of the image data is I (x, y) and the coordinate of the start position of the segmented region is (xs, ys), the coordinate is (x, y).
  • pixel values in the image data of the pixel of I B can be represented as I (x + x s, y + y s).
  • I (x + x s , y + y s ) is an exceptional value
  • an average of pixel values in image data of pixels constituting all character candidate components belonging to C i is used.
  • calculating the m i can be used m i and I (x + x s, y + y s) method for determining on whether the absolute value of the difference between the threshold t m above a predetermined. The calculation of m i, using equation 9.
  • character candidate component C i, j is whether rich exceptions pixel, in the present embodiment whether exceeds a threshold value t o the real r o obtained using Equation 10 is predetermined Judge with.
  • t m is set to 40 and t o is set to 0.5.
  • FIG. 8 (c) is a diagram in which the image data 500 is superimposed on FIG. 8 (b) showing the processing result of step S305. Since all the pixels constituting the character candidate component of the converted image have the same luminance, the exceptional pixels are No. Therefore, when the transformed image I B is 8 (a) it is one of the character candidates ingredients in step S306 is also not removed. In order to determine whether the pixel is an exceptional pixel, instead of the average mi , a median pixel value or a predetermined parameter may be used.
  • step S308: Yes If i is determined to be the maximum value less than N C of the pixel values in the converted image (step S308: Yes), the process is repeated from step S302 again. On the other hand, if i is not less than the maximum pixel value N C in the converted image (step S308: No), the extraction unit 24 extracts a character pixel from the character candidate component that has not been deleted, and stores the character pixel in the storage unit 22. It writes out as an output image (step S309).
  • step S303 In removing process of the circumscribed matter components in step S303, removing unit 25, the left end of the transformed image I B, the right end, the character candidate components including the pixel of the upper end and the lower end is removed.
  • step S304 since there is no character candidate component whose length of the long side of the circumscribed rectangle exceeds the threshold value, no character candidate component is deleted.
  • step S305 since there is no character candidate component whose line width exceeds the upper limit threshold or lower than the lower limit threshold, no character candidate component is deleted.
  • FIG. 8 (g) is obtained by superimposing image data on the converted image of FIG. 8 (f).
  • the pixel values of all the pixels constituting the character candidate components 16, 17, 18 are 54
  • step S306 the removing unit 25 removes the character candidate components 12, 13, 14, and 15 that include many exceptional pixels. Other character candidate components are not deleted.
  • the extraction unit 24 initializes pixel values in the segmented area in the output image (step S400).
  • the divided area is the divided area selected by the dividing unit 23 in step S102.
  • the output image is an image having the same width and height as the image data, and the values of the start position and end position of the segmented area in the output image are the same as those of the image data. Also, when initializing the output image, 0 is substituted for the pixel value.
  • the pixel measuring unit 26 configures the character candidate components belonging to the respective character candidate component sets for the character candidate component sets C 0 , C 1 ,.
  • the total number of pixels to be calculated is calculated.
  • Equation 11 S i, j is the number of pixels constituting the character candidate component C i, j , and S i is the total number of pixels in the character candidate component set C i when the pixel value is i.
  • the difference between the maximum number of pixels and the second largest number of pixels may be an absolute value of the difference between the maximum value of the total number and the second total number. May be a ratio between the maximum value of the second and the second total number, or may be another value indicating a difference in size between the maximum value of the total number and the other total number.
  • whether there is a sufficient difference is determined by whether the obtained difference exceeds a threshold value.
  • the threshold value may be a predetermined value or may be obtained automatically. In the present embodiment obtains the threshold value t s using Expression 12 as an example.
  • R s is 0.2 in this embodiment be a predetermined parameter in equation 12.
  • max is a function that outputs the maximum value among the arguments. That is, the max function in Equation 12 outputs the maximum value among the total number of Nc pixel values.
  • N c 2
  • FIG. 8D shows a character candidate component set C 0
  • FIG. 8H shows a character candidate component set C 1 .
  • the number of black pixels in the character candidate component set C 0 shown in FIG. 8D is 14500
  • the number of black pixels in the character candidate component C 1 shown in FIG. 8H is 12700
  • the threshold value t s is 2900
  • the difference is
  • 1800, so the difference between S 0 and S 1 is equal to or less than the threshold value.
  • an edge pixel is a pixel that represents an edge or outline of a pixel constituting a character candidate component. Examples In the present embodiment, among the pixels that do not belong to the character candidate component set C i, the character candidate component C i, a pixel adjacent to j, the character candidate component C i, the edge pixels of j.
  • FIG. 12A shows edge pixels of the character candidate components C i, j belonging to the character candidate component set C 0 .
  • FIG. 12B shows edge pixels of the character candidate components C i, j belonging to the character candidate component set C 1 .
  • the extraction unit 24 selects a set of character candidate components to be written in the output image based on the value of the number of edge pixels (step S403). Specifically, the extraction unit 24 selects a character candidate component set C i having the smallest total number of edge pixels. In the present embodiment, the character candidate component set C 1 is selected.
  • the extraction unit 24 selects a set of character candidate components to be written in the output image based on the value of the number of pixels (step S404). . Specifically, extractor 24, the total number of pixels constituting a character candidate components belonging to the character candidate component set C i selects the largest character candidate component set C i.
  • Extraction unit 24 performs the plotting process to write to the output image on the storage unit 22 as a character pixels extracted pixels constituting the character candidate component set C i selected (step S405).
  • the coordinates of the start position of the segmented region are (x s , y s ), and the coordinates of all the pixels constituting the character candidate component C i, j in the converted image I B are (x, y).
  • 1 is assigned to the pixel value of the coordinates (x + x s , y + y s ) in the output image.
  • the image shown in FIG. 89 (h) is plotted as the output image written in step S405.
  • FIG. 14 shows a case where borders of different characters are in contact.
  • the entire image is sectioned as one section area by the section section 23.
  • character candidate component set C 1 shown in the state of (e) in FIG. 15 (h) is obtained by.
  • the image shown in FIG. 15H is finally written in the storage unit 22 as an output image.
  • FIG. 16 a case as shown in FIG. 16 will be described.
  • the entire image is sectioned as one section area by the section section 23.
  • character candidate component set C 1 shown in the state of (e) in FIG. 17 (h) is obtained by.
  • the image shown in FIG. 17D is finally written in the storage unit 22 as an output image.
  • FIG. 18 shows image data when handwritten character image data is input.
  • the output image of the normal character shown in FIG. 18B is obtained from the image data with the border shown in FIG.
  • the number of character pixels of the converted image at the gradation with the largest number of pixels and the character pixel of the converted image at the gradation with the second number of pixels is selected as the output image. If there is no significant difference between the number of character pixels of the converted image in the gradation having the largest number of pixels and the number of character pixels of the converted image in the gradation having the second number of pixels, the number of edge pixels is The character candidate component after the removal of the non-character component of the converted image at the smallest gradation is selected as the output image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)
  • Image Analysis (AREA)

Abstract

 画像処理装置は、文字画素数が最も多い階調の文字画素数と、文字画素数が2番目である階調の文字画素数との差分に有意の差異がある場合は、画素数が最も多い階調における非文字成分を除去後の文字候補成分を出力画像として選択するとともに、文字画素数が最も多い階調の文字画素数と、文字画素数が2番目である階調の文字画素数との差分に有意の差異がない場合は、エッジ画素数が最も少ない階調における非文字成分を除去後の文字候補成分を出力画像として選択する。

Description

画像処理装置、及び画像処理方法
 本発明の実施形態は、画像データから文字を抽出する画像処理装置、及び画像処理方法に関する。
 従来、画像データに縁取りされた文字が含まれている場合に、縁取り部分を除去して文字を抽出する技術が知られている。具体的な方法としては、画像データを二値画像へと変換した後に、各階調毎に文字を切り出して、切り出し後の文字が通常文字であるか、白抜文字であるかを判定し、白抜き文字である場合は、通常文字に変換する画像補正を行って、文字を取得する技術がある。また、画像データに対して、複数の文字認識辞書を参照して文字認識を実行し、それぞれの実行結果の文字としての信頼度を計算し、信頼度が高い認識結果を選択する技術も存在している。
特開平11-161739号公報 特開2009-199276号公報
 しかしながら、従来の画像処理による文字抽出にあっては、縁取りが太い場合や、文字同士が接触している場合に、文字の切り出しが困難な場合が存在していた。また、文字認識辞書を用いる場合にあっては、複数の文字認識辞書を組みあわせて計算を行うため、計算量が増大する傾向にある。
 本発明は、上記に鑑みてなされたものであって、縁取りの態様にかかわらず、画像データから文字を適切に抽出することができる画像処理装置を提供することにある。
 上述した課題を解決し、目的を達成するために、本発明の画像処理装置は、画像データを取得する取得部と、予め定められた第1基準に基づいて、画像データから文字候補成分の集合を当該画像データの階調ごとに抽出する抽出部と、予め定められた第2基準に基づいて、文字候補成分の集合から非文字成分を除去する除去部とを備える。
 また、画像処理装置は、非文字成分を除去後の文字候補成分に含まれる画素数を表す文字画素数を計測する文字計測部と、非文字成分を除去後の文字候補成分と隣接するエッジ画素の画素数を表すエッジ画素数を計測するエッジ計測部と、を備える。
 そして、画像処理装置は、文字画素数が最も多い階調の文字画素数と、文字画素数が2番目である階調の文字画素数との差分に有意の差異がある場合は、非文字成分を除去した後の画素数が最も多い階調における文字候補成分を出力画像として選択する。また、画像処理装置は、文字画素数が最も多い階調の文字画素数と、文字画素数が2番目である階調の文字画素数との差分に有意の差異がない場合は、非文字成分を除去後のエッジ画素数が最も少ない階調における文字候補成分を出力画像として選択する。そして画像処理装置は、選択した出力画像を出力する。
実施形態において画像処理装置を含む画像処理システムの機能ブロック図である。 実施形態において画像処理の流れを示すフロー図である。 実施形態において画像データの一例を示す図である。 実施形態において区分処理の流れを示すフロー図である。 実施形態において小領域に分割された画像データの一例を示す図である。 実施領域において区分領域に区分された画像データの一例を示す図である。 実施形態において文字画素抽出処理の流れを示すフロー図である。 実施形態において文字画素抽出処理を行う際の変換画像の状態の推移を示した図である。 実施形態において変換画像の状態の一例を示した図である。 実施形態において変換画像の状態の一例を示した図である。 実施形態において出力画像を生成する処理の流れを示した図である。 実施形態において変換画像のエッジ画素を示した図である。 実施形態において出力される出力画像を示した図である。 実施形態において画像データの一例を示す図である。 実施形態において文字画素抽出処理を行う際の変換画像の状態の推移を示した図である。 実施形態において画像データの一例を示す図である。 実施形態において文字画素抽出処理を行う際の変換画像の状態の推移を示した図である。 実施形態において画像データの一例を示す図である。
 以下に、本発明にかかる画像処理装置の実施形態を図面に基づいて詳細に説明する。なお、この実施形態によりこの発明が限定されるものではない。図1は本実施形態の画像処理装置10を含む画像処理システム100の構成を示すブロック図である。
 図1に示されるように、この画像処理システム100は、画像処理装置10に対して、入力装置としてのスキャナ1、手書き入力部2、および、HDDレコーダ3等が接続されている。画像処理装置10には、これらの入力装置からの画像データが入力される。
 画像処理装置10は、CPU、メモリ、ハードディスク、入出力インターフェースなどの汎用的なハードウェアを備えるものである。画像処理装置10は、画像取得部21、記憶部22、区分部23、抽出部24、除去部25、画素計測部26、エッジ計測部27、及び出力部28を備えている。記憶部22は、記憶メモリやハードディスクにより実現されている。また、画像取得部21、区分部23、抽出部24、除去部25、画素計測部26、エッジ計測部27、及び出力部28は、例えばハードディスクに記憶された画像処理プログラムの機能として実現されている。
 画像取得部21は入力装置から入力される処理対象の画像データを取得し、取得した画像データを記憶部22に書き込む。区分部23は、記憶部22から画像データを読み出し、画像データを1以上の区分領域に区分する。区分部23は、区分した画像データのそれぞれの区分領域における開始位置、及び終了位置の座標情報を記憶部22に書き込む。
 抽出部24は、画像データ、及び各区分領域の開始位置と終了位置とを、記憶部22から読み出し、それぞれの区分領域に含まれる画像データから文字画素を抽出して記憶部22に書き込む。除去部25は、抽出部24が抽出した文字画素から、縁取りや、非文字成分などを除去して、除去後の文字画素を記憶部22に書き込む。画素計測部26、及びエッジ計測部27は、文字候補成分に含まれる画素数を計測し、抽出部24と連携して機能する。詳細については後述する。出力部28は、記憶部22から出力画像として文字画素を読み出し、OHPなどの文字を認識することができる文字認識装置30に出力する。
 続いて、図2を参照して実施形態の画像処理システムの処理の流れを説明する。画像処理装置10は、入力装置から文字列の画像データを取得すると、取得した画像データを記憶部22に書き出す(ステップS100)。図3は画像データの一例を示しており、横幅1100画素、高さ215画素、取り得る画素値が0以上255以下のグレースケールの画像である。なお、画像データはカラー画像や二値画像であってもよい。次に、区分部23は記憶部22から画像データを読み出し、画像データを1以上の区分領域に区分し、画像データにおけるそれぞれの区分領域の開始位置、終了位置を記憶部22に書き出す。(ステップS101)。
 次に、抽出部24は、記憶部22から区分領域を1つ選択する(ステップS102)。本実施形態では、記憶部22に書き込まれた順に区分領域を選択する。続いて、抽出部24は、ステップS102で選択した区分領域内から後述する文字候補成分の集合を抽出し、除去部25が文字候補成分から後述する非文字成分を除去したうえで、該文字候補成分を構成する文字画素を記憶部22に書き出す文字画素抽出処理を実施する(ステップS103)。続いて、抽出部24は、ステップS102で選択した、区分領域を記憶部22から削除する(ステップS104)。文字画素抽出処理が完了した区分領域を削除することで、次のステップS102の区分領域の選択時には、記憶部22に次に記憶された区分領域が選択される。なお、文字画素抽出処理が完了した区分領域を削除するのではなく、例えばメモリアドレスのポインタを変更することで、次の区分領域を選択できるようにしてもよい。
 続いて、抽出部24は、全ての区分領域において文字画素抽出処理が実施されたか否かを判定する(ステップS105)。全ての区分領域において文字画素抽出処理が実施されたと判定された場合(ステップS105:Yes)、出力部28は記憶部22から文字画素を読み出し、文字認識装置30に出力画像として出力し、処理を終了する(ステップS106)。一方、全ての区分領域において文字画素抽出処理が実施されていないと判定された場合(ステップS105:No)、ステップS102からの処理を再度繰り返す。
 次に、ステップS101における、画像データを複数の区分領域に区分する処理について図4を用いて説明する。画像データを区分領域に区分する処理を行うためには、例えば、画像データを一定間隔で区切った領域を区分領域としたり、予め定めた色を含む領域を画像データから抽出して、抽出した領域をそれぞれ区分領域としたり、あるいは予め定めた位置や予め定めた形の領域を区分領域としたりといった方法を採ることができる。
 本実施形態では画像データの画素値が連続して類似している領域を画像データの区分領域とする。図4に示されるように、まず区分部23は、初期化処理を行う。(ステップS201)。初期化処理においては、区分部23は、画像データにおける読み取り方向に従って画像データを小領域数N個の等間隔に区分され区分領域よりも小さい小領域へと分割する。分割の際の間隔や分割数は、小領域の大きさが区分領域より小さくなる範囲で適宜設定すればよい。文字の読み取り方向は、予め定めておいてもよいし、自動的に判定してもよい。本実施形態においては、画像データの長辺が上辺および下辺であれば読み取り方向を横方向と判定し、左辺および右辺であれば読み取り方向を縦方向と判定する。図3の画像データでは画像の長辺は上辺および下辺であるため、読み取り方向は横方向である。
 また、パラメータとして、現在処理中の小領域の番号を示す変数であるiを0にする。また、区分領域の境界となる小領域の位置を示す変数であるbを0にする。また、区分領域の番号を示す変数であるsを0にする。
 図5は、小領域に分割された画像データ500の状態を示している。図5に示されるように、画像データ500は0~14までの合計15の小領域に分割されている。小領域数は予め定めた値であってもよいし、画像データの値を用いて算出してもよい。本実施形態においては、以下の式1を用いて小領域数Nを算出する。
Figure JPOXMLDOC01-appb-M000001
 式1において、sは画像データの短辺の長さ、lは画像の長辺の長さ、rはパラメータとして予め定めた値であり、integerは入力値を整数に変換する関数である。本実施形態においては、sは215画素、lは1100画素であり、rとして0.34が設定されており、計算の結果15となる。なお、図5においては画像データを互いに重複しない矩形の領域に分割する例を示したが、他の例として小領域が互いに重複するようにしてもよいし、矩形ではなく楕円や三角形など他の形状の領域に分割するようにしてもよい。
 次に、区分部23は、N個に分割された小領域について、領域ごとの画素値のヒストグラムを生成する(ステップS201)。図5において、符号501、502で示したグラフは、例として0番目と5番目の小領域における画素値のヒストグラムを模式的に表したものである。以降、i番目の小領域についてのヒストグラムをHと示し、0番目からN-1番目までの小領域についてのヒストグラムの集合をHと示す。
 続いて、区分部23は、b番目からi-1番目のヒストグラムを平均化したヒストグラムと、i番目のヒストグラムとの相違度dを算出する(ステップS202)。この際、bは、現在処理を行っている区分領域の開始位置を示す変数であるから、この算出した値は、ある小領域のヒストグラムが、区分領域に属するその小領域の直前の小領域までのヒストグラムとの間で、大きな画素値の傾向の変化があるか否かを示す値である。ここでは例として相違度dの算出に式2を用いる。
Figure JPOXMLDOC01-appb-M000002
 M(H、b、i-1)はi>0の場合に、ヒストグラムH、Hb+1、・・・、Hi-1を平均化したヒストグラムを出力し、i=0の場合は出力値が保証されない関数である。Dは第1引数と第2引数で与えられる2つのヒストグラムの相違度を出力する関数である。複数のヒストグラムを平均化するには、ヒストグラムの各ビンの値について平均値や中央値を算出することで実現する。本実施形態では例として各ビンに平均値を与えることとする。また、本実施形態では例として関数Dを式3のようにして実現する。
Figure JPOXMLDOC01-appb-M000003
 式3においてHA、jはヒストグラムHのj番目のビンの値を指し、HB、jはヒストグラムHのj番目のビンの値を指す。ただしjは0<j<Nの整数であり、Nはヒストグラムのビン数である。
 続いて、区分部23は、iが0より大きく、かつステップ算出した相違度dが予め定めた閾値t以上であるか否かを判定する(ステップS203)。iが0より大きく、相違度dが予め定めた閾値t以上であると判定された場合(ステップS203:Yes)、ヒストグラムの傾向が変わったことから、一つ手前までの小領域の集合を区分領域とし、区分部23はs番目の区分領域の開始位置と終了位置を決定して記憶部22に書き出す(ステップS204)。開始位置と終了位置の算出方法として、本実施形態では式4を用いる。
Figure JPOXMLDOC01-appb-M000004
 式4においてPは区分領域の開始位置と終了位置の集合、すなわちP={開始位置、終了位置}であり、Ps-1、1はs-1番目の区分領域の終了位置であり、aは開始位置および終了位置を調整するパラメータで予め定めた値であり、minは引数の内最小の値を出力する関数である。
 続いて、区分部23は、次の区分領域の開始位置として、bの値に現在のiの変数を代入するとともに、区分領域の番号であるSに1加算する(ステップS205)。そして、ステップS206に移行する。また、iが0である、または相違度dが予め定めた閾値t以上でないと判定された場合も(ステップS203:No)、ステップS206へと移行する。
 ステップS206においては、区分部23は、iを1増加し、次の小領域に対する処理へと移行する(ステップS206)。続いて、区分部23は、iがNと同値か否かを判定する(ステップS207)。iがNと同値である、すなわち全ての小領域に対する区分処理が終了したと判定された場合(ステップS207:Yes)、区分部23は、ステップ204と同様、区分領域の開始位置と終了位置の値を算出し、記憶部22に書き出すとともに、現在の区分数であるs+1を区分領域の総数として記憶部22に書き出し、処理を終了する(ステップS208)。一方、iがNと同値でないと判定された場合(ステップS207:No)、ステップS202からの処理を繰り返す。
 図3が画像データである場合、図5の分割された5番目までの小領域は互いに文字や縁取り、背景の輝度から算出されるヒストグラムの傾向が類似しているため、iが0≦i≦4の間はステップS202における相違度dは比較的小さな値となる。一方、6番目の小領域は左から5つ目までの小領域とは文字や縁取り、背景の輝度が異なる。そのため、i=5のとき相違度dは0≦i≦4のときよりも大きな値となる。したがって、0≦i≦4の場合は、dが予め設定した閾値tを下回り、i=5の場合にdがT以上となることから、図6に示されるように、最初の第1区分領域510と、第2区分領域520とが、この例においては得られる。
 次に図7を参照してステップS103における文字画素抽出処理について説明する。図7に示されるように、まず、抽出部24は記憶部22から画像データ、及びステップS102において選択した区分領域の開始位置と終了位置とを読み出し、画像データの区分領域の範囲を二値画像に変換する(ステップS300)。以降、変換した画像データを変換画像Iとする。画像の変換には、例えば公知の色クラスタリング方法を用いてもよいし、公知の画像二値化方法を用いてもよいし、あるいは別の画像の二値化方法や多値化方法を用いてもよい。なお、二値画像ではなく、カラー画像やグレースケールの画像に変換してもよい。
 本実施形態においては、例として、もし区分領域の範囲にある画素の画素値が予め定めた閾値未満であれば画素値0、そうでなければ画素値1に変換し、変換した結果を変換画像Iとして書き出す。
 続いて、抽出部24は現在どの画素値の変換画像Iを処理中であるかを示す変数であるiを初期化して0とする。(ステップS301)。すなわち、iが0の場合は、画素値0の変換画像に対して処理を行っていることを意味し、iが1の場合は、画素値1の変換画像に対して処理を行っていることを意味する。本実施形態では、二値画像であることから、iの最大値は1であるが、カラー画像の場合はiの値は1よりも大きくなる。
 続いて、抽出部24は変換画像Iから文字候補成分を抽出し、文字候補成分の集合を取得する(ステップS302)。文字候補成分は、予め定めた第1基準に基づいて文字情報として認識される候補と判定された画素である。本実施形態では第1基準を例として、公知の画像の連結成分抽出方法によって定めて、文字候補成分を抽出する。このとき変換画像において画素値がi(本実施形態では0又は1)の画素を対象として連結成分を抽出することにより、画素値がiである画素を含む連結成分の集合を文字候補成分とする。また、抽出部24は、文字候補成分に対し、0から始まる連続した識別番号を割り当てる。
 このように本実施形態では変換画像Iにおいて画素値が同じ画素同士の連結成分を文字候補成分として抽出するが、画素値が類似した画素同士の連結成分を抽出してもよいし、画素値が奇数の画素同士や偶数の画素同士の連結成分を抽出するなど、別の基準によって連結成分を抽出する対象を決定してもよい。
 図8は、本実施形態における文字画素抽出処理を実施した際の変換画像Iの状態遷移を示した図である。ステップS302の処理を実施後の状態においては、図8(a)に示したように、i=0の場合には、区分領域から抽出された文字候補成分が黒画素に、文字候補成分以外の部分が白画素でそれぞれ構成されている。変換画像Iからは0番から9番までの合計10個の文字候補成分が抽出される。
 以降、ステップS302の文字候補成分の抽出処理によって得られる画素値がiの際の文字候補成分の集合をCと示す。文字候補成分の集合のことを文字候補成分集合とする。
 続いて、ステップS303~ステップS306の処理においては、文字候補成分集合Cから文字の部品らしくない文字候補成分、すなわち非文字成分を除去する処理が行われる。本実施形態においては、第2基準としては、文字候補成分の画像データにおける位置が他の文字候補成分と比較して例外的であるか否か、文字候補成分の大きさが他の文字候補成分と比較して例外的であるか否か、文字候補成分の線幅が他の文字候補成分と比較して例外的であるか否か、及び文字候補成分に含まれる画素数が他の文字候補成分と比較して例外的であるか否かといった基準が用いられている。ただし、各ステップにおいて除去すべき非文字成分が無い場合は、処理は行われない。
 除去部25は、位置が例外的な非文字成分を文字候補成分集合Cから除去する外接成分除去処理を行う(ステップS303)。本実施形態においては、例として変換画像Iの左端、右端、上端および下端といった画像の4端のいずれかの端部に画素を含む文字候補成分を非文字成分として文字候補成分集合Cから除去する。すなわち、通常の文字の場合、変換画像Iの上下左右の端部に文字の一部がかかることはないと考えられるため、このような端部の位置に画素を含む文字候補成分は非文字成分であると判定する。図8(a)においては、左端、右端、上端および下端の画素を含む文字候補成分は無いため、文字候補成分は除去されずに次のステップへと進む。
 続いて、除去部25は、大きさが例外的な文字候補成分を非文字成分として文字候補成分集合Cから除去する寸法基準除去を行う。(ステップS304)。本実施形態においては、例としてそれぞれの文字候補成分の周囲を囲む外接矩形の長辺の長さが閾値以上の文字候補成分を文字候補成分集合Cから除去する。この閾値は予め定めた値であってもよいし、自動的に求めてもよい。本実施形態においては、外接矩形の長辺の長さの閾値tは数式5を用いて算出する。
Figure JPOXMLDOC01-appb-M000005
 数式5においてsは画像データの短辺の長さであり、rはパラメータとして予め定めた実数の値であり、本実施形態では0.9である。この場合、図3で示した画像データの短辺の長さsは215画素であることから、式5に代入するとt=193となる。
 図9は、抽出された文字候補成分のうち、外接矩形の長辺の長さが大きい2つの文字候補成分の外接矩形を点線で示しており、また外接矩形の長辺の長さを記している。図9によると、文字候補成分0の外接矩形の長辺の長さは210であるからtを上回り、文字候補成分1は長辺の長さが165でtを上回らないため、ステップS304においては、文字候補成分0が除去される。
 続いて、除去部25は、線幅が例外的な文字候補成分を文字候補成分集合Cから除去する線幅除去処理を行う(ステップS305)。本実施形態では例として、線幅が上限の閾値を上回るか下限の閾値を下回る文字候補成分を文字候補成分集合Cから除去する。線幅の算出には例えば公知の近似的な算出方法(参考文献:電子情報通信学会技術研究報告PRMU2010-237-PRMU2010-296、P112記載)を用いる。具体的には式6を用いてCのj番目(0≦j≦9の整数)の文字候補成分Ci、jの線幅wi、jを算出する。
Figure JPOXMLDOC01-appb-M000006
 数式6において、Si、jは文字候補成分Ci、jを構成する画素数、Li、jは文字候補成分Ci、jの周長である。周長は例えば変換画像Iの白画素と接する黒画素の個数である。線幅の上限の閾値および下限の閾値は予め定めた値であってもよいし、自動的に求めてもよい。本実施形態では例として式7および式8によって線幅の上限の閾値tおよび下限の閾値tを算出する。
Figure JPOXMLDOC01-appb-M000007

Figure JPOXMLDOC01-appb-M000008
 式7および式8において、rとrはパラメータであり予め定めた値である。本実施形態においては、rは2.0rは0.6である。
 図10はステップS304の直後の文字候補成分を図示したものであり、文字候補成分6は、最も線幅が大きい文字候補成分であり、文字候補成分9は、最も線幅が小さい文字候補成分である。文字候補成分6は1380個の黒画素で構成され、白画素と接触する黒画素の数は150個である。また文字候補成分9は250個の黒画素で構成され、白画素と接触する黒画素の数は160個である。したがって、式6によれば文字候補成分6の線幅はおよそ18であり、文字候補成分9の線幅はおよそ3である。同様にして他の文字候補成分の線幅を算出すると、他の文字候補成分の線幅はそれぞれおよそ5である。したがって、rを2.0とし、rを0.6とした場合、tの値はおよそ12.4に、tの値がおよそ3.7になることから、本実施形態においては、文字候補成分6と文字候補成分9はステップS305において、削除される。図8(b)は、ステップS305による処理を終了後の変換画像の状態を示している。
 続いて、除去部25は文字候補成分集合Cに属する文字候補成分から、ステップs300における変換処理前の画像データ500における画素値がある値を基準として例外的な値である画素を多く含む文字候補成分を除去する色基準除去処理を行う(ステップS306)。画像データ500における画素値とは、文字候補成分を構成する画素と同位置に在る画像データ500の画素の値である。すなわち、画像データの任意の座標(x、y)の画素値をI(x、y)、区分領域の開始位置の座標を(xs、ys)とするとき、座標(x、y)に在るIの画素の画像データにおける画素値はI(x+x、 y+y)と示すことができる。I(x+x、 y+y)が例外的な値か否かを判定する方法としては、本実施形態においては、Cに属す全ての文字候補成分を構成する画素の画像データにおける画素値の平均mを算出し、mとI(x+x、 y+y)の差の絶対値が予め定めた閾値t以上か否かによって判定する方法を用いることができる。mの算出には、式9を用いる。
Figure JPOXMLDOC01-appb-M000009
 このようにして算出した平均mと、I(x+x、y+y)における画素値との差異を計算して、画像データおける画素値が例外的であるとされた画素を例外画素と示す。また、文字候補成分Ci、jが例外画素を多く含むか否かを判定する例として、本実施形態では式10を用いて得られる実数rが予め定めた閾値tを超えるか否かで判定する。この実施形態ではtを40と定め、tを0.5と定める。
Figure JPOXMLDOC01-appb-M000010
 式10においてei、jは文字候補成分Ci、jを構成する例外画素の個数である。図8(c)はステップS305の処理結果を示す図8(b)に画像データ500を重ねた図であるが、変換画像の文字候補成分を構成する画素はすべて同じ輝度であるため例外画素は無い。したがって、変換画像Iが図8(a)である場合は、ステップS306ではいずれの文字候補成分も除去されない。なお、例外画素であるか否かを判別するために、平均mではなく、画素値の中央値や、予め定めたパラメータを利用するようにしてもよい。
 続いて、抽出部24は、現在処理中である画素値を示す変数であるiを1増加した後に(ステップS307)、抽出部24は、iが変換画像における画素値の最大値N未満であるか否かを判定する(ステップS308)。変換画像はこの実施形態において二値の画像であるから、N=2である。
 iが変換画像における画素値の最大値N未満であると判定された場合(ステップS308:Yes)、ステップS302からの処理を再度繰り返す。一方、iが変換画像における画素値の最大値N未満でない場合(ステップS308:No)、抽出部24は、削除されていない文字候補成分から文字画素を抽出し、文字画素を記憶部22に出力画像として書き出す(ステップS309)。
 i=1の場合においては、ステップS302による文字候補成分の抽出処理においては、図8(e)に示すような文字候補成分が抽出される。図8(e)はi=1の時の文字候補成分を黒画素で示し、文字候補成分以外を白画素で示した図である。
 ステップS303における外接分成分の除去処理においては、除去部25は、変換画像Iの左端、右端、上端および下端の画素を含む文字候補成分を除去する。またステップS304では外接矩形の長辺の長さが閾値を越える文字候補成分が無いため、いずれの文字候補成分も削除されない。また、ステップS305では線幅が上限の閾値を上回ったり下限の閾値を下回ったりする文字候補成分が無いため、いずれの文字候補成分も削除されない。図8(f)はi=1のときステップS305までの処理を経た状態の文字候補成分を図示したものである。
 続くステップS306では、例外画素を多く含む文字候補成分が削除される。図8(g)は、図8(f)の変換画像に画像データを重ねたものであり、この場合文字候補成分16、17、18を構成するすべての画素の画素値は54であり、文字候補成分12、13、14、15を構成するすべての画素の画素値は194であり、mは68である。すなわち文字候補成分12、13、14、15を構成するすべての画素はその画素値とmとの差の絶対値がt=40以上であるから、文字候補成分12、13、14、15のそれぞれについて式10で算出されるrは1.0でt=0.5を上回る。したがって、ステップS306では除去部25は、例外画素を多く含む文字候補成分12、13、14、15を除去する。他の文字候補成分は削除されない。図8(h)はステップS306の処理の後に残った文字候補成分を図示したものである。この段階で、i=0、及び1の場合のそれぞれにおいて、非文字成分を除去した文字候補成分集合Cが得られる。
 次に図7におけるステップS309の出力画像生成処理について図11を用いて説明する。抽出部24は、出力画像における区分領域内の画素値を初期化する(ステップS400)。区分領域はステップS102において、区分部23が選択した区分領域である。また、出力画像は画像データと幅と高さが同じ画像であり、出力画像における区分領域の開始位置と終了位置の値は画像データと同じである。また、出力画像の初期化の際は画素値に0を代入する。
 続いて、画素計測部26はすべての画素値の階調における文字候補成分の集合C、C、・・・、CNC-1について、それぞれの文字候補成分集合に属する文字候補成分を構成する画素の総数を算出する。そして、抽出部24は、画素数が最も多い画素値の階調における変換画像Iの総画素数と、画素数が2番目に多い画素値の階調における変換画像Iの総画素数との間において、十分な差異があるか否かを判定する(ステップS401)。画素の総数は具体的には式11によって算出する。
Figure JPOXMLDOC01-appb-M000011
 式11において、Si、jは文字候補成分Ci、jを構成する画素数、Sは画素値がiの場合における、文字候補成分集合Cの画素数の総数である。各画素値における文字候補成分集合Cのうち、最大の画素数と2番目に大きい画素数の差異は、総数の最大値と2番目の総数の差の絶対値であってもよいし、総数の最大値と2番目の総数の比であってもよいし、総数の最大値と他の総数同士の大きさの違いを示す他の値であってもよい。
 十分な差異があるかは、本実施形態では求めた差異が閾値を上回るか否かで判定する。閾値は予め定めた値であってもよいし、自動的に求めてもよい。本実施形態では例として式12を用いて閾値tを求める。
Figure JPOXMLDOC01-appb-M000012
 式12においてrは予め定めたパラメータであり本実施形態においては0.2である。maxは引数のうち、最大の値を出力する関数である。すなわち、式12中のmax関数はN個ある画素値の総数のうち、最大値を出力する。本実施形態においては、Nc=2であり、図8(d)は、文字候補成分集合Cを示しており、図8(h)は、文字候補成分集合C1を示している。
 図8(d)に示した文字候補成分集合Cにおける黒画素の個数は14500個であり、図8(h)に示した文字候補成分Cにおける黒画素の個数は12700個であり、S=14500、S=12700である。この場合、閾値であるtsは2900であり、一方、差異は|S-S|=1800であることから、SとSの差異が閾値以下となる。
 画素の総数の差異が閾値以下であると判定された場合(ステップS401:Yes)、エッジ画素計測部27は、それぞれの文字候補成分集合Cに属する文字候補成分を構成する画素のエッジ画素を計数し、該エッジ画素の総数を算出する(ステップS402)。エッジ画素とは文字候補成分を構成する画素のエッジや輪郭などを表現する画素である。本実施形態では例として、文字候補成分集合Cに属さない画素のうち、文字候補成分Ci、jに隣接する画素を、文字候補成分Ci、jのエッジ画素とする。
 図12(a)は、文字候補成分集合Cに属する文字候補成分Ci、jのエッジ画素を示している。また、図12(b)は、文字候補成分集合Cに属する文字候補成分Ci、jのエッジ画素を示している。このとき、各エッジ画素の画素数を示す変数をEとすると、E=5600であり、E=2800である。
 続いて、抽出部24は出力画像に書き出す文字候補成分の集合をエッジ画素の画素数の値に基づいて選択する(ステップS403)。具体的には、抽出部24は、エッジ画素の総数が最も小さい文字候補成分集合Cを選択する。本実施形態においては、文字候補成分集合Cが選択される。
 一方、画素の総数の差異が閾値以下でないと判定された場合(ステップS401:No)、抽出部24は出力画像に書き出す文字候補成分の集合を画素数の値に基づいて選択する(ステップS404)。具体的には、抽出部24は、文字候補成分集合Cに属する文字候補成分を構成する画素の総数が最も大きい文字候補成分集合Cを選択する。
 抽出部24は選択した文字候補成分集合Cを構成する画素を抽出した文字画素として記憶部22上の出力画像に書き出すプロット処理を行う(ステップS405)。本実施形態においては、区分領域の開始位置の座標を(x、y)とし、変換画像Iにおいて文字候補成分Ci、jを構成するすべての画素の座標を(x、y)としたとき、出力画像における座標(x+x、y+y)の画素値に1が代入される。本実施形態においては、図89(h)で示された画像が、ステップS405によって書き出された出力画像としてプロットされる。
 図6における区分領域520に対しても、同様の文字画素抽出処理を行うと、図13に示す画像データ全体の出力画像が記憶部22に書き出される。
 また、別の画像データに対して処理をおこなった結果について図14を用いて説明する。図14は、異なる文字の縁取りが接触している場合である。この場合、区分部23によって画像全体が1つの区分領域として区分される。そして、i=0の場合においては、抽出部24によって図15の(a)の状態から(d)に示される文字候補成分集合Cが得られ、i=1の場合においては、抽出部24によって図15の(e)の状態から(h)に示される文字候補成分集合Cが得られる。そして、この場合、図15(h)で示される画像が最終的に出力画像として記憶部22に書き出される。
 また、別の例として図16に示されるような場合について説明する。この場合、区分部23によって画像全体が1つの区分領域として区分される。そして、i=0の場合においては、抽出部24によって図17の(a)の状態から(d)に示される文字候補成分集合Cが得られ、i=1の場合においては、抽出部24によって図17の(e)の状態から(h)に示される文字候補成分集合Cが得られる。そして、この場合、図17(d)で示される画像が最終的に出力画像として記憶部22に書き出される。
 また、図18は、手書きによる文字の画像データが入力された場合の画像データを示している。本実施形態においては、図18(a)に示した縁取りのある画像データから、図18(b)に示した通常文字の出力画像が得られる。
 以上に示した、本実施の形態の画像処理装置10にあっては、画素数が最も多い階調における変換画像の文字画素数と、画素数が2番目である階調における変換画像の文字画素数との差分に有意の差異がある場合は、画素数が最も多い階調における非文字成分を除去後の文字候補成分を出力画像として選択する。また、画素数が最も多い階調における変換画像の文字画素数と、画素数が2番目である階調における変換画像の文字画素数との差分に有意の差異がない場合は、エッジ画素数が最も少ない階調における変換画像の非文字成分を除去後の文字候補成分を出力画像として選択することとした。
 このように出力画像を選択する場合は、縁取りが重なる場合であっても、適切に縁取りが除去された通常文字による出力画像が得られるようになる。また、処理の際に文字認識辞書を用いて計算を行うことを必要としないため、処理負担も軽減することができる。
 さらには、画素の傾向が異なる領域ごとに区分し、画像の変換処理を行うようにしたため、文字候補成分の抽出や、非文字成分の除去を効率的に行うことができる。
 以上に、本発明の実施形態を説明したが、これらの実施形態は、例として提示したものであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や要旨に含まれるとともに、請求の範囲に記載された発明とその均等の範囲に含まれる。
 1 スキャナ
 2 手書き入力部
 3 レコーダ
 10 画像処理装置
 21 画像取得部
 22 記憶部
 23 区分部
 24 抽出部
 25 画素計測部
 26 エッジ計測部
 27 出力部
 30 文字認識装置
 500 画像データ
 510 区分領域
 520 区分領域

Claims (6)

  1.  画像データを取得する取得部と、
     予め定められた第1基準に基づいて、前記画像データから文字候補成分の集合を当該画像データの階調ごとに抽出する抽出部と、
     予め定められた第2基準に基づいて、前記文字候補成分の集合から非文字成分を除去する除去部と、
     前記非文字成分を除去後の前記文字候補成分に含まれる画素数を表す文字画素数を計測する文字計測部と、
     前記非文字成分を除去後の前記文字候補成分と隣接するエッジ画素の画素数を表すエッジ画素数を計測するエッジ計測部と、
     前記文字画素数が最も多い前記階調の前記文字画素数と、前記文字画素数が2番目である前記階調の前記文字画素数との差分に有意の差異がある場合は、前記画素数が最も多い階調における前記非文字成分を除去後の前記文字候補成分を出力画像として選択するとともに、前記文字画素数が最も多い前記階調の前記文字画素数と、前記文字画素数が2番目である前記階調の前記文字画素数との差分に有意の差異がない場合は、前記エッジ画素数が最も少ない階調における前記非文字成分を除去後の前記文字候補成分を出力画像として選択する出力画像選択部と、
     選択された前記出力画像を出力する出力部と、
     を備えることを特徴とする画像処理装置。
  2.  前記除去部は、前記文字候補成分の前記画像データにおける位置が他の前記文字候補成分と比較して例外的な場合、前記文字候補成分の大きさが他の前記文字候補成分と比較して例外的な場合、前記文字候補成分の線幅が他の前記文字候補成分と比較して例外的な場合、及び前記文字候補成分に含まれる前記画素数が他の前記文字候補成分と比較して例外的な場合の少なくとも一つの場合に、例外的な前記文字候補成分を前記非文字成分として前記集合から除去する
     ことを特徴とする請求項1に記載の画像処理装置。
  3.  取得した前記画像データを二値画像へと変換する変換部と、
     を更に備えることを特徴とする請求項1に記載の画像処理装置。
  4.  取得した前記画像データを画素値の傾向毎にグループ化された1以上の区分領域へと分割する区分部と、
     を更に備え、
     前記抽出部は、前記文字候補成分の抽出を前記区分領域ごとに行うとともに、
     前記除去部は、前記文字候補成分の除去を前記区分領域ごとに行う
     ことを特徴とする請求項1~3のいずれか一項に記載の画像処理装置。
  5.  前記区分部は、前記画像データを前記区分領域より細かい1以上の小領域へと分割した後に、前記小領域ごとに前記画素値のヒストグラムを生成し、前記ヒストグラムの値が類似した前記小領域の集合を前記区分領域とする
     ことを特徴とする請求項4に記載の画像処理装置。
  6.  画像データを取得する取得ステップと、
     予め定められた第1基準に基づいて、前記画像データから文字候補成分の集合を当該画像データの階調ごとに抽出する抽出ステップと、
     予め定められた第2基準に基づいて、前記文字候補成分の集合から非文字成分を除去する除去ステップと、
     前記非文字成分を除去後の前記集合に含まれる画素数を計測する文字計測ステップと、
     前記非文字成分を除去後の前記集合と隣接する画素であるエッジ画素の画素数を計測するエッジ計測ステップと、
     前記文字画素数が最も多い前記階調の前記文字画素数と、前記文字画素数が2番目である前記階調の前記文字画素数との差分に有意の差異がある場合は、前記画素数が最も多い階調における前記非文字成分を除去後の前記文字候補成分を出力画像として選択するとともに、前記文字画素数が最も多い前記階調の前記文字画素数と、前記文字画素数が2番目である前記階調の前記文字画素数との差分に有意の差異がない場合は、前記エッジ画素数が最も少ない階調における前記非文字成分を除去後の前記文字候補成分を出力画像として選択する出力画像選択ステップと、
     前記出力画像を出力する出力ステップと、
     を実施することを特徴とする画像処理方法。
PCT/JP2012/068631 2012-03-16 2012-07-23 画像処理装置、及び画像処理方法 WO2013136546A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201280070746.9A CN104137119B (zh) 2012-03-16 2012-07-23 图像处理装置及图像处理方法
US14/461,511 US9275279B2 (en) 2012-03-16 2014-08-18 Image processing apparatus and image processing method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2012-060447 2012-03-16
JP2012060447A JP5547226B2 (ja) 2012-03-16 2012-03-16 画像処理装置、及び画像処理方法

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/461,511 Continuation US9275279B2 (en) 2012-03-16 2014-08-18 Image processing apparatus and image processing method

Publications (1)

Publication Number Publication Date
WO2013136546A1 true WO2013136546A1 (ja) 2013-09-19

Family

ID=49160505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2012/068631 WO2013136546A1 (ja) 2012-03-16 2012-07-23 画像処理装置、及び画像処理方法

Country Status (4)

Country Link
US (1) US9275279B2 (ja)
JP (1) JP5547226B2 (ja)
CN (1) CN104137119B (ja)
WO (1) WO2013136546A1 (ja)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6303671B2 (ja) * 2014-03-20 2018-04-04 富士ゼロックス株式会社 画像処理装置及び画像処理プログラム
JP6370080B2 (ja) * 2014-04-02 2018-08-08 キヤノン株式会社 画像処理装置、画像処理方法及びプログラム。
US9183636B1 (en) * 2014-04-16 2015-11-10 I.R.I.S. Line segmentation method
CN107680028B (zh) * 2016-08-01 2020-04-21 北京百度网讯科技有限公司 用于缩放图像的处理器和方法
JP6671613B2 (ja) * 2017-03-15 2020-03-25 ソフネック株式会社 文字認識方法及びコンピュータプログラム
JP6903966B2 (ja) * 2017-03-16 2021-07-14 富士フイルムビジネスイノベーション株式会社 情報処理装置、情報処理システム及びプログラム
CN108876351A (zh) * 2018-07-05 2018-11-23 周爱霞 公交车即时金额支付系统
US11961316B2 (en) * 2022-05-10 2024-04-16 Capital One Services, Llc Text extraction using optical character recognition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030188A (ja) * 2002-06-25 2004-01-29 Matsushita Electric Works Ltd 画像の領域分割方法、画像の領域分割装置、画像の領域分割プログラム
JP2005004334A (ja) * 2003-06-10 2005-01-06 Ricoh Co Ltd 画像処理装置、画像処理方法及び該方法の実行に用いるプログラム
JP2005285006A (ja) * 2004-03-30 2005-10-13 Toshiba Solutions Corp 画像処理装置および画像処理方法
JP2008191906A (ja) * 2007-02-05 2008-08-21 Fujitsu Ltd テロップ文字抽出プログラム、記録媒体、方法及び装置

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11161739A (ja) 1997-11-25 1999-06-18 Oki Electric Ind Co Ltd 文字認識装置
EP1104174A4 (en) * 1998-06-09 2006-08-02 Matsushita Electric Ind Co Ltd IMAGE CODERS, IMAGE DECODERS, CHARACTERS AND DATA STORAGE MEDIUM
CN1310182C (zh) * 2003-11-28 2007-04-11 佳能株式会社 用于增强文档图像和字符识别的方法和装置
JP2008227759A (ja) * 2007-03-09 2008-09-25 Sharp Corp 画像処理装置、画像形成装置、画像処理方法、画像処理プログラムおよびコンピュータ読み取り可能な記録媒体
JP5029412B2 (ja) 2008-02-20 2012-09-19 富士通株式会社 テロップ文字パターン抽出プログラム、テロップ文字パターン抽出装置、およびテロップ文字パターン抽出方法
JP5672059B2 (ja) * 2011-02-24 2015-02-18 富士通株式会社 文字認識処理装置および方法並びに文字認識処理プログラム

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004030188A (ja) * 2002-06-25 2004-01-29 Matsushita Electric Works Ltd 画像の領域分割方法、画像の領域分割装置、画像の領域分割プログラム
JP2005004334A (ja) * 2003-06-10 2005-01-06 Ricoh Co Ltd 画像処理装置、画像処理方法及び該方法の実行に用いるプログラム
JP2005285006A (ja) * 2004-03-30 2005-10-13 Toshiba Solutions Corp 画像処理装置および画像処理方法
JP2008191906A (ja) * 2007-02-05 2008-08-21 Fujitsu Ltd テロップ文字抽出プログラム、記録媒体、方法及び装置

Also Published As

Publication number Publication date
CN104137119B (zh) 2017-10-13
JP2013196136A (ja) 2013-09-30
US20140355896A1 (en) 2014-12-04
JP5547226B2 (ja) 2014-07-09
CN104137119A (zh) 2014-11-05
US9275279B2 (en) 2016-03-01

Similar Documents

Publication Publication Date Title
JP5547226B2 (ja) 画像処理装置、及び画像処理方法
CN110008809B (zh) 表格数据的获取方法、装置和服务器
CN105469027B (zh) 针对文档图像的水平和垂直线检测和移除
JP4771804B2 (ja) レイアウト解析プログラム、レイアウト解析装置、レイアウト解析方法
JP5455038B2 (ja) 画像処理装置、画像処理方法、及びプログラム
US8947736B2 (en) Method for binarizing scanned document images containing gray or light colored text printed with halftone pattern
US9275030B1 (en) Horizontal and vertical line detection and removal for document images
JP4761996B2 (ja) 文字分割プログラム、文字分割装置および文字分割方法
US10699110B2 (en) Image processing apparatus, image processing method, and non-transitory recording medium storing program for causing computer to execute image processing method
US9928417B2 (en) Imaging process for binarization and punched hole extraction
JP2002133426A (ja) 多値画像から罫線を抽出する罫線抽出装置
EP2645332A2 (en) Image processing device that separates image into plural regions
JP2010218420A (ja) 文字認識装置、画像読取装置、およびプログラム
WO2021190155A1 (zh) 文本行中的空格识别方法、装置、电子设备及存储介质
JP2011248702A (ja) 画像処理装置、画像処理方法、画像処理プログラム及びプログラム記憶媒体
US8452095B2 (en) Image processing for post-processing rate of character rectangle extraction and character recognition accuracy
US20100225984A1 (en) Image processing apparatus and image forming apparatus
CN110321887B (zh) 文档图像处理方法、文档图像处理装置及存储介质
US20180005028A1 (en) Method for recognizing table and flowchart in document images
KR101571681B1 (ko) 동질 영역을 이용한 문서 구조의 분석 방법
JP5005732B2 (ja) 画像形成装置及び画像処理方法
KR20150099116A (ko) Ocr를 이용한 컬러 문자 인식 방법 및 그 장치
US11570331B2 (en) Image processing apparatus, image processing method, and storage medium
JP2012222581A (ja) 画像処理装置、画像処理方法、プログラム、及び記憶媒体
CN111160358A (zh) 一种图像二值化方法、装置、设备、介质

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: 12871060

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12871060

Country of ref document: EP

Kind code of ref document: A1