The present invention relates to an information processing apparatus, a method for controlling the same, and a storage medium.
In digital printing systems in the commercial printing field, a scanner is arranged inline inside the machine of an image forming apparatus, and an anomaly in printed matter is detected from an image obtained by reading the printed matter. When executing anomaly detection, there is a detection method (referred to as RIP detection hereinafter) in which a difference is detected as an anomaly by comparing image data of a bitmap raster image generated in RIP processing and read image data obtained by a scanner. Note that RIP is an abbreviation for raster image processor.
Such RIP detection has the following problems. In a digital printing system, a creator of the print data can also specifically designate the type of font to be used and the like in the print data. However, there are cases where the font designated in the print data cannot be used on the image forming apparatus side, and in such cases, the font is replaced with another font on the image forming apparatus side. In this case, a character after RIP expansion may be changed to a character that the creator does not intend, resulting in a so-called “garbled character” in some cases. Also, it is known that a combination of fonts with transparency effects, special effects, and the like causes problems such as a garbled character, a skipped character, and a missing character.
Bitmap image data after RIP processing may already have character problems such as a garbled character, a skipped character, and a missing character in this manner. Thus, when performing RIP detection on an image read by a scanner, there is a problem that a character problem cannot be detected by comparing the bitmap image data with data obtained after the character problem has occurred. That is, when both the image data generated through RIP processing and the scanned image data have character problems in a similar manner, there is a problem that it may be determined that the data is normal. Japanese Patent Laid-Open No. 2017-121769 proposes a technique for inspecting a garbled character by comparing PDL text data extracted from the print data written in the PDL language before RIP processing is performed, with text data recognized by OCR of bitmap RIP image data after RIP processing is performed.
However, the above conventional technique has the following issues. In the above conventional technique, the extraction order in which PDL text data is extracted from PDL data needs to match the recognition order in which OCR text data is recognized through OCR of the RIP image. Note that PDL is an abbreviation for page-description language, and OCR is an abbreviation for optical character recognition. In a case where the extraction order matches the recognition order, a garbled character can be detected by comparing pieces of character information in order. However, the extraction order of PDL text data does not always match the recognition order of OCR text data recognized through OCR of the RIP image. The above conventional technique does not consider the extraction order and the recognition order, and thus is problematic in that correct inspection cannot be performed in a case where these orders are different from each other.
For example, when creating PDL data from an application such as Notepad or WordPad, PDL drawing commands for text objects are issued regularly from the upper left to the lower right with the upper left used as a reference point. Therefore, the PDL text data to be extracted from PDL data is extracted in a regular text arrangement from the upper left to the lower right with the upper left used as a reference point. On the other hand, when creating PDL data from an application that allows free layout, such as PowerPoint or InDesign, a sequence of PDL drawing commands for text objects to be issued does not have regularity. In such a case, PDL drawing commands are issued in the order in which a user places the text objects. Therefore, the PDL text data to be extracted from PDL data is extracted in an irregular text arrangement depending on the creator.
Also, regarding OCR of a RIP image, generally, text is recognized regularly from the upper left to the lower right with the upper left used as a reference point. In such a case, PDL data created from Notepad and WordPad applications can be compared therewith correctly because the arrangements of text objects match. However, comparison with PDL data having an irregular text arrangement is problematic in that correct comparison cannot be achieved. OCR does not only use the upper left as a reference point, but also recognizes text in consideration of vertical writing, tables, column layouts, and the like, as well as only recognizes a portion including text whose position has been acquired in advance based on RIP processing or image processing information as in the conventional technique. However, any OCR is problematic in that correct comparison cannot be achieved because the arrangement of text objects of the PDL text data extracted from PDL data is not considered.
The present invention enables realization of a mechanism for inspecting anomalies of the RIP data even in a case where PDL text data extraction order and OCR text data recognition order differ from each other.
One aspect of the present invention provides an information processing apparatus comprising: one or more memory devices that store a set of instructions; and one or more processors that execute the set of instructions to: acquire, from first data, first text data relating to text included in the first data, the first data being print data; convert the first data into second data, the second data being raster image data; acquire, from the second data, second text data relating to text included in the second data; and compare the first text data and the second text data using text position information, and inspect whether the second data has an anomaly.
Another aspect of the present invention provides a method for controlling an information processing apparatus, comprising: acquiring, from first data, first text data relating to text included in the first data, the first data being print data; converting the first data into second data, the second data being raster image data; acquiring, from the second data, second text data relating to text included in the second data; and comparing the first text data and the second text data using text position information, and inspecting whether the second data has an anomaly.
Still another aspect of the present invention provides a non-transitory computer-readable storage medium storing a computer program for causing a computer to execute each step in a method for controlling an information processing apparatus, the control method including: acquiring, from first data, first text data relating to text included in the first data, the first data being print data; converting the first data into second data, the second data being raster image data; acquiring, from the second data, second text data relating to text included in the second data; and comparing the first text data and the second text data using text position information, and inspecting whether the second data has an anomaly.
Further features of the present invention will be apparent from the following description of exemplary embodiments with reference to the attached drawings.
Hereinafter, embodiments will be described in detail with reference to the attached drawings. Note, the following embodiments are not intended to limit the scope of the claimed invention. Multiple features are described in the embodiments, but limitation is not made to an invention that requires all such features, and multiple such features may be combined as appropriate. Furthermore, in the attached drawings, the same reference numerals are given to the same or similar configurations, and redundant description thereof is omitted.
Hereinafter, a first embodiment according to the present invention will be described. In this embodiment, inspection control performed in a case where the extraction order in which PDL text data is extracted from PDL data (print data) differs from the recognition order in which OCR text data is recognized through OCR of a RIP image (raster image data) will be described. In this embodiment, an information processing apparatus described below inspects whether there are any anomalies in the RIP data of correct answer data used in an inspection apparatus that inspects printed matter.
First, an example of the hardware configuration of an information processing apparatus 100 according to an embodiment will be described with reference to
In this embodiment, the information processing apparatus will be described as an example of an apparatus to which the present invention is applied. Therefore, the information processing apparatus according to this embodiment inspects whether or not RIP data, which will be correct answer data in the inspection of printed matter, has an anomaly such as a garbled character or a skipped character, and provides the inspection results, and corrected RIP data, and the like to an image forming apparatus or an image processing apparatus that inspects printed matter. However, there is no intention to limit the present invention, and the present invention may be applied to an image processing apparatus provided with at least one of a printer that forms an image on a sheet and a scanner that reads an image from an original. That is, an image processing apparatus, which inspects printed matter, may also inspect RIP data, which will be correct answer data in the inspection of printed matter.
Next, an example of the software configuration of the information processing apparatus 100 according to this embodiment will be described with reference to
As described above, the CPU 101 executes programs loaded from the ROM 103 onto the RAM 102, and thus these software modules operate. The PDL data receiving unit 201 receives PDL data, which is print data (first data), from an external apparatus such as the external apparatus 108 via a network. The PDL data analyzing unit 202 is an example of first acquiring unit, and analyzes PDL data received by the PDL data receiving unit 201, and acquires PDL text data (first text data) from a drawing command in the PDL data.
The RIP unit 203 is an example of converting unit, and executes so-called RIP processing for expanding the acquired PDL data into a bitmap image with a designated resolution, thereby generating raster image data (second data). The OCR unit 204 is an example of second acquiring unit, and executes OCR processing on the image obtained through RIP processing, and generates OCR text data (second text data). The text inspecting unit 205 is an example of inspecting unit, and searches for OCR text data (second data) at a corresponding position based on coordinate information of the extracted PDL text data (first data), and inspects text obtained after RIP processing.
Next, a procedure for creating text data according to this embodiment will be described with reference to
First, in step S301, the PDL data receiving unit 201 receives PDL data via the network I/F 104. Then, in step S302, the PDL data analyzing unit 202 extracts PDL text data from the received PDL data, and creates a list of PDL text data for each page.
Here, an example in which a list of PDL text data is created from PDL data of a predetermined page will be described with reference to
For example, the PDL drawing command 401 references font resource: /F1, acquires font information 405, and draws a text object “P.1” with font: Calibri, font size: 36 pt, and start position: (x, y)=(658.61, 26.472), using black for filling and as the contour color. Similarly, the PDL drawing commands 402 to 404 are interpreted, and drawing is performed. PDF is used as an example in this embodiment, but other PDL types such as LIPSLX and PCL6 may also be used.
The PDL data analyzing unit 202 analyzes the PDL drawing commands 401 to 404 in the PDL data 400 in the stated order. More specifically, the PDL data analyzing unit 202 breaks down a text object into text data for each character for each command, and extracts information regarding a character, font, coordinates of a rectangular region (“bbox” hereinafter) surrounding the character, and a color value.
Also, text data 502 is information extracted by interpreting the PDL drawing command 404, and indicates the following:
Here, returning to a description of
FIGS. 6B1-6B3 show an example of an OCR text data list created from the RIP image in a case where RIP processing can be properly performed on the PDL data 400.
Also, reference numeral 602 in
FIGS. 7B1-7B3 are an example of an OCR text data list created from a RIP image having a character garbled when PDL data 400 is subjected to RIP processing.
FIGS. 8B1-8B3 are an example of an OCR text data list created from a RIP image having a skipped character when PDL data 400 is subjected to RIP processing.
When a garbled character or a skipped character occurs during RIP processing in this manner, these anomalies will be reflected as they are in the OCR text data list created from the RIP image. Therefore, even when printed matter is inspected using these sets of data as correct answer data, there is a problem that the correct answer data may include an anomaly and thus inspection cannot be performed properly. In view of this, in this embodiment, even when an anomaly such as a garbled character or a skipped character occurs in RIP processing as described above, control is provided for accurately inspecting the printed matter. The PDL text data list 500 and the OCR text data lists 600, 700, and 800 each include position information (coordinate information) for each character. The information processing apparatus according to this embodiment suitably inspect printed matter using these pieces of position information. The inspection procedure will be described below in detail.
Next, a processing procedure for inspecting text after RIP processing in the information processing apparatus 100 according to this embodiment will be described with reference to
In step S901, the text inspecting unit 205 acquires the list of PDL text data and the list of OCR text data for each page created as shown in
Then, in step S902, the text inspecting unit 205 determines whether or not there is text data to be read from the PDL text data list. In a case where there is text data to be read (YES in step S902), processing proceeds to step S903, whereas in a case where there is no text data to be read (NO in step S902), the processing proceeds to step S906. In step S903, the text inspecting unit 205 performs text inspection based on information of the read PDL text data. Details of text inspection will be described later using
In step S905, the text inspecting unit 205 reads the next text data, returns the processing to step S903, and performs text inspection. This is repeated until reading of text data is completed. In step S906, the text inspecting unit 205 determines whether or not there is a next page. In a case where there is a next page (YES in step S906), the text inspecting unit 205 reads the next page in step S907 and returns processing to step S901. That is, processing from step S901 to step S905 is repeated until there is no next page. In a case where all pages are read and there is no next page (NO in step S906), the processing proceeds to step S908. In step S908, the CPU 101 functions as result outputting unit, issues a notification regarding an inspection result, and ends the processing of this flowchart. Here, the inspection result may be displayed on a display unit of the information processing apparatus 100, stored in a storage unit, or transmitted to an external apparatus.
Next, a detailed processing procedure of text inspection in step S903 shown in
In step S1001, the text inspecting unit 205 uses coordinate information (position information) of the PDL text data for text of interest to search the list of OCR text data for OCR text data having similar coordinate information. In step S1002, the text inspecting unit 205 determines whether or not there is the corresponding OCR text data. In a case where there is the corresponding OCR text data (YES in step S1002), processing proceeds to step S1003, whereas in a case where there is no corresponding text data (NO in step S1002), the processing proceeds to step S1005.
In step S1003, the text inspecting unit 205 compares character information of PDL text data with that of the corresponding OCR text data to determine whether or not they match. In a case where they match (YES in step S1003), processing proceeds to step S1004, whereas in a case where they do not match (NO in step S1003), the processing proceeds to step S1005. In step S1004, the text inspecting unit 205 stores the comparison result indicating that there is no anomaly, and ends the processing of this flowchart. On the other hand, in step S1005, the text inspecting unit 205 stores the result indicating that there is an anomaly, the anomaly content, characters, coordinate information, and the like, and ends the processing of this flowchart.
A case where PDL text data is compared with the list of OCR text data of the normal RIP image shown in
The bbox coordinates of PDL text data extracted from the PDL data do not always match the bbox coordinates of OCR text data recognized through OCR of the RIP image in some cases. Thus, it is desirable that a tolerance is set and a determination with some ambiguity is made rather than a perfect match. For example, although the bbox coordinates of the PDL text data 501 and the bbox coordinates of OCR text data 602 do not perfectly match, in a case where the coordinate positions overlap each other and errors in width and height (i.e., position errors) are less than predetermined thresholds, it is determined that the coordinates are similar to each other. A method for making a determination with some ambiguity is not limited to this.
A case where PDL text data is compared with a list of OCR text data of a RIP image including a garbled character shown in
A case where PDL text data is compared with a list of OCR text data of a RIP image including a skipped character shown in
As described above, the information processing apparatus according to this embodiment acquires, from PDL data, which is print data, PDL text data regarding text included in the PDL data, and converts the PDL data into RIP data, which is raster image data. Also, the information processing apparatus acquires, from RIP data, OCR text data regarding text included in the RIP data, compares the PDL text data and the OCR text data using text position information, and inspects whether RIP data has an anomaly. Also, the information processing apparatus performs text inspection by searching for OCR text data at a corresponding position using coordinate information (position information) of the PDL text data. Therefore, even when the extraction order in which PDL text data is extracted from PDL data differs from the recognition order in which OCR text data is recognized through OCR of the RIP image, a garbled character occurring after RIP processing can be inspected. Further, it is possible to inspect not only garbled characters but also character problems such as missing characters or skipped characters. As described above, according to this embodiment, it is possible to inspect anomalies of the RIP data even in a case where PDL text data extraction order and OCR text data recognition order differ from each other.
Hereinafter, a second embodiment according to the present invention will be described using the drawings. In this embodiment, a text comparison performed in a case where editing is performed on PDL data during RIP processing will be described as an example. Note that the configuration of the information processing apparatus according to this embodiment is similar to that of the above-described first embodiment shown in
First, an example in which editing is performed on PDL data during RIP processing will be described with reference to
Next, a procedure for creating text data according to this embodiment will be described with reference to
First, in step S1501, the PDL data receiving unit 201 receives PDL data via the network I/F 104. Then, in step S1502, the PDL data analyzing unit 202 extracts PDL text data from the received PDL data, and creates a list of PDL text data for each page.
Here, a list of PDL text data for each page will be described with reference to
In step S1503, the RIP unit 203 expands the acquired PDL data into a bitmap image according to a designated resolution and edit settings, and creates a RIP image. In step S1504, the RIP unit 203 acquires RIP processing parameters according to the edit settings. In the edit settings, it is possible to set the paper size, paper orientation, page consolidation, and the like. The RIP unit 203 performs conversion such as page consolidation, rotation, enlargement/contraction on the acquired PDL data in accordance with the edit settings to create a RIP image. Here, a RIP image consolidated into 2-in-1 is created. Thus, the RIP processing parameters indicate the contents of the edit settings, and are, for example, values indicating 2-in-1 in a case where the edit processing is page consolidation.
Then, in step S1505, the OCR unit 204 executes OCR processing for each RIP image, and creates a list of OCR text data.
Because 2-in-1 processing is performed, only one OCR text data list is created. Because the PDL text data list created from the original PDL data is divided into two and the OCR text data list has been subjected to edit processing to one, it is not possible to compare pieces of coordinate information and inspect text.
In view of this, in step S1506, the text inspecting unit 205 converts the PDL text data list using the RIP processing parameter acquired in step S1504, and creates a corrected PDL text data list.
As described above, in the information processing apparatus according to this embodiment, PDL data is edited in accordance with print settings and then converted into RIP data, and the acquired PDL text data is further corrected in accordance with parameters involved in the editing. Further, the information processing apparatus acquires OCR text data from the RIP data in accordance with the parameters involved in the editing. In this embodiment, in a case where editing is performed on the PDL data during RIP processing, the PDL text data is corrected in consideration of the RIP processing parameter in this manner. As a result, even when editing is performed on the PDL data during RIP processing, it is possible to compare and inspect the PDL text data and the OCR text data, and to inspect character problems such as garbled characters, missing characters, and skipped characters. Therefore, according to this embodiment, even when the PDL data is edited in accordance with print settings during RIP processing, it is possible to obtain effects similar to those of the first embodiment.
Embodiment(s) of the present invention can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment(s) and/or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2023-139122, filed Aug. 29, 2023, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2023-139122 | Aug 2023 | JP | national |