WO2020089985A1 - 画像処理装置、制御方法及び制御プログラム - Google Patents

画像処理装置、制御方法及び制御プログラム Download PDF

Info

Publication number
WO2020089985A1
WO2020089985A1 PCT/JP2018/040188 JP2018040188W WO2020089985A1 WO 2020089985 A1 WO2020089985 A1 WO 2020089985A1 JP 2018040188 W JP2018040188 W JP 2018040188W WO 2020089985 A1 WO2020089985 A1 WO 2020089985A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
area
character
brightness
low
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/JP2018/040188
Other languages
English (en)
French (fr)
Inventor
継司 本田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
PFU Ltd
Original Assignee
PFU Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by PFU Ltd filed Critical PFU Ltd
Priority to PCT/JP2018/040188 priority Critical patent/WO2020089985A1/ja
Priority to JP2020554629A priority patent/JP7106672B2/ja
Publication of WO2020089985A1 publication Critical patent/WO2020089985A1/ja
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/10Image acquisition

Definitions

  • the present disclosure relates to an image processing device, a control method, and a control program, and more particularly, to an image processing device, a control method, and a control program for processing an image of a document including high-intensity characters on a low-intensity background.
  • Patent Document 1 There is disclosed a character recognition device that detects a white character portion of an image, inverts the detected white character portion in black and white, and performs character recognition processing on the inverted image portion.
  • the low brightness It is necessary to correctly identify the background area.
  • a form includes ruled lines
  • An object of an image processing device, a control method, and a control program is to enable good detection of characters from an image of a document including a low-brightness background, high-brightness characters on the low-brightness background, and ruled lines. ..
  • An image processing apparatus includes an acquisition unit that acquires a multi-valued image of a document including a low-brightness background, high-brightness characters on the low-brightness background, and a plurality of ruled lines, and a multi-valued image.
  • a binary image generation unit that generates a binary image that is a binarized image
  • a ruled line removal image generation unit that generates a ruled line removal image that removes multiple ruled line components from the binary image, and black pixels in the ruled line removal image.
  • Area detection unit for detecting the connection area to be connected, the relationship between the size of the plurality of connection areas detected by the area detection unit, the relationship between the positions of the plurality of connection areas, or the distance between the plurality of connection areas Based on at least one of the above, in a multi-valued image, a combining unit that combines a plurality of connected regions, and in a multi-valued image, a gradation value of a low-brightness background region and a high-brightness character region in a region corresponding to the combined connected region. Reverse to generate a reverse image with the relationship with the gradation value reversed It has an image generation unit, and a character detecting section for detecting a character from the reverse image, and an output unit for outputting information relating to the detected characters, a.
  • a control method is a control method for an image processing apparatus having an output unit, wherein the image processing apparatus includes a low-luminance background, high-luminance characters on the low-luminance background, and a plurality of ruled lines.
  • the reverse image is generated by reversing, and the characters are detected and detected from the reverse image. And outputting the information about the character from the output unit.
  • a control program is a control program for a computer having an output unit, and images a document including a low-luminance background, high-luminance characters on the low-luminance background, and a plurality of ruled lines. Acquires a multi-valued image, generates a binary image by binarizing the multi-valued image, generates a ruled line removal image by removing multiple ruled line components from the binary image, and connects black pixels in the ruled line removal image.
  • Detecting a connected area the relationship of the size of the plurality of connected areas detected, the relationship of the position of the plurality of connected areas, or based on at least one of the distance between the plurality of connected areas, a plurality of In the multi-valued image, the relationship between the gradation value of the low-brightness background area and the gradation value of the high-brightness character area in the area corresponding to the connected area combined by the combining unit is reversed in the multi-valued image. Generate a reverse image and detect characters from the reverse image. And to execute to output from the output unit information about the detected character to the computer.
  • the image processing device, the control method, and the control program can satisfactorily detect a character from an image of a document including a low-brightness background, a high-brightness character on the low-brightness background, and a ruled line.
  • FIG. 1 is a diagram showing a schematic configuration of an image processing system 1 according to an embodiment. It is a figure which shows schematic structure of the 2nd memory
  • 3 is a schematic diagram showing an example of a multi-valued image 500.
  • FIG. It is a schematic diagram which shows an example of the binary image 510.
  • 6 is a schematic diagram showing an example of a binary image 600.
  • FIG. 9 is a schematic diagram showing an example of ruled line removal image 610.
  • FIG. 7 is a schematic diagram showing an example of ruled line removed image 700. 7 is a schematic diagram showing an example of ruled line removed image 720.
  • FIG. 9 is a schematic diagram showing an example of a reverse image 800.
  • FIG. 9 is a schematic diagram showing an example of a reverse binary image 810.
  • 3 is a block diagram showing a schematic configuration
  • FIG. 1 is a diagram showing a schematic configuration of an image processing system according to the embodiment. As shown in FIG. 1, the image processing system 1 includes an image reading device 100 and an information processing device 200.
  • the image reading device 100 is, for example, a scanner device or the like.
  • the image reading device 100 is connected to the information processing device 200.
  • the information processing device 200 is an example of an image processing device, and is, for example, a personal computer or the like.
  • the image reading device 100 includes a first interface device 101, an image pickup device 102, a first storage device 110, and a first CPU (Control Processing Unit) 120.
  • the first interface device 101 has an interface circuit conforming to a serial bus such as USB (Universal Serial Bus), and is electrically connected to the information processing device 200 to transmit and receive image data and various information. Further, instead of the first interface device 101, a communication device having an antenna for transmitting / receiving a wireless signal and a wireless communication interface circuit for transmitting / receiving a signal through a wireless communication line according to a predetermined communication protocol may be used. Good.
  • the predetermined communication protocol is, for example, a wireless LAN (Local Area Network).
  • the image pickup device 102 has a reduction optical system type image pickup sensor including an image pickup element formed by a CCD (Charge Coupled Device) linearly arranged in the main scanning direction. Further, the image pickup apparatus 102 has a light source that emits light, a lens that forms an image on the image pickup element, and an A / D conversion that amplifies an electric signal output from the image pickup element and performs analog / digital (A / D) conversion. And a vessel. In the image pickup apparatus 102, an image pickup sensor picks up an image of the surface of a conveyed document to generate and output an analog image signal, and an A / D converter digitally converts the analog image signal by A / D conversion. The input image of is generated and output.
  • CCD Charge Coupled Device
  • the input image is a color multi-valued image in which each pixel data has a total of 24 bits of R (red) value, G (green) value, and B (blue) value represented by 8 bits for each color of RGB.
  • a CIS Contact Image Sensor
  • CMOS Complementary Metal Oxide Semiconductor
  • the first storage device 110 has a memory device such as a RAM (Random Access Memory) and a ROM (Read Only Memory), a fixed disk device such as a hard disk, or a portable storage device such as a flexible disk and an optical disk. Further, the first storage device 110 stores computer programs, databases, tables, etc. used for various processes of the image reading device 100.
  • the computer program may be installed in the first storage device 110 from a computer-readable portable recording medium using a known setup program or the like.
  • the portable recording medium is, for example, a CD-ROM (compact disk read only memory), a DVD-ROM (digital versatile disk read only memory), or the like.
  • the first storage device 110 stores the input image and the like generated by the imaging device 102.
  • the first CPU 120 operates based on a program stored in the first storage device 110 in advance.
  • a DSP digital signal processor
  • an LSI large scale integration
  • an ASIC Application Specific Integrated Circuit
  • an FPGA Field-Programming Gate Array
  • the first CPU 120 is connected to the first interface device 101, the imaging device 102, the first storage device 110, etc., and controls each of these units.
  • the first CPU 120 performs document reading control of the imaging device 102, data transmission / reception control with the information processing device 200 via the first interface device 101, and the like.
  • the information processing device 200 includes a second interface device 201, an input device 202, a display device 203, a second storage device 210, a second CPU 220, and a processing device 230.
  • a second interface device 201 an input device 202, a display device 203, a second storage device 210, a second CPU 220, and a processing device 230.
  • each unit of the information processing device 200 will be described in detail.
  • the second interface device 201 has the same interface circuit as the first interface device 101 of the image reading device 100, and connects the information processing device 200 and the image reading device 100. Further, instead of the second interface device 201, a communication device having an antenna for transmitting / receiving a wireless signal and a wireless communication interface circuit for transmitting / receiving a signal through a wireless communication line according to a predetermined communication protocol such as a wireless LAN is provided. It may be used.
  • the input device 202 has an input device such as a keyboard and a mouse and an interface circuit that acquires a signal from the input device, and outputs a signal according to a user operation to the second CPU 220.
  • the display device 203 is an example of an output unit.
  • the display device 203 has a display composed of liquid crystal, organic EL, and the like, and an interface circuit for outputting image data to the display.
  • the display device 203 is connected to the second storage device 210 and stored in the second storage device 210. Is displayed on the display.
  • the second storage device 210 has a memory device, a fixed disk device, a portable storage device, and the like similar to the first storage device 110 of the image reading device 100.
  • the second storage device 210 stores computer programs, databases, tables, etc. used for various processes of the information processing device 200.
  • the computer program may be installed in the second storage device 210 from a computer-readable portable recording medium such as a CD-ROM or a DVD-ROM using a known setup program or the like.
  • the second storage device 210 also stores the input image received from the image reading device 100, various processed images obtained by performing image processing on the input image by the processing device 230, and the like.
  • the second CPU 220 operates based on a program stored in the second storage device 210 in advance. Note that a DSP, LSI, ASIC, FPGA, or the like may be used instead of the second CPU 220.
  • the second CPU 220 is connected to the second interface device 201, the input device 202, the display device 203, the second storage device 210, the processing device 230, etc., and controls each of these parts.
  • the second CPU 220 performs data transmission / reception control with the image reading device 100 via the second interface device 201, input control of the input device 202, display control of the display device 203, control of image processing by the processing device 230, and the like.
  • the processing device 230 executes predetermined image processing on the input image.
  • the processing device 230 includes a CPU, DSP, LSI, ASIC, FPGA, or the like.
  • FIG. 2 is a diagram showing a schematic configuration of the second storage device 210 and the second CPU 220.
  • the acquisition program 211, the binary image generation program 212, the ruled line removal image generation program 213, the area detection program 214, the combination program 215, the reverse image generation program 216, and the reverse binary image are stored in the second storage device 210.
  • Each program such as the image generation program 217, the character detection program 218, and the output control program 219 is stored.
  • Each of these programs is a functional module implemented by software operating on the processor.
  • the second CPU 220 reads each program stored in the second storage device 210, and operates according to each read program.
  • the second CPU 220 causes the acquisition unit 221, the binary image generation unit 222, the ruled line removal image generation unit 223, the region detection unit 224, the combining unit 225, the reverse image generation unit 226, the reverse binary image generation unit 227, and the character detection. It functions as the unit 228 and the output control unit 229.
  • FIG. 3 is a flowchart showing the operation of image reading processing by the image reading apparatus 100.
  • the operation of the image reading process will be described below with reference to the flowchart shown in FIG.
  • the operation flow described below is executed mainly by the first CPU 120 in cooperation with each element of the image reading apparatus 100 based on a program stored in the first storage device 110 in advance.
  • the image capturing apparatus 102 generates an input image obtained by capturing a document such as a bill as a document, and stores it in the first storage device 110 (step S101).
  • This manuscript contains at least a low-intensity background with low brightness such as black, high-intensity characters with high brightness such as white arranged on the low-intensity background, and a plurality of ruled lines.
  • the brightness of the low brightness background is lower than the predetermined brightness
  • the brightness of the high brightness character is higher than the brightness of the low brightness background. That is, in the input image, the brightness value of the low brightness background area is lower than a predetermined brightness value (for example, 128), and the brightness value of the high brightness character area is higher than the brightness value of the low brightness background area.
  • the brightness of the ruled line is lower than the brightness of the high-luminance character similarly to the brightness of the low-luminance background.
  • the brightness value of the ruled line area is lower than the predetermined brightness value and the brightness value of the high-luminance character area. Lower.
  • This manuscript may further include a high-intensity background with high brightness such as white and low-intensity characters with low brightness such as black arranged on the high-intensity background.
  • the brightness of the high brightness background is higher than a predetermined brightness
  • the brightness of the low brightness character is lower than the brightness of the high brightness background. That is, in the input image, the brightness value of the high brightness background area is higher than the predetermined brightness value, and the brightness value of the low brightness character area is higher than the brightness value of the high brightness background area.
  • the first CPU 120 transmits the input image stored in the first storage device 110 to the information processing device 200 via the first interface device 101 (step S102), and ends the series of steps.
  • FIG. 4 is a flowchart showing the operation of the recognition processing by the information processing device 200.
  • the operation of the recognition process will be described below with reference to the flowchart shown in FIG.
  • the operation flow described below is executed mainly by the processing device 230 in cooperation with each element of the information processing device 200 based on a program stored in the second storage device 210 in advance.
  • the acquisition unit 221 acquires the input image as a multi-valued image from the image reading device 100 via the second interface device 201, and stores it in the second storage device 210 (step S201).
  • the acquisition unit 221 may generate a black-and-white multivalued image from the input image that is a color multivalued image, and may acquire it as a multivalued image.
  • the acquisition unit 221 calculates a brightness value for each pixel in the input image according to the following formula, and generates a monochrome multi-valued image in which the calculated brightness value is the gradation value of the pixel corresponding to each pixel. To do.
  • Luminance value 0.299 ⁇ (R value) + 0.587 ⁇ (G value) + 0.114 ⁇ (B value)
  • FIG. 5A is a schematic diagram showing an example of the multi-valued image 500.
  • the multi-valued image 500 includes a high brightness background area 501, a low brightness character area 502, a low brightness background area 503, a high brightness character area 504, and a plurality of ruled line areas 505. Be done.
  • the high-brightness background area 501 has a white color and high brightness.
  • the low-brightness character area 502 has a black color and a lower brightness than the high-brightness background area 501 has, and is arranged on the high-brightness background area 501.
  • the low-brightness background area 503 has a black color and a low brightness.
  • the high-brightness character area 504 has a white color and a higher brightness than the low-brightness background area 503 has, and is arranged on the low-brightness background area 503.
  • the ruled line area 505 has a black color and low brightness, and is continuous with the low brightness background area 503. At least a part of the low-intensity character area 502 and the high-intensity character area 504 is arranged within the range surrounded by the ruled line area 505.
  • the binary image generation unit 222 generates a binary image by binarizing the acquired multi-valued image (step S202).
  • the binary image generation unit 222 sets a binary image as an image in which a pixel having a gradation value of a first threshold value or more in a multi-valued image is a white pixel and a pixel having a gradation value of less than the first threshold value is a black pixel.
  • the first threshold value is set to a value between the gradation value of a pixel forming a general background and the gradation value of a pixel forming a character by a preliminary experiment.
  • the pixels corresponding to the low-luminance character, the low-luminance background and the ruled line in the multi-valued image become black pixels, and the pixels corresponding to the high-luminance background and the high-luminance character become white pixels.
  • the first threshold may be determined by Otsu's binarization process.
  • the brightness of the low-intensity background and high-intensity characters is different for each form.
  • the information processing apparatus 200 determines what relationship between the brightness of the low brightness background and the brightness of the high brightness character in the multi-valued image. Also, the low-luminance background and the high-luminance character can be distinguished well.
  • FIG. 5B is a schematic diagram showing an example of the binary image 510.
  • FIG. 5B shows a binary image 510 obtained by binarizing the multi-valued image 500 shown in FIG. 5A.
  • the pixels of the region 511 corresponding to the high-luminance background region 501 and the pixels of the region 514 corresponding to the high-luminance character region 504 are white pixels.
  • the pixels of the region 512 corresponding to the low-luminance character region 502 the pixels of the region 513 corresponding to the low-luminance background region 503, and the pixels of the region 515 corresponding to the ruled line region 505 are black. It is a pixel.
  • the ruled-line-removed image generation unit 223 determines, in the binary image, white pixels in the first connected region in which the black pixels are connected in the binary image, in which the horizontal and vertical lengths are less than the second threshold value. By converting into a binary image, the component of the low-luminance character is removed (step S203).
  • the ruled-line-removed image generation unit 223 identifies the first connected region by grouping black pixels in the binary image by labeling.
  • the ruled line removal image generation unit 223 extracts, as the removal target area, a first connection area having a horizontal length and a vertical length that is less than a second threshold value among the identified first connection areas.
  • the second threshold is set to a length on the image corresponding to the maximum horizontal and vertical lengths of characters used in a general form (for example, 40 points).
  • the second threshold value for comparison with the horizontal length of the first connection region and the second threshold value for comparison with the vertical length may be set to different values.
  • the ruled line removal image generation unit 223 converts each extracted removal target area (black pixel) into a white pixel in the binary image.
  • FIG. 6A is a schematic diagram showing an example of the binary image 600 from which the components of low-brightness characters have been removed.
  • the binary image 600 shown in FIG. 6A is an image in which the low-brightness character component is removed from the binary image 510 shown in FIG. 5B.
  • the binary image 600 only the pixels of the region 603 corresponding to the low-brightness background region 503 and the pixels of the region 605 corresponding to the ruled line region 505 remain as black pixels.
  • the pixels of the area 602 corresponding to the low-luminance character area 502 are converted into white pixels.
  • the ruled line removal image generation unit 223 generates a ruled line removal image in which the components of a plurality of ruled lines are removed from the binary image (step S204).
  • the ruled-line-removed image generation unit 223 converts the portion of the first connected region remaining in the binary image from which the low-brightness character component has been removed and having a horizontal or vertical length that is equal to or shorter than a predetermined value into a white pixel. By doing so, a ruled line removed image is generated.
  • the predetermined value is set to, for example, the length on the image corresponding to the maximum width (for example, 3 points) of the ruled line used in a general form.
  • the ruled line removal image generation unit 223 converts the black pixel into a white pixel to convert the white pixel into a white pixel. Inflate.
  • the ruled line removal image generation unit 223 can efficiently remove the ruled line component by expanding the white pixels in the binary image, and can reduce the processing load in the process of generating the ruled line removal image.
  • the ruled line removal image generation unit 223 extracts ruled line removal from each first connected region by extracting a portion whose horizontal or vertical length is a predetermined value or less and converting each extracted portion into a white pixel. Images may be generated.
  • FIG. 6B is a schematic diagram showing an example of ruled line removal image 610.
  • the ruled line removed image 610 shown in FIG. 6B is an image in which the ruled line components have been removed from the binary image 600 shown in FIG. 6A.
  • the ruled line removed image 610 in the ruled line removed image 610, only the pixels of the region 613 corresponding to the low-brightness background region 503 remain as black pixels, and the pixels of the region 615 corresponding to the ruled line region 505 are the pixels of the slight region 616. Are converted into white pixels, except for.
  • the area 614 corresponding to the high-intensity character area 504 is expanded together with the area corresponding to the high-intensity background area.
  • the region 617 corresponding to the high-luminance character region is expanded, so that the region 618 corresponding to the low-luminance background region and the region 619 are separated.
  • the ruled line removal image generation unit 223 removes noise components from the generated ruled line removal image (step S205).
  • the ruled line removal image generation unit 223 extracts, in the ruled line removal image, a black pixel whose horizontal or vertical continuous length is equal to or less than a predetermined number of pixels (for example, 2 pixels) as a noise component and converts it into a white pixel. To remove.
  • the ruled line removal image generation unit 223 can remove the slightly remaining ruled line component in the ruled line removal image.
  • the ruled line removal image generation unit 223 causes noise to occur in a region in which the black pixels are connected in the ruled line removal image and whose horizontal or vertical length is equal to or less than a predetermined length (for example, a length corresponding to 5 points). You may remove by extracting as a component and converting into a white pixel. Also by this, the ruled line removal image generation unit 223 can remove the slightly remaining ruled line components in the ruled line removal image.
  • the ruled line removal image generation unit 223 selects, as a noise component, an area in which the ratio of the number of black pixels to the total number of pixels in the area surrounded by the black pixels in the ruled line removal image is less than a predetermined ratio. May be removed by converting into white pixels.
  • the predetermined ratio is set to, for example, the maximum value (for example, 33%) of the ratio of characters or pattern portions in a commonly used seal stamp. Accordingly, the ruled line removal image generation unit 223 can remove components such as a seal stamp from the ruled line removal image.
  • FIG. 7A is a schematic diagram showing an example of ruled line removed image 700 from which noise components have been removed.
  • the ruled line removal image 700 shown in FIG. 7A is an image in which noise components have been removed from the ruled line removal image 610 shown in FIG. 6B.
  • the ruled line removed image 700 only the pixels in the region 703 corresponding to the low-brightness background region 503 remain as black pixels, and all the pixels in the region 706 corresponding to the ruled line region 505 are converted to white pixels. There is.
  • the area detection unit 224 detects the second connected area where the black pixels are connected in the ruled line removed image (step S206).
  • the 2nd connection field is only called a connection field.
  • the ruled line removal image generation unit 223 detects connected regions by grouping black pixels in the ruled line removal image from which noise components have been removed by labeling.
  • the combining unit 225 combines the plurality of connected regions detected by the region detection unit 224 (step S207).
  • the joining unit 225 joins the connection areas based on at least one of the size relationship of the connection areas, the position relationship of the connection areas, or the distance between the connection areas.
  • the combining unit 225 extracts all combinations of two connected areas of the detected connected areas.
  • the combining unit 225 determines, for each extracted combination, whether or not the two connected regions of each combination satisfy a predetermined condition.
  • the first condition among the predetermined conditions is that the difference in length between the two connected regions in the predetermined direction is equal to or smaller than a predetermined difference (for example, 2 pixels).
  • the second condition of the predetermined conditions is that the distance between the center positions of the two connected regions in the predetermined direction is equal to or less than the first predetermined distance (for example, 2 pixels).
  • the third condition of the predetermined conditions is that the two connection regions do not overlap each other in the direction orthogonal to the predetermined direction and the distance between the two connection regions is the second predetermined distance (for example, 3 pixels) or less.
  • the predetermined direction is the horizontal direction and / or the vertical direction.
  • the direction orthogonal to the predetermined direction is the vertical direction
  • the direction orthogonal to the predetermined direction is It is horizontal.
  • the predetermined condition may be any one condition or two conditions out of the first condition, the second condition and the third condition.
  • the connected area may be divided into two connected areas due to expansion of the high-intensity character area in the connected area, in which case the distance between the two connected areas is less than or equal to the size of the characters in the connected area.
  • the second predetermined distance is set to a length on the image corresponding to the minimum horizontal and vertical lengths of characters used in a general form (for example, 40 points). Since the length of the connected area in the predetermined direction (width of the connected area) is larger than one side of the high-intensity character area in the connected area, the second predetermined distance is set to the length of the connected area in the predetermined direction. Good.
  • the difference between the length L1 of the connecting region 708 and the length L2 of the connecting region 708 in the vertical direction is sufficiently small, so that the connecting region 708 and the connecting region 709 satisfy the first condition. Further, since the distance between the center position P1 of the connection area 708 and the center position P2 of the connection area 709 in the vertical direction is sufficiently small, the connection area 708 and the connection area 709 satisfy the second condition. Further, since the connecting region 708 and the connecting region 709 do not overlap each other in the horizontal direction and the distance D1 between the connecting region 708 and the connecting region 709 is sufficiently small, the connecting region 708 and the connecting region 709 satisfy the third condition. Therefore, the connection area 708 and the connection area 709 are combined.
  • the connecting region 708 and the connecting region 710 satisfy the first condition.
  • the connection region 708 and the connection region 710 do not satisfy the second condition.
  • the connection area 708 and the connection area 710 overlap in the horizontal direction, the connection area 708 and the connection area 710 do not satisfy the third condition.
  • connection region 708 and the connection region 710 do not satisfy the first condition. Further, since the distance between the center position P4 of the connection region 708 and the center position P5 of the connection region 710 in the horizontal direction is sufficiently large, the connection region 708 and the connection region 710 do not satisfy the second condition. Further, since the distance D2 between the connection region 708 and the connection region 710 is sufficiently large in the vertical direction, the connection region 708 and the connection region 710 do not satisfy the third condition. Therefore, the connection area 708 and the connection area 710 are not combined.
  • the combining unit 225 When there is a combination satisfying a predetermined condition, the combining unit 225 connects the two connected areas related to the combination. When there are a plurality of combinations satisfying a predetermined condition with respect to a specific connected region, the combining unit 225 combines the specific connected region with all the connected regions related to the combination satisfying the predetermined condition.
  • the combining unit 225 selects an effective pixel within a third predetermined distance from each pixel in an image in which only the pixels corresponding to the black pixels included in the two connection regions to be combined are effective pixels.
  • the effective pixel is expanded by converting into the effective pixel.
  • the third predetermined distance is set to the same distance as the second predetermined distance set under the third condition, for example.
  • the combining unit 225 shrinks the effective pixel by converting the pixel into an invalid pixel. Then, the combining unit 225 combines the two connected regions by converting the white pixels in the ruled line removal image corresponding to the effective pixels in the image into black pixels.
  • the combining unit 225 may combine the two connected areas by converting all the white pixels in the area surrounded by the circumscribing rectangle including the two connected areas to be combined into black pixels.
  • the combining unit 225 converts white pixels in all connected areas into black pixels. For all connected regions, the combining unit 225 determines, when an effective pixel exists within a fourth predetermined distance from each pixel in an image in which only pixels corresponding to black pixels included in each connected region are effective pixels. The effective pixel is expanded by converting the pixel into an effective pixel. The fourth predetermined distance is set to a length on the image corresponding to the maximum horizontal or vertical length of characters used in a general form (for example, 40 points). In addition, when there is an invalid pixel within the fourth predetermined distance from each effective pixel in the image, the combining unit 225 converts the effective pixel into an invalid pixel to shrink the effective pixel. Then, the combining unit 225 converts the white pixels in the ruled-line-removed image corresponding to the effective pixels in the image into black pixels, thereby converting the white pixels in the connected region into black pixels.
  • the combining unit 225 may convert all the white pixels in the area surrounded by the circumscribing rectangle including each connected area into black pixels, thereby converting the white pixels in the connected area into black pixels.
  • FIG. 7B is a schematic diagram showing an example of a ruled line removal image 720 in which connected regions are combined.
  • the ruled line removal image 720 shown in FIG. 7B is an image in which the connected areas are combined in the ruled line removal image 700 shown in FIG. 7A.
  • the connected region 708 and the connected region 709 of the ruled line removed image 700 are combined, and the white pixels in the connected region 708 and the connected region 709 are converted into black pixels, A connection area 721 is formed.
  • the connected area 710 of the ruled line removal image 700 is not combined with other connected areas, but in the ruled line removal image 720, the white pixels in the connected area 710 are converted into black pixels to form the connected area 722. There is.
  • the reversal image generation unit 226 determines, in the multi-valued image, an area corresponding to the connected area and including high-intensity characters having a predetermined size or more, the gradation value of the low-intensity background area and the high-intensity character area. It is extracted as a reversal target area for reversing the relationship with the gradation value of (step S208).
  • This connection area is an area in which the white pixels inside are converted to black pixels in step S207, and includes both a connection area combined by the combining unit 225 and a connection area not combined by the combining unit 225. ..
  • the reverse image generating unit 226 subtracts the gradation value of each pixel from the maximum value of the gradation range in the multi-valued image, and subtracts the gradation value of the pixel in the corresponding area corresponding to each connected area of the ruled line removal image. A converted image that is inverted by conversion into the subtracted value is generated.
  • the reverse image generation unit 226 generates a converted binary image by binarizing the converted image.
  • the reverse image generation unit 226, in the converted binary image groups the black pixels in each of the second corresponding regions by labeling for each of the second corresponding regions corresponding to the corresponding regions, thereby generating the black pixels. Specifies the third connecting region to be connected.
  • the reverse image generation unit 226 determines, for each second corresponding region, whether or not a third connected region whose horizontal length and / or vertical length is equal to or greater than a third threshold is included.
  • the third threshold value is set to a length on the image corresponding to the minimum horizontal and vertical lengths of characters used in a general form (for example, 8 points).
  • the third threshold value to be compared with the horizontal length of the third connection area and the third threshold value to be compared with the vertical length may be set to different values.
  • the reverse image generation unit 226 regards the third connected region whose horizontal length and / or vertical length is equal to or larger than the third threshold as the region corresponding to the high-luminance character whose size is equal to or larger than the predetermined size.
  • the reverse image generation unit 226 reverses the corresponding area of the multi-valued image corresponding to the second corresponding area including the third connected area whose horizontal length and / or vertical length is equal to or greater than the third threshold value. Extract as the target area.
  • the reverse image generation unit 226 generates a reverse image in which the relationship between the gradation value of the low-luminance background region and the gradation value of the high-luminance character region in each inversion target region is reversed in the multivalued image. (Step S209).
  • the reverse image generation unit 226 inverts the multivalued image by converting the gradation value of each pixel in each inversion target area into a subtraction value obtained by subtracting the gradation value of each pixel from the maximum value of the gradation range. Then, a reverse image is generated.
  • FIG. 8A is a schematic diagram showing an example of the reverse image 800.
  • the reverse image 800 shown in FIG. 8A is an image generated from the multivalued image 500 shown in FIG. 5A.
  • the reverse image 800 in the reverse image 800, the relationship between the gradation value of the region 803 corresponding to the low-luminance background region 503 and the gradation value of the region 804 corresponding to the high-luminance character region 504 is reversed. .. That is, in the reverse image 800, the gradation values of the region 801 corresponding to the high-luminance background region 501, the region 802 corresponding to the low-luminance character region 502, and the region 805 corresponding to the ruled line region 505 are the same as those of the multi-valued image 500. It has not changed.
  • the area 803 corresponding to the low-brightness background area 503 and the area 804 corresponding to the high-brightness character area 504 change such that the brightness value of the area 804 becomes lower than the brightness value of the area 803. ing.
  • the reverse image generation unit 226 determines that the multi-valued image has the low brightness in the corresponding area only when the area corresponding to the connected area includes the high brightness character having a predetermined size or more.
  • the relationship between the gradation value of the background area and the gradation value of the high-luminance character area is reversed.
  • the background In each connected region, the background is presumed to have a lower intensity, but in each connected region the character may have a lower intensity than the background, such as when the background has a dark gray color and the character has a black color. There is a nature.
  • the reverse image generation unit 226 extracts only the corresponding area including the high-intensity characters having a predetermined size or more as the inversion target area, so that only the corresponding area including the white character, that is, the character having the higher brightness than the background is included. Is extracted as the inversion target area. As a result, the reverse image generation unit 226 can prevent the relationship between the gradation value of the background and the gradation value of the character from being reversed in the area where the character has lower luminance than the background.
  • the reverse binary image generation unit 227 generates a reverse binary image by binarizing the reverse image (step S210). Similarly to the binary image generating unit 222, the inversion binary image generating unit 227 sets a pixel having a gradation value of the first threshold or more in the reverse image as a white pixel, and a pixel having a gradation value of less than the first threshold. An image in which is a black pixel is generated as an inverted binary image. In the reverse binary image, the pixels corresponding to the characters and ruled lines in the reverse image are black pixels, and the pixels corresponding to the background are white pixels.
  • FIG. 8B is a schematic diagram showing an example of the inverted binary image 810.
  • FIG. 8B shows a reverse binary image 810 obtained by binarizing the reverse image 800 shown in FIG. 8A.
  • the pixels of the area 811 corresponding to the high-intensity background area 501 of the multi-valued image 500 and the pixels of the area 813 corresponding to the low-intensity background area 503 are white pixels.
  • the pixels of the region 812 corresponding to the low-luminance character region 502 the pixels of the region 814 corresponding to the high-luminance character region 504, and the pixels of the region 815 corresponding to the ruled line region 505 are It is a black pixel.
  • the character detection unit 228 detects a character from the reverse binary image generated from the reverse image (step S211).
  • the character detection unit 228 detects a character from the inverted binary image using a known OCR (Optical Character Recognition) technique.
  • the output control unit 229 displays the detected character on the display device 203 (step S212), and ends the series of steps.
  • the output control unit 229 may display a reverse image or a reverse binary image on the display device 203 as information regarding the detected character, instead of or in addition to the detected character.
  • the output control unit 229 may also transmit the detected character, reverse image, or reverse binary image to a server or the like (not shown) via a communication device (not shown). In this way, the output control unit 229 outputs information regarding the detected character.
  • the ruled line removal image generation unit 223 may omit the process of step S203 and generate a ruled line removal image from the binary image generated in step S202 in step S204. Further, the ruled line removal image generation unit 223 may omit the process of step S205, and the region detection unit 224 may detect the connected region from the ruled line removal image generated in step S204 in step S206.
  • the reverse image generation unit 226 omits the process of step S208, and in step S209, the gradation value of the low-luminance background region and the gradation value of the high-luminance character region in all the connected regions in the multivalued image are combined. A reversed image may be generated by reversing the relationship. Further, the inverted binary image generation unit 227 may omit the process of step S210, and the character detection unit 228 may detect the character from the inverted image in step S211.
  • the information processing apparatus 200 extracts characters from the image of the original including the low-luminance background, the high-luminance characters on the low-luminance background, and the ruled lines. It has become possible to detect satisfactorily.
  • the information processing apparatus 200 has been able to satisfactorily specify the low-luminance background region by removing the ruled-line component, particularly the ruled-line component that is continuous with the low-luminance background region. Further, the information processing apparatus 200 suppresses erroneous identification of the low-luminance background region by recombining the low-luminance background region divided by the high-luminance character region expanded when the ruled line component is removed. Became possible. The information processing apparatus 200 can satisfactorily invert the gradation value of the low-luminance background area and the gradation value of the high-luminance character area by appropriately specifying the low-luminance background area.
  • the form may contain characters with various densities.
  • some of the white characters may also be converted to black pixels, and in order to detect the white characters from the binary image so generated, the binary image If the relationship between the white pixel and the black pixel inside is reversed, the white character is likely to be blurred.
  • the information processing apparatus 200 does not binarize the multi-valued image and then inverts the gradation value, but generates the reverse image from the multi-valued image and then the reverse binary image, thereby generating the reverse binary image. It has become possible to prevent characters from being blurred.
  • general-purpose OCR software is generally configured to detect low-intensity characters placed on a high-intensity background.
  • the information processing apparatus 200 inverts the gradation values of the low-brightness background area and the high-brightness character area so that the image of the document including the high-brightness characters on the low-brightness background is placed on the high-brightness background in the low-brightness area.
  • Characters can be detected using OCR software configured to detect the characters. Further, the information processing apparatus 200 detects only one of the high-luminance character and the low-luminance character from the image of the document including the high-luminance character on the low-luminance background and the low-luminance character on the high-luminance background. Characters can be detected using OCR software configured in.
  • the information processing apparatus 200 also detects a connected area in which black pixels are connected in the image, and inverts the gradation values of the low-luminance background area and the high-luminance character area for each detected connected area. As a result, the information processing apparatus 200 makes good characters in the form from the image of the form in which the cells in which the low-intensity characters are arranged on the high-intensity background and the cells in which the high-intensity characters are arranged on the low-intensity background are mixed. It becomes possible to detect.
  • the information processing apparatus 200 selects the gradation of the high-luminance background area from the multivalued image in which the relationship of the gradation values of each background, character, and ruled line is reversed with respect to the multivalued image 500 shown in FIG. 5A.
  • a reversed image in which the relationship between the value and the gradation value of the low-luminance character region is reversed may be generated.
  • the ruled line removal image generation unit 223 generates a ruled line removal image in which the high brightness ruled line component is removed from the binary image, and the region detection unit 224 determines the connected region in which the white pixels are connected in the ruled line removal image. To detect.
  • the combining unit 225 combines the divided connected areas, and the reverse image generation unit 226 in the multi-valued image, the gradation value of the high brightness background area and the gradation of the low brightness character area in the area corresponding to the connected area.
  • a reverse image is generated by reversing the relationship with the value.
  • FIG. 9 is a block diagram showing a schematic configuration of a processing device 230 in an information processing device according to another embodiment.
  • the processing device 230 executes recognition processing instead of the second CPU 220.
  • the processing device 230 includes an acquisition circuit 231, a binary image generation circuit 232, a ruled line removal image generation circuit 233, a region detection circuit 234, a combination circuit 235, a reverse image generation circuit 236, a reverse binary image generation circuit 237, and a character detection circuit 238. And an output control circuit 239 and the like.
  • the acquisition circuit 231 is an example of an acquisition unit and has the same function as the acquisition unit 221.
  • the acquisition circuit 231 acquires the input image as a multi-valued image from the image reading device 100 via the second interface device 201, and saves it in the second storage device 210.
  • the binary image generation circuit 232 is an example of a binary image generation unit, and has the same function as the binary image generation unit 222.
  • the binary image generation circuit 232 reads the multi-valued image from the second storage device 210, generates a binary image from the multi-valued image, and stores it in the second storage device 210.
  • the ruled line removal image generation circuit 233 is an example of the ruled line removal image generation unit, and has the same function as the ruled line removal image generation unit 223.
  • the ruled line removal image generation circuit 233 reads a binary image from the second storage device 210, generates a ruled line removal image from the binary image, and stores it in the second storage device 210.
  • the area detection circuit 234 is an example of an area detection unit and has the same function as the area detection unit 224.
  • the area detection circuit 234 reads the ruled line removal image from the second storage device 210, detects a connected area in the ruled line removal image, and stores the detection result in the second storage device 210.
  • the combining circuit 235 is an example of a combining unit and has the same function as the combining unit 225.
  • the combining circuit 235 reads the ruled line removed image and the detection result of the connected area from the second storage device 210, combines the connected areas in the ruled line removed image based on the detection result, and stores the combined area in the second storage device 210. ..
  • the reverse image generation circuit 236 is an example of a reverse image generation unit and has the same function as the reverse image generation unit 226.
  • the reverse image generation circuit 236 reads the multi-valued image and the ruled line removed image from the second storage device 210, generates a reverse image from each read image, and stores the reverse image in the second storage device 210.
  • the reverse binary image generation circuit 237 is an example of the reverse binary image generator, and has the same function as the reverse binary image generator 227.
  • the reverse binary image generation circuit 237 reads the reverse image from the second storage device 210, generates a reverse binary image from the reverse image, and outputs it to the display device 203.
  • the character detection circuit 238 is an example of a character detection unit and has the same function as the character detection unit 228.
  • the character detection circuit 238 reads a reverse image or a reverse binary image from the second storage device 210, detects a character from the read image, and stores the detection result in the second storage device 210.
  • the output control circuit 239 is an example of an output control unit and has the same function as the output control unit 229.
  • the output control circuit 239 reads out the character detection result, the reverse image or the reverse binary image from the second storage device 210, and outputs the read information to the display device 203.
  • the information processing device can favorably detect a character from an image of a document including a low-brightness background, a high-brightness character on the low-brightness background, and a ruled line. Became possible.
  • the sharing of functions of the image reading apparatus 100 and the information processing apparatus 200 is not limited to the example of the image processing system 1 shown in FIG. Which of the 200 is arranged can be changed as appropriate.
  • the image reading device 100 and the information processing device 200 may be configured as one device.
  • the first storage device 110 of the image reading device 100 stores each program stored in the second storage device 210 of the information processing device 200, and the first CPU 120 of the image reading device 100 stores the second CPU 120 of the information processing device 200. May operate as each unit realized by.
  • the image reading device 100 may include a processing device similar to the processing device 230 of the information processing device 200.
  • the image reading apparatus 100 has a display device similar to the display device 203. Since the recognition processing is executed by the image reading apparatus 100, the input image transmission / reception processing in steps S102 and S201 is omitted. Each process of steps S202 to S212 is executed by the first CPU 120 of the image reading apparatus 100 or the processing device. Operations of these processes are similar to those performed by the second CPU 220 or the processing device 230 of the information processing device 200.
  • the first interface device 101 and the second interface device 201 are connected via a network such as the Internet, a telephone line network (including a mobile terminal line network and a general telephone line network), an intranet, or the like. Good.
  • the first interface device 101 and the second interface device 201 are provided with a communication interface circuit of a network to be connected.
  • a plurality of information processing devices are dispersedly arranged on the network, and each information processing device cooperates to perform recognition processing and the like. You may share. Accordingly, the image processing system 1 can efficiently perform the recognition process on the input images read by the plurality of image reading devices.
  • Image Processing System 200 Information Processing Device 221 Acquisition Unit 222 Binary Image Generation Unit 223 Ruled Line Removal Image Generation Unit 224 Area Detection Unit 225 Joining Unit 226 Reversed Image Generation Unit 227 Reversed Binary Image Generation Unit 228 Character Detection Unit 229 Output Control Unit

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Abstract

低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能な画像処理装置、制御方法、制御プログラムを提供する。画像処理装置は、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を二値化した二値画像から罫線除去画像を生成する罫線除去画像生成部と、罫線除去画像内で黒色画素が連結する連結領域を検出する領域検出部と、複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合する結合部と、多値画像において、結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する逆転画像生成部と、逆転画像から文字を検出する文字検出部と、検出された文字に関する情報を出力する出力部と、を有する。

Description

画像処理装置、制御方法及び制御プログラム
 本開示は、画像処理装置、制御方法及び制御プログラムに関し、特に、低輝度背景上の高輝度文字を含む原稿の画像を処理する画像処理装置、制御方法及び制御プログラムに関する。
 請求書等の帳票を担当者が手作業によりデータ化している会社では、膨大な数の帳票のデータ化が必要である場合に担当者の業務負担が大きくなるため、帳票のデータ化作業の効率化に対する要望が高まっている。帳票のデータ化作業の効率化を図るためには、帳票に記載されている文字をコンピュータが正しく認識する必要がある。このような帳票において、黒色等の輝度が低い低輝度背景上に、白色等の輝度が高い高輝度文字が配置されている場合がある。一般的に、OCR(Optical Character Recognition)ソフトウェアは、文字の輝度が背景の輝度よりも低いものとして、文字を認識する。そのため、そのような帳票を読み取った画像において、低輝度背景の領域の階調値と高輝度文字の領域の階調値との関係を逆転させてから、文字を認識することが望ましい。
 画像の白抜き文字部を検出して、検出された白抜き文字部を白黒反転し、反転された画像部分について、文字認識処理を行う文字認識装置が開示されている(特許文献1)。
特開平9-269970号公報
 低輝度背景上に高輝度文字が配置された帳票を撮像した画像において、低輝度背景の領域の階調値と高輝度文字の領域の階調値との関係を逆転させるためには、低輝度背景の領域を正しく特定する必要がある。特に、そのような帳票に罫線が含まれる場合、その帳票を撮像した画像において、低輝度背景の領域を正しく特定するためには、罫線の成分を良好に除去する必要がある。
 画像処理装置、制御方法及び制御プログラムの目的は、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することを可能とすることにある。
 実施形態の一側面に係る画像処理装置は、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得する取得部と、多値画像を二値化した二値画像を生成する二値画像生成部と、二値画像から複数の罫線の成分を除去した罫線除去画像を生成する罫線除去画像生成部と、罫線除去画像内で黒色画素が連結する連結領域を検出する領域検出部と、領域検出部により検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合する結合部と、多値画像において、結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する逆転画像生成部と、逆転画像から文字を検出する文字検出部と、検出された文字に関する情報を出力する出力部と、を有する。
 また、実施形態の一側面に係る制御方法は、出力部を有する画像処理装置の制御方法であって、画像処理装置が、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、多値画像を二値化した二値画像を生成し、二値画像から複数の罫線の成分を除去した罫線除去画像を生成し、罫線除去画像内で黒色画素が連結する連結領域を検出し、検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合し、多値画像において、結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、逆転画像から文字を検出し、検出された文字に関する情報を出力部から出力することを含む。
 また、実施形態の一側面に係る制御プログラムは、出力部を有するコンピュータの制御プログラムであって、低輝度背景と、低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、多値画像を二値化した二値画像を生成し、二値画像から複数の罫線の成分を除去した罫線除去画像を生成し、罫線除去画像内で黒色画素が連結する連結領域を検出し、検出された複数の連結領域の大きさの関係、複数の連結領域の位置の関係、又は、複数の連結領域の間の距離の内の少なくとも一つに基づいて、複数の連結領域を結合し、多値画像において、結合部により結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、逆転画像から文字を検出し、検出された文字に関する情報を出力部から出力することをコンピュータに実行させる。
 本実施形態によれば、画像処理装置、制御方法及び制御プログラムは、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となる。
 本発明の目的及び効果は、特に請求項において指摘される構成要素及び組み合わせを用いることによって認識され且つ得られるだろう。前述の一般的な説明及び後述の詳細な説明の両方は、例示的及び説明的なものであり、特許請求の範囲に記載されている本発明を制限するものではない。
実施形態に従った画像処理システム1の概略構成を示す図である。 第2記憶装置210及び第2CPU220の概略構成を示す図である。 画像読取処理の動作を示すフローチャートである。 認識処理の動作を示すフローチャートである。 多値画像500の一例を示す模式図である。 二値画像510の一例を示す模式図である。 二値画像600の一例を示す模式図である。 罫線除去画像610の一例を示す模式図である。 罫線除去画像700の一例を示す模式図である。 罫線除去画像720の一例を示す模式図である。 逆転画像800の一例を示す模式図である。 逆転二値画像810の一例を示す模式図である。 処理装置230の概略構成を示すブロック図である。
 以下、本開示の一側面に係る画像処理装置、制御方法及び制御プログラムについて図を参照しつつ説明する。但し、本発明の技術的範囲はそれらの実施の形態に限定されず、特許請求の範囲に記載された発明とその均等物に及ぶ点に留意されたい。
 図1は、実施形態に従った画像処理システムの概略構成を示す図である。図1に示すように、画像処理システム1は、画像読取装置100と、情報処理装置200とを有する。
 画像読取装置100は、例えばスキャナ装置等である。画像読取装置100は、情報処理装置200に接続されている。情報処理装置200は、画像処理装置の一例であり、例えばパーソナルコンピュータ等である。
 画像読取装置100は、第1インタフェース装置101と、撮像装置102と、第1記憶装置110と、第1CPU(Control Processing Unit)120とを有する。
 第1インタフェース装置101は、USB(Universal Serial Bus)等のシリアルバスに準じるインタフェース回路を有し、情報処理装置200と電気的に接続して画像データ及び各種の情報を送受信する。また、第1インタフェース装置101の代わりに、無線信号を送受信するアンテナと、所定の通信プロトコルに従って、無線通信回線を通じて信号の送受信を行うための無線通信インタフェース回路とを有する通信装置が用いられてもよい。所定の通信プロトコルは、例えば無線LAN(Local Area Network)である。
 撮像装置102は、主走査方向に直線状に配列されたCCD(Charge Coupled Device)による撮像素子を備える縮小光学系タイプの撮像センサを有する。さらに、撮像装置102は、光を照射する光源と、撮像素子上に像を結ぶレンズと、撮像素子から出力された電気信号を増幅してアナログ/デジタル(A/D)変換するA/D変換器とを有する。撮像装置102において、撮像センサは、搬送される原稿の表面を撮像してアナログの画像信号を生成して出力し、A/D変換器は、このアナログの画像信号をA/D変換してデジタルの入力画像を生成して出力する。入力画像は、各画素データが、例えばRGB各色毎に8bitで表される計24bitのR(赤色)値、G(緑色)値、B(青色)値からなるカラー多値画像である。なお、CCDの代わりにCMOS(Complementary Metal Oxide Semiconductor)による撮像素子を備える等倍光学系タイプのCIS(Contact Image Sensor)が用いられてもよい。
 第1記憶装置110は、RAM(Random Access Memory)、ROM(Read Only Memory)等のメモリ装置、ハードディスク等の固定ディスク装置、又はフレキシブルディスク、光ディスク等の可搬用の記憶装置等を有する。また、第1記憶装置110には、画像読取装置100の各種処理に用いられるコンピュータプログラム、データベース、テーブル等が格納される。コンピュータプログラムは、コンピュータ読み取り可能な可搬型記録媒体から公知のセットアッププログラム等を用いて第1記憶装置110にインストールされてもよい。可搬型記録媒体は、例えばCD-ROM(compact disk read only memory)、DVD-ROM(digital versatile disk read only memory)等である。また、第1記憶装置110は、撮像装置102により生成された入力画像等を記憶する。
 第1CPU120は、予め第1記憶装置110に記憶されているプログラムに基づいて動作する。なお、第1CPU120に代えて、DSP(digital signal processor)、LSI(large scale integration)等が用いられてよい。また、第1CPU120に代えて、ASIC(Application Specific Integrated Circuit)、FPGA(Field-Programming Gate Array)等が用いられてもよい。
 第1CPU120は、第1インタフェース装置101、撮像装置102及び第1記憶装置110等と接続され、これらの各部を制御する。第1CPU120は、撮像装置102の原稿読取制御、第1インタフェース装置101を介した情報処理装置200とのデータ送受信制御等を行う。
 情報処理装置200は、第2インタフェース装置201と、入力装置202と、表示装置203と、第2記憶装置210と、第2CPU220と、処理装置230とを有する。以下、情報処理装置200の各部について詳細に説明する。
 第2インタフェース装置201は、画像読取装置100の第1インタフェース装置101と同様のインタフェース回路を有し、情報処理装置200と画像読取装置100とを接続する。また、第2インタフェース装置201の代わりに、無線信号を送受信するアンテナと、無線LAN等の所定の通信プロトコルに従って、無線通信回線を通じて信号の送受信を行うための無線通信インタフェース回路とを有する通信装置が用いられてもよい。
 入力装置202は、キーボード、マウス等の入力装置及び入力装置から信号を取得するインタフェース回路を有し、利用者の操作に応じた信号を第2CPU220に出力する。
 表示装置203は、出力部の一例である。表示装置203は、液晶、有機EL等から構成されるディスプレイ及びディスプレイに画像データを出力するインタフェース回路を有し、第2記憶装置210と接続されて第2記憶装置210に保存されている画像データをディスプレイに表示する。
 第2記憶装置210は、画像読取装置100の第1記憶装置110と同様のメモリ装置、固定ディスク装置、可搬用の記憶装置等を有する。第2記憶装置210には、情報処理装置200の各種処理に用いられるコンピュータプログラム、データベース、テーブル等が格納される。コンピュータプログラムは、例えばCD-ROM、DVD-ROM等のコンピュータ読み取り可能な可搬型記録媒体から、公知のセットアッププログラム等を用いて第2記憶装置210にインストールされてもよい。また、第2記憶装置210は、画像読取装置100から受信した入力画像、及び、処理装置230により入力画像に対して画像処理がなされた各種の処理画像等を記憶する。
 第2CPU220は、予め第2記憶装置210に記憶されているプログラムに基づいて動作する。なお、第2CPU220に代えて、DSP、LSI、ASIC、FPGA等が用いられてもよい。
 第2CPU220は、第2インタフェース装置201、入力装置202、表示装置203、第2記憶装置210及び処理装置230等と接続され、これらの各部を制御する。第2CPU220は、第2インタフェース装置201を介した画像読取装置100とのデータ送受信制御、入力装置202の入力制御、表示装置203の表示制御、処理装置230による画像処理の制御等を行う。
 処理装置230は、入力画像に対して所定の画像処理を実行する。処理装置230は、CPU、DSP、LSI、ASIC又はFPGA等で構成される。
 図2は、第2記憶装置210及び第2CPU220の概略構成を示す図である。
 図2に示すように第2記憶装置210には、取得プログラム211、二値画像生成プログラム212、罫線除去画像生成プログラム213、領域検出プログラム214、結合プログラム215、逆転画像生成プログラム216、逆転二値画像生成プログラム217、文字検出プログラム218及び出力制御プログラム219等の各プログラムが記憶される。これらの各プログラムは、プロセッサ上で動作するソフトウェアにより実装される機能モジュールである。第2CPU220は、第2記憶装置210に記憶された各プログラムを読み取り、読み取った各プログラムに従って動作する。これにより、第2CPU220は、取得部221、二値画像生成部222、罫線除去画像生成部223、領域検出部224、結合部225、逆転画像生成部226、逆転二値画像生成部227、文字検出部228及び出力制御部229として機能する。
 図3は、画像読取装置100による画像読取処理の動作を示すフローチャートである。以下、図3に示したフローチャートを参照しつつ、画像読取処理の動作を説明する。なお、以下に説明する動作のフローは、予め第1記憶装置110に記憶されているプログラムに基づき主に第1CPU120により画像読取装置100の各要素と協働して実行される。
 最初に、撮像装置102は、原稿として、請求書等の帳票を撮像した入力画像を生成し、第1記憶装置110に保存する(ステップS101)。
 この原稿には、少なくとも、黒色等の輝度が低い低輝度背景と、低輝度背景上に配置された、白色等の輝度が高い高輝度文字と、複数の罫線とが含まれている。低輝度背景の輝度は所定輝度より低く、高輝度文字の輝度は低輝度背景の輝度より高い。即ち、入力画像において、低輝度背景領域の輝度値は所定輝度値(例えば128)より低く、高輝度文字領域の輝度値は低輝度背景領域の輝度値より高い。また、罫線の輝度は、低輝度背景の輝度と同様に、高輝度文字の輝度より低く、入力画像において、罫線領域の輝度値は、所定輝度値より低く、且つ、高輝度文字領域の輝度値より低い。
 この原稿には、さらに、白色等の輝度が高い高輝度背景と、高輝度背景上に配置された、黒色等の輝度が低い低輝度文字とが含まれていてもよい。高輝度背景の輝度は所定輝度より高く、低輝度文字の輝度は高輝度背景の輝度より低い。即ち、入力画像において、高輝度背景領域の輝度値は所定輝度値より高く、低輝度文字領域の輝度値は高輝度背景領域の輝度値より高い。
 次に、第1CPU120は、第1記憶装置110に保存された入力画像を第1インタフェース装置101を介して情報処理装置200に送信し(ステップS102)、一連のステップを終了する。
 図4は、情報処理装置200による認識処理の動作を示すフローチャートである。以下、図4に示したフローチャートを参照しつつ、認識処理の動作を説明する。なお、以下に説明する動作のフローは、予め第2記憶装置210に記憶されているプログラムに基づき主に処理装置230により情報処理装置200の各要素と協同して実行される。
 最初に、取得部221は、入力画像を多値画像として第2インタフェース装置201を介して画像読取装置100から取得し、第2記憶装置210に保存する(ステップS201)。なお、取得部221は、カラー多値画像である入力画像から、白黒の多値画像を生成し、多値画像として取得してもよい。その場合、取得部221は、入力画像内の各画素毎に、以下の式に従って輝度値を算出し、算出した輝度値を各画素に対応する画素の階調値とする白黒多値画像を生成する。
 輝度値=0.299×(R値)+0.587×(G値)+0.114×(B値)
 図5Aは、多値画像500の一例を示す模式図である。
 図5Aに示すように、多値画像500には、高輝度背景領域501と、低輝度文字領域502と、低輝度背景領域503と、高輝度文字領域504と、複数の罫線領域505とが含まれる。高輝度背景領域501は、白色を有し且つ高い輝度を有する。低輝度文字領域502は、黒色を有し且つ高輝度背景領域501が有する輝度より低い輝度を有し、高輝度背景領域501上に配置されている。低輝度背景領域503は、黒色を有し且つ低い輝度を有する。高輝度文字領域504は、白色を有し且つ低輝度背景領域503が有する輝度より高い輝度を有し、低輝度背景領域503上に配置されている。罫線領域505は、黒色を有し且つ低い輝度を有し、低輝度背景領域503と連なっている。低輝度文字502領域及び高輝度文字領域504の少なくとも一部は、罫線領域505で囲まれる範囲内に配置されている。
 次に、二値画像生成部222は、取得した多値画像を二値化した二値画像を生成する(ステップS202)。二値画像生成部222は、多値画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を二値画像として生成する。第1閾値は、事前の実験により、一般的な背景を形成する画素の階調値と文字を形成する画素の階調値の間の値に設定される。これにより、二値画像では、多値画像内の低輝度文字、低輝度背景及び罫線に対応する画素が黒色画素となり、高輝度背景及び高輝度文字に対応する画素が白色画素となる。
 なお、第1閾値は、大津の二値化処理により決定されてもよい。一般に、帳票毎に低輝度背景及び高輝度文字の輝度は異なる。情報処理装置200は、大津の二値化処理により第1閾値を決定することにより、多値画像において、低輝度背景の輝度と、高輝度文字の輝度とがどのような関係を有していても、低輝度背景と高輝度文字とを良好に識別することが可能となる。
 図5Bは、二値画像510の一例を示す模式図である。
 図5Bは、図5Aに示す多値画像500を二値化した二値画像510を示す。図5Bに示すように、二値画像510において、高輝度背景領域501に対応する領域511の画素と、高輝度文字領域504に対応する領域514の画素は、白色画素である。一方、二値画像510において、低輝度文字領域502に対応する領域512の画素と、低輝度背景領域503に対応する領域513の画素と、罫線領域505に対応する領域515の画素とは、黒色画素である。
 次に、罫線除去画像生成部223は、二値画像において、二値画像内で黒色画素が連結する第1連結領域の内、水平及び垂直方向の長さが第2閾値未満の領域を白色画素に変換することにより、二値画像から低輝度文字の成分を除去する(ステップS203)。
 罫線除去画像生成部223は、ラベリングにより、二値画像内で黒色画素をグループ化することにより、第1連結領域を特定する。罫線除去画像生成部223は、特定した各第1連結領域の内、水平方向の長さ及び垂直方向の長さが第2閾値未満である第1連結領域を除去対象領域として抽出する。第2閾値は、一般的な帳票で使用される文字の水平及び垂直方向の最大の長さ(例えば40ポイント)に相当する画像上の長さに設定される。なお、第1連結領域の水平方向の長さと比較する第2閾値と、垂直方向の長さと比較する第2閾値は、それぞれ異なる値に設定されてもよい。罫線除去画像生成部223は、二値画像において、抽出した各除去対象領域(黒色画素)を白色画素に変換する。
 図6Aは、低輝度文字の成分が除去された二値画像600の一例を示す模式図である。
 図6Aに示す二値画像600は、図5Bに示す二値画像510から低輝度文字の成分が除去された画像である。図6Aに示すように、二値画像600では、低輝度背景領域503に対応する領域603の画素、及び、罫線領域505に対応する領域605の画素のみが黒色画素として残っている。一方、二値画像600では、低輝度文字領域502に対応する領域602の画素は白色画素に変換されている。
 次に、罫線除去画像生成部223は、二値画像から複数の罫線の成分を除去した罫線除去画像を生成する(ステップS204)。罫線除去画像生成部223は、低輝度文字の成分が除去された二値画像に残っている第1連結領域内の、水平又は垂直方向の長さが所定値以下である部分を白色画素に変換することにより、罫線除去画像を生成する。所定値は、例えば一般的な帳票で使用される罫線の最大幅(例えば3ポイント)に相当する画像上の長さに設定される。例えば、罫線除去画像生成部223は、第1連結領域内の各黒色画素から所定値の長さの範囲内に白色画素が存在する場合、その黒色画素を白色画素に変換することにより、白色画素を膨張させる。罫線除去画像生成部223は、二値画像内の白色画素を膨張させることにより、効率良く罫線成分を除去することができ、罫線除去画像の生成処理における処理負荷を低減させることができる。
 なお、罫線除去画像生成部223は、各第1連結領域から、水平又は垂直方向の長さが所定値以下である部分を抽出し、抽出した各部分を白色画素に変換することにより、罫線除去画像を生成してもよい。
 図6Bは、罫線除去画像610の一例を示す模式図である。
 図6Bに示す罫線除去画像610は、図6Aに示す二値画像600から罫線の成分が除去された画像である。図6Bに示すように、罫線除去画像610では、低輝度背景領域503に対応する領域613の画素のみが黒色画素として残り、罫線領域505に対応する領域615の画素は、わずかな領域616の画素を除いて、白色画素に変換されている。罫線除去画像610では、高輝度背景領域に対応する領域とともに、高輝度文字領域504に対応する領域614も膨張している。特に、罫線除去画像610では、高輝度文字領域に対応する領域617が膨張していることにより、低輝度背景領域に対応する領域618と領域619とが分離している。
 次に、罫線除去画像生成部223は、生成した罫線除去画像からノイズ成分を除去する(ステップS205)。
 例えば、罫線除去画像生成部223は、罫線除去画像において、水平又は垂直方向に連続する長さが所定画素数(例えば2画素)以下である黒色画素をノイズ成分として抽出し、白色画素に変換することにより除去する。これにより、罫線除去画像生成部223は、罫線除去画像において、わずかに残った罫線の成分を除去することができる。
 また、罫線除去画像生成部223は、罫線除去画像において黒色画素が連結する領域の内、水平又は垂直方向の長さが所定長さ(例えば5ポイントに相当する長さ)以下である領域をノイズ成分として抽出し、白色画素に変換することにより除去してもよい。これによっても、罫線除去画像生成部223は、罫線除去画像において、わずかに残った罫線の成分を除去することができる。
 また、罫線除去画像生成部223は、罫線除去画像において黒色画素が連結する領域の内、その領域で囲まれた領域の全画素数に対する黒色画素数の割合が所定割合未満である領域をノイズ成分として抽出し、白色画素に変換することにより除去してもよい。所定割合は、例えば一般に使用される印鑑における文字又は文様部分の割合の最大値(例えば33%)に設定される。これにより、罫線除去画像生成部223は、罫線除去画像において、印鑑等の成分を除去することができる。
 図7Aは、ノイズ成分が除去された罫線除去画像700の一例を示す模式図である。
 図7Aに示す罫線除去画像700は、図6Bに示す罫線除去画像610からノイズ成分が除去された画像である。図7Aに示すように、罫線除去画像700では、低輝度背景領域503に対応する領域703の画素のみが黒色画素として残り、罫線領域505に対応する領域706の画素は全て白色画素に変換されている。
 次に、領域検出部224は、罫線除去画像内で黒色画素が連結する第2連結領域を検出する(ステップS206)。以下では、第2連結領域を単に連結領域と称する。罫線除去画像生成部223は、ラベリングにより、ノイズ成分が除去された罫線除去画像内で黒色画素をグループ化することにより、連結領域を検出する。
 次に、結合部225は、領域検出部224により検出された複数の連結領域を結合する(ステップS207)。結合部225は、各連結領域の大きさの関係、各連結領域の位置の関係、又は、各連結領域の間の距離の内の少なくとも一つに基づいて、各連結領域を結合する。
 結合部225は、検出された連結領域の内の二つの連結領域に係る全ての組合せを抽出する。結合部225は、抽出した組合せ毎に、各組合せに係る二つの連結領域が所定条件を満たすか否かを判定する。所定条件の内の第1条件は、所定方向において二つの連結領域の長さの差が所定差(例えば2画素)以下であることである。所定条件の内の第2条件は、所定方向において二つの連結領域の中心位置の間の距離が第1所定距離(例えば2画素)以下であることである。所定条件の内の第3条件は、所定方向と直交する方向において二つの連結領域が重複せず且つ二つの連結領域の間の距離が第2所定距離(例えば3画素)以下であることである。所定方向は水平方向及び/又は垂直方向であり、所定方向が水平方向である場合、所定方向と直交する方向は垂直方向であり、所定方向が垂直方向である場合、所定方向と直交する方向は水平方向である。所定条件は、第1条件、第2条件及び第3条件の内の任意の一つの条件又は二つの条件でもよい。
 連結領域は、連結領域内の高輝度文字領域が膨張することにより二つの連結領域に分割する可能性があり、その場合、二つの連結領域の間の距離は、連結領域内の文字のサイズ以下となる可能性が高い。そのため、第2所定距離は、例えば一般的な帳票で使用される文字の水平及び垂直方向の最小の長さ(例えば40ポイント)に相当する画像上の長さに設定される。なお、所定方向における連結領域の長さ(連結領域の幅)は、連結領域内の高輝度文字領域の一辺より大きいため、第2所定距離は、所定方向における連結領域の長さに設定されてもよい。
 図7Aに示す例では、垂直方向において連結領域708の長さL1と連結領域708の長さL2の差は十分に小さいため、連結領域708と連結領域709は第1条件を満たす。また、垂直方向において連結領域708の中心位置P1と連結領域709の中心位置P2の間の距離は十分に小さいため、連結領域708と連結領域709は第2条件を満たす。また、水平方向において連結領域708と連結領域709は重複せず且つ連結領域708と連結領域709の間の距離D1は十分に小さいため、連結領域708と連結領域709は第3条件を満たす。そのため、連結領域708と連結領域709は結合される。
 一方、垂直方向において連結領域708の長さL1と連結領域710の長さL3の差は十分に小さいため、連結領域708と連結領域710は第1条件を満たす。しかしながら、垂直方向において連結領域708の中心位置P1と連結領域710の中心位置P3の間の距離は十分に大きいため、連結領域708と連結領域710は第2条件を満たさない。また、水平方向において連結領域708と連結領域710は重複しているため、連結領域708と連結領域710は第3条件も満たさない。
 また、水平方向において連結領域708の長さL4と連結領域710の長さL5の差は十分に大きいため、連結領域708と連結領域710は第1条件を満たさない。また、水平方向において連結領域708の中心位置P4と連結領域710の中心位置P5の間の距離は十分に大きいため、連結領域708と連結領域710は第2条件も満たさない。また、垂直方向において連結領域708と連結領域710の間の距離D2は十分に大きいため、連結領域708と連結領域710は第3条件も満たさない。そのため、連結領域708と連結領域710は結合されない。
 結合部225は、所定の条件を満たす組合せが存在する場合、その組合せに係る二つの連結領域を結合する。なお、結合部225は、特定の連結領域に対して、所定の条件を満たす組合せが複数存在する場合、特定の連結領域と、所定の条件を満たす組合せに係る全ての連結領域とを結合する。
 結合部225は、結合対象の二つの連結領域に含まれる黒色画素に対応する画素のみを有効画素とする画像内で、各画素から第3所定距離内に有効画素が存在する場合、その画素を有効画素に変換することにより、有効画素を膨張させる。第3所定距離は、例えば上記の第3条件で設定された第2所定距離と同じ距離に設定される。また、結合部225は、その画像内で、各有効画素から第3所定距離内に無効画素が存在する場合、その画素を無効画素に変換することにより、有効画素を収縮させる。そして、結合部225は、その画像内の有効画素に対応する罫線除去画像内の白色画素を黒色画素に変換することにより、二つの連結領域を結合する。
 なお、結合部225は、結合対象の二つの連結領域を包含する外接矩形で囲まれた領域の全ての白色画素を黒色画素に変換することにより、二つの連結領域を結合してもよい。
 さらに、結合部225は、全ての連結領域内の白色画素を黒色画素に変換する。結合部225は、全ての連結領域について、各連結領域に含まれる黒色画素に対応する画素のみを有効画素とする画像内で、各画素から第4所定距離内に有効画素が存在する場合、その画素を有効画素に変換することにより、有効画素を膨張させる。第4所定距離は、一般的な帳票で使用される文字の水平又は垂直方向の最大の長さ(例えば40ポイント)に相当する画像上の長さに設定される。また、結合部225は、その画像内で、各有効画素から第4所定距離内に無効画素が存在する場合、その画素を無効画素に変換することにより、有効画素を収縮させる。そして、結合部225は、その画像内の有効画素に対応する罫線除去画像内の白色画素を黒色画素に変換することにより、連結領域内の白色画素を黒色画素に変換する。
 なお、結合部225は、各連結領域を包含する外接矩形で囲まれた領域の全ての白色画素を黒色画素に変換することにより、連結領域内の白色画素を黒色画素に変換してもよい。
 図7Bは、連結領域が結合された罫線除去画像720の一例を示す模式図である。
 図7Bに示す罫線除去画像720は、図7Aに示す罫線除去画像700において連結領域が結合された画像である。図7Bに示すように、罫線除去画像720では、罫線除去画像700の連結領域708と連結領域709が結合されるとともに、連結領域708及び連結領域709内の白色画素が黒色画素に変換されて、連結領域721が形成されている。また、罫線除去画像700の連結領域710は他の連結領域と結合されていないが、罫線除去画像720では、連結領域710内の白色画素が黒色画素に変換されて、連結領域722が形成されている。
 次に、逆転画像生成部226は、多値画像において、連結領域に対応し、且つ、所定サイズ以上である高輝度文字が含まれる領域を、低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる反転対象領域として抽出する(ステップS208)。この連結領域は、ステップS207において、内部の白色画素が黒色画素に変換された領域であり、結合部225により結合された連結領域、及び、結合部225により結合されていない連結領域の両方を含む。
 まず、逆転画像生成部226は、多値画像において、罫線除去画像の各連結領域に対応する対応領域内の画素の階調値を、階調範囲の最大値から各画素の階調値を減算した減算値に変換することにより反転させた変換画像を生成する。次に、逆転画像生成部226は、変換画像を二値化した変換二値画像を生成する。逆転画像生成部226は、二値画像生成部222と同様にして、変換画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を変換二値画像として生成する。
 次に、逆転画像生成部226は、変換二値画像において、各対応領域に対応する第2対応領域毎に、ラベリングにより、各第2対応領域内で黒色画素をグループ化することにより、黒色画素が連結する第3連結領域を特定する。逆転画像生成部226は、各第2対応領域毎に、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域が含まれるか否かを判定する。第3閾値は、一般的な帳票で使用される文字の水平及び垂直方向の最小の長さ(例えば8ポイント)に相当する画像上の長さに設定される。なお、第3連結領域の水平方向の長さと比較する第3閾値と、垂直方向の長さと比較する第3閾値は、それぞれ異なる値に設定されてもよい。逆転画像生成部226は、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域を、所定サイズ以上である高輝度文字に対応する領域とみなす。逆転画像生成部226は、水平方向の長さ及び/又は垂直方向の長さが第3閾値以上である第3連結領域が含まれる第2対応領域に対応する多値画像の対応領域を、反転対象領域として抽出する。
 次に、逆転画像生成部226は、多値画像において、各反転対象領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する(ステップS209)。逆転画像生成部226は、多値画像において、各反転対象領域内の各画素の階調値を、階調範囲の最大値から各画素の階調値を減算した減算値に変換することにより反転させて、逆転画像を生成する。
 図8Aは、逆転画像800の一例を示す模式図である。
 図8Aに示す逆転画像800は、図5Aに示す多値画像500から生成された画像である。図8Aに示すように、逆転画像800では、低輝度背景領域503に対応する領域803の階調値と、高輝度文字領域504に対応する領域804の階調値との関係が逆転している。即ち、逆転画像800では、高輝度背景領域501に対応する領域801、低輝度文字領域502に対応する領域802、及び、罫線領域505に対応する領域805の階調値は、多値画像500に対して変化していない。一方、逆転画像800では、低輝度背景領域503に対応する領域803、及び、高輝度文字領域504に対応する領域804は、領域804の輝度値が領域803の輝度値より低くなるように変化している。
 また上記したように、逆転画像生成部226は、多値画像において、連結領域に対応する領域内に、所定サイズ以上である高輝度文字が含まれる場合に限り、その対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる。各連結領域において、背景は低輝度を有すると推定されるが、背景が濃い灰色を有し且つ文字が黒色を有する場合のように、各連結領域において、文字が背景よりさらに低輝度を有する可能性がある。逆転画像生成部226は、所定サイズ以上である高輝度文字が含まれる対応領域のみを反転対象領域として抽出することにより、白色を有する文字、即ち背景より高輝度を有する文字が含まれる対応領域のみを反転対象領域として抽出する。これにより、逆転画像生成部226は、文字が背景より低輝度を有する領域において、背景の階調値と文字の階調値との関係を逆転させることを防止することが可能となる。
 次に、逆転二値画像生成部227は、逆転画像を二値化した逆転二値画像を生成する(ステップS210)。逆転二値画像生成部227は、二値画像生成部222と同様に、逆転画像内で階調値が第1閾値以上である画素を白色画素とし、階調値が第1閾値未満である画素を黒色画素とした画像を逆転二値画像として生成する。逆転二値画像では、逆転画像内の文字及び罫線に対応する画素が黒色画素となり、背景に対応する画素が白色画素となる。
 図8Bは、逆転二値画像810の一例を示す模式図である。
 図8Bは、図8Aに示す逆転画像800を二値化した逆転二値画像810を示す。図8Bに示すように、逆転二値画像810において、多値画像500の高輝度背景領域501に対応する領域811の画素と、低輝度背景領域503に対応する領域813の画素とは、白色画素である。一方、逆転二値画像810において、低輝度文字領域502に対応する領域812の画素と、高輝度文字領域504に対応する領域814の画素と、罫線領域505に対応する領域815の画素とは、黒色画素である。
 次に、文字検出部228は、逆転画像から生成された逆転二値画像から文字を検出する(ステップS211)。文字検出部228は、公知のOCR(Optical Character Recognition)技術を利用して、逆転二値画像から文字を検出する。
 次に、出力制御部229は、検出された文字を表示装置203に表示し(ステップS212)、一連のステップを終了する。なお、出力制御部229は、検出された文字に関する情報として、検出された文字に代えて又は加えて、逆転画像又は逆転二値画像を表示装置203に表示してもよい。また、出力制御部229は、検出された文字、逆転画像又は逆転二値画像を不図示の通信装置を介して不図示のサーバ等に送信してもよい。このように、出力制御部229は、検出された文字に関する情報を出力する。
 なお、罫線除去画像生成部223は、ステップS203の処理を省略し、ステップS204において、ステップS202で生成された二値画像から罫線除去画像を生成してもよい。また、罫線除去画像生成部223は、ステップS205の処理を省略し、領域検出部224は、ステップS206において、ステップS204で生成された罫線除去画像から連結領域を検出してもよい。また、逆転画像生成部226は、ステップS208の処理を省略し、ステップS209において、多値画像における全ての連結領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させることにより逆転画像を生成してもよい。また、逆転二値画像生成部227は、ステップS210の処理を省略し、文字検出部228は、ステップS211において、逆転画像から文字を検出してもよい。
 以上詳述したように、図5に示したフローチャートに従って動作することによって、情報処理装置200は、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となった。
 情報処理装置200は、罫線成分、特に低輝度背景領域と連なる罫線成分を除去することにより、低輝度背景領域を良好に特定することが可能となった。また、情報処理装置200は、罫線成分を除去する際に膨張した高輝度文字領域によって分断された低輝度背景領域を再結合することにより、低輝度背景領域を誤って特定することを抑制することが可能となった。情報処理装置200は、低輝度背景領域を良好に特定することにより、低輝度背景領域の階調値と高輝度文字領域の階調値を良好に反転させることが可能となった。
 一般に、帳票には、様々な濃度を有する文字が含まれている可能性がある。文字認識処理において、様々な濃度を有する各文字を認識可能にするためには、文字認識処理の対象とする二値画像において、各文字に対応する画素が黒色画素に変換されている必要がある。そのため、二値画像は、画像内の各画素がより黒色画素に変換され易くなるように生成されることが好ましい。しかし、そのように生成された二値画像では、白色文字の一部も黒色画素に変換される可能性があり、そのように生成された二値画像から白色文字を検出するために二値画像内の白色画素と黒色画素の関係を逆転させると、白色文字が掠れてしまう可能性が高い。情報処理装置200は、多値画像を二値化してから階調値を反転させるのでなく、多値画像から逆転画像を生成してから逆転二値画像を生成することにより、逆転二値画像において文字が掠れてしまうことを防止することが可能となった。
 また、一般に、汎用的なOCRソフトウェアは、高輝度背景上に配置された低輝度文字を検出するように構成されている。情報処理装置200は、低輝度背景領域と高輝度文字領域の階調値を反転させることにより、低輝度背景上の高輝度文字を含む原稿の画像から、高輝度背景上に配置された低輝度文字を検出するように構成されたOCRソフトウェアを用いて文字を検出できる。また、情報処理装置200は、低輝度背景上の高輝度文字と、高輝度背景上の低輝度文字とを含む原稿の画像から、高輝度文字又は低輝度文字の何れか一方のみを検出するように構成されたOCRソフトウェアを用いて文字を検出できる。
 また、情報処理装置200は、画像内で黒色画素が連結する連結領域を検出し、検出した連結領域毎に低輝度背景領域と高輝度文字領域の階調値を反転させる。これにより、情報処理装置200は、高輝度背景上に低輝度文字が配置されたセルと、低輝度背景上に高輝度文字が配置されたセルとが混合した帳票の画像から、文字を良好に検出することが可能となる。
 なお、情報処理装置200は、図5Aに示す多値画像500に対して、各背景、文字及び罫線の階調値の関係を反転させたような多値画像から、高輝度背景領域の階調値と低輝度文字領域の階調値との関係を逆転させた逆転画像を生成してもよい。その場合、罫線除去画像生成部223は、二値画像から高輝度の罫線の成分を除去した罫線除去画像を生成し、領域検出部224は、罫線除去画像内で白色画素が連結する連結領域を検出する。結合部225は、分断された連結領域を結合し、逆転画像生成部226は、多値画像において、連結領域に対応する領域内の高輝度背景領域の階調値と低輝度文字領域の階調値との関係を逆転させた逆転画像を生成する。
 図9は、他の実施形態に係る情報処理装置における処理装置230の概略構成を示すブロック図である。
 処理装置230は、第2CPU220の代わりに、認識処理を実行する。処理装置230は、取得回路231、二値画像生成回路232、罫線除去画像生成回路233、領域検出回路234、結合回路235、逆転画像生成回路236、逆転二値画像生成回路237、文字検出回路238及び出力制御回路239等を有する。
 取得回路231は、取得部の一例であり、取得部221と同様の機能を有する。取得回路231は、入力画像を多値画像として第2インタフェース装置201を介して画像読取装置100から取得し、第2記憶装置210に保存する。
 二値画像生成回路232は、二値画像生成部の一例であり、二値画像生成部222と同様の機能を有する。二値画像生成回路232は、第2記憶装置210から多値画像を読み出し、多値画像から二値画像を生成し、第2記憶装置210に保存する。
 罫線除去画像生成回路233は、罫線除去画像生成部の一例であり、罫線除去画像生成部223と同様の機能を有する。罫線除去画像生成回路233は、第2記憶装置210から二値画像を読み出し、二値画像から罫線除去画像を生成し、第2記憶装置210に保存する。
 領域検出回路234は、領域検出部の一例であり、領域検出部224と同様の機能を有する。領域検出回路234は、第2記憶装置210から罫線除去画像を読み出し、罫線除去画像内で連結領域を検出し、検出結果を第2記憶装置210に保存する。
 結合回路235は、結合部の一例であり、結合部225と同様の機能を有する。結合回路235は、第2記憶装置210から、罫線除去画像と、連結領域の検出結果とを読み出し、検出結果に基づいて、罫線除去画像において連結領域を結合し、第2記憶装置210に保存する。
 逆転画像生成回路236は、逆転画像生成部の一例であり、逆転画像生成部226と同様の機能を有する。逆転画像生成回路236は、第2記憶装置210から多値画像及び罫線除去画像を読み出し、読み出した各画像から逆転画像を生成し、第2記憶装置210に保存する。
 逆転二値画像生成回路237は、逆転二値画像生成部の一例であり、逆転二値画像生成部227と同様の機能を有する。逆転二値画像生成回路237は、第2記憶装置210から逆転画像を読み出し、逆転画像から逆転二値画像を生成し、表示装置203に出力する。
 文字検出回路238は、文字検出部の一例であり、文字検出部228と同様の機能を有する。文字検出回路238は、第2記憶装置210から逆転画像又は逆転二値画像を読み出し、読み出した画像から文字を検出し、検出結果を第2記憶装置210に保存する。
 出力制御回路239は、出力制御部の一例であり、出力制御部229と同様の機能を有する。出力制御回路239は、第2記憶装置210から文字の検出結果、逆転画像又は逆転二値画像を読み出し、読み出した情報を表示装置203に出力する。
 以上詳述したように、情報処理装置は、処理装置230を用いる場合も、低輝度背景と、低輝度背景上の高輝度文字と、罫線とを含む原稿の画像から文字を良好に検出することが可能となった。
 以上、好適な実施形態について説明してきたが、実施形態はこれらに限定されない。例えば、画像読取装置100と情報処理装置200の機能分担は、図1に示す画像処理システム1の例に限られず、画像読取装置100及び情報処理装置200の各部を画像読取装置100と情報処理装置200の何れに配置するかは適宜変更可能である。または、画像読取装置100と情報処理装置200を一つの装置で構成してもよい。
 例えば、画像読取装置100の第1記憶装置110が、情報処理装置200の第2記憶装置210に記憶された各プログラムを記憶し、画像読取装置100の第1CPU120が、情報処理装置200の第2CPU120により実現される各部として動作してもよい。また、画像読取装置100が、情報処理装置200の処理装置230と同様の処理装置を有してもよい。
 その場合、画像読取装置100は表示装置203と同様の表示装置を有する。認識処理は画像読取装置100で実行されるため、ステップS102、S201の入力画像の送受信処理は省略される。ステップS202~S212の各処理は、画像読取装置100の第1CPU120又は処理装置によって実行される。これらの処理の動作は、情報処理装置200の第2CPU220又は処理装置230によって実行される場合と同様である。
 また、画像処理システム1において、第1インタフェース装置101と第2インタフェース装置201は、インターネット、電話回線網(携帯端末回線網、一般電話回線網を含む)、イントラネット等のネットワークを介して接続してもよい。その場合、第1インタフェース装置101及び第2インタフェース装置201に、接続するネットワークの通信インタフェース回路を備える。また、その場合、クラウドコンピューティングの形態で画像処理のサービスを提供できるように、ネットワーク上に複数の情報処理装置を分散して配置し、各情報処理装置が協働して、認識処理等を分担するようにしてもよい。これにより、画像処理システム1は、複数の画像読取装置が読み取った入力画像について、効率よく認識処理を実行できる。
 1  画像処理システム
 200  情報処理装置
 221  取得部
 222  二値画像生成部
 223  罫線除去画像生成部
 224  領域検出部
 225  結合部
 226  逆転画像生成部
 227  逆転二値画像生成部
 228  文字検出部
 229  出力制御部

Claims (6)

  1.  低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得する取得部と、
     前記多値画像を二値化した二値画像を生成する二値画像生成部と、
     前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成する罫線除去画像生成部と、
     前記罫線除去画像内で黒色画素が連結する連結領域を検出する領域検出部と、
     前記領域検出部により検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合する結合部と、
     前記多値画像において、前記結合部により結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成する逆転画像生成部と、
     前記逆転画像から文字を検出する文字検出部と、
     前記検出された文字に関する情報を出力する出力部と、
     を有することを特徴とする画像処理装置。
  2.  前記罫線除去画像生成部は、前記二値画像内で黒色画素が連結する領域内の、水平又は垂直方向の長さが所定値以下である部分を白色画素に変換することにより、前記罫線除去画像を生成する、請求項1に記載の画像処理装置。
  3.  前記逆転画像生成部は、前記多値画像において、前記結合部により結合された連結領域に対応する領域内に、所定サイズ以上である高輝度文字が含まれる場合に限り、当該対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させる、請求項1または2に記載の画像処理装置。
  4.  前記逆転画像を二値化した逆転二値画像を生成する逆転二値画像生成部をさらに有し、
     前記文字検出部は、前記逆転二値画像から前記文字を検出する、請求項1~3の何れか一項に記載の画像処理装置。
  5.  出力部を有する画像処理装置の制御方法であって、前記画像処理装置が、
     低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、
     前記多値画像を二値化した二値画像を生成し、
     前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成し、
     前記罫線除去画像内で黒色画素が連結する連結領域を検出し、
     前記検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合し、
     前記多値画像において、前記結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、
     前記逆転画像から文字を検出し、
     前記検出された文字に関する情報を前記出力部から出力する、
     ことを含むことを特徴とする制御方法。
  6.  出力部を有するコンピュータの制御プログラムであって、
     低輝度背景と、前記低輝度背景上の高輝度文字と、複数の罫線とを含む原稿を撮像した多値画像を取得し、
     前記多値画像を二値化した二値画像を生成し、
     前記二値画像から前記複数の罫線の成分を除去した罫線除去画像を生成し、
     前記罫線除去画像内で黒色画素が連結する連結領域を検出し、
     前記検出された複数の連結領域の大きさの関係、前記複数の連結領域の位置の関係、又は、前記複数の連結領域の間の距離の内の少なくとも一つに基づいて、前記複数の連結領域を結合し、
     前記多値画像において、前記結合された連結領域に対応する領域内の低輝度背景領域の階調値と高輝度文字領域の階調値との関係を逆転させた逆転画像を生成し、
     前記逆転画像から文字を検出し、
     前記検出された文字に関する情報を前記出力部から出力する、
     ことを前記コンピュータに実行させることを特徴とする制御方法。
PCT/JP2018/040188 2018-10-29 2018-10-29 画像処理装置、制御方法及び制御プログラム Ceased WO2020089985A1 (ja)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/JP2018/040188 WO2020089985A1 (ja) 2018-10-29 2018-10-29 画像処理装置、制御方法及び制御プログラム
JP2020554629A JP7106672B2 (ja) 2018-10-29 2018-10-29 画像処理装置、制御方法及び制御プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2018/040188 WO2020089985A1 (ja) 2018-10-29 2018-10-29 画像処理装置、制御方法及び制御プログラム

Publications (1)

Publication Number Publication Date
WO2020089985A1 true WO2020089985A1 (ja) 2020-05-07

Family

ID=70463590

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2018/040188 Ceased WO2020089985A1 (ja) 2018-10-29 2018-10-29 画像処理装置、制御方法及び制御プログラム

Country Status (2)

Country Link
JP (1) JP7106672B2 (ja)
WO (1) WO2020089985A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230094787A1 (en) * 2021-09-30 2023-03-30 Adobe Inc. Utilizing machine-learning based object detection to improve optical character recognition

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109844A (ja) * 1999-10-06 2001-04-20 Internatl Business Mach Corp <Ibm> 文字列抽出方法、手書き文字列抽出方法、文字列抽出装置、および画像処理装置
JP2002279345A (ja) * 2001-03-16 2002-09-27 Ricoh Co Ltd 画像処理装置、画像処理方法及び該方法を実行するためのプログラムを格納したコンピュータ読み取り可能な記憶媒体
JP2004199622A (ja) * 2002-12-20 2004-07-15 Ricoh Co Ltd 画像処理装置、画像処理方法、記録媒体およびプログラム
JP2005071088A (ja) * 2003-08-25 2005-03-17 Canon Inc 画像処理装置、画像処理方法ならびにプログラム、記憶媒体

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001109844A (ja) * 1999-10-06 2001-04-20 Internatl Business Mach Corp <Ibm> 文字列抽出方法、手書き文字列抽出方法、文字列抽出装置、および画像処理装置
JP2002279345A (ja) * 2001-03-16 2002-09-27 Ricoh Co Ltd 画像処理装置、画像処理方法及び該方法を実行するためのプログラムを格納したコンピュータ読み取り可能な記憶媒体
JP2004199622A (ja) * 2002-12-20 2004-07-15 Ricoh Co Ltd 画像処理装置、画像処理方法、記録媒体およびプログラム
JP2005071088A (ja) * 2003-08-25 2005-03-17 Canon Inc 画像処理装置、画像処理方法ならびにプログラム、記憶媒体

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230094787A1 (en) * 2021-09-30 2023-03-30 Adobe Inc. Utilizing machine-learning based object detection to improve optical character recognition
US12288406B2 (en) * 2021-09-30 2025-04-29 Adobe Inc. Utilizing machine-learning based object detection to improve optical character recognition

Also Published As

Publication number Publication date
JP7106672B2 (ja) 2022-07-26
JPWO2020089985A1 (ja) 2021-05-13

Similar Documents

Publication Publication Date Title
JP6970835B2 (ja) 画像処理装置、制御方法及び制御プログラム
JP5701182B2 (ja) 画像処理装置、画像処理方法及びコンピュータプログラム
CN103324927B (zh) 图像处理装置以及文字识别方法
JP5701181B2 (ja) 画像処理装置、画像処理方法及びコンピュータプログラム
JP2020061720A (ja) 画像処理装置、制御方法及び制御プログラム
US10354352B2 (en) Image processing apparatus, image processing method, and storage medium
US10970579B2 (en) Image processing apparatus for placing a character recognition target region at a position of a predetermined region in an image conforming to a predetermined format
US8699809B2 (en) Image processing apparatus, image conversion method, and recording medium
JP7106672B2 (ja) 画像処理装置、制御方法及び制御プログラム
US10896344B2 (en) Information processing apparatus, information processing method, and computer program
JP6970834B2 (ja) 画像処理装置、制御方法及び制御プログラム
US9268998B2 (en) Image determining apparatus, image processing system, and recording medium
JP7022847B2 (ja) 画像処理装置、制御方法及び制御プログラム
WO2020157937A1 (ja) 画像処理装置、制御方法及び制御プログラム
JP7282257B2 (ja) 画像処理装置、制御方法及び制御プログラム
WO2020157938A1 (ja) 画像処理装置、制御方法及び制御プログラム
JP2006003993A (ja) ナンバープレート認識装置
CN101789081A (zh) 模糊文档图像的二值化方法及其设备
CN100492405C (zh) 二进制化文本图像的系统和方法
JP2021149459A (ja) 画像処理装置、制御方法及び制御プログラム
JP2023008183A (ja) 撮像装置、制御方法、プログラム及び記憶媒体
CN101853375A (zh) 图像比较容错处理系统及方法
JP2003244430A (ja) 画像処理装置
JP2002368987A (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: 18938945

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020554629

Country of ref document: JP

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18938945

Country of ref document: EP

Kind code of ref document: A1