Patent Description:
A printed product output from a printing apparatus sometimes has a stain arising from attachment of a color material to an unintended portion, or a color loss arising from a failure of attachment of a sufficient amount of color material to a portion where an image should be formed. The quality of a printed product needs to be guaranteed by inspecting the presence/absence of such print defects. A visual inspection by an inspector requires a long time and high cost, so inspection systems that automatically perform inspection are proposed recently. Such an inspection system can detect the presence/absence of a print defect on an inspection target based on a difference between a reference image serving as image data representing a defect-free printed product, and a target image serving as image data of a printed product serving as the inspection target.

In general, the positional relationship between a medium and a picture printed on the medium slightly varies every printing owing to variations of a print position along with an error of a medium conveyance position in a printing apparatus, variations of the size of a medium along with an error of a cutting position, or the like. When automatically inspecting a printed product, alignment needs to be performed to make the pictures of a reference image and a target image match with each other. For example, the document <CIT> discloses an apparatus that inspects a printed product by comparing a read image of a printed product with a master image. In the document <CIT>, a master image is obtained by aligning each of a read image of preprint paper before printing and a print image to be printed on the preprint paper with a read image of a printed product based on reference points such as edge points, and then compositing them. The document <CIT> discloses an inspection apparatus which includes a receiving unit configured to receive preprint image data preprinted on a sheet and document image data printed on the preprinted sheet, a composing unit configured to compose reference image data from the received preprint image data and the received document image data, a reading unit configured to read the sheet on which both the preprint image data and the document image data has been printed, to obtain read image data, a processing unit configured to carry out predetermined image process on a first and second area corresponding to the document image data and the preprint image data of the read image data, to generate inspection image data, and an inspecting unit configured to inspect the sheet on which both the preprint image data and the document image data has been printed, by comparing the inspection image data with the reference image data. The document <CIT> discloses an image inspection apparatus for checking an image printed on a recording medium comprising: a reference pixel obtaining unit configured to generate a reference image and obtain a first pixel value from the reference image; a print pixel obtaining unit configured to extract an image printed area and obtain a second pixel value from the image; an offset processing unit configured to add a non-image-printed area; and an image checking unit configured to compute a difference between the first image pixel value and the second image pixel value and detect an error when the difference is higher than a predetermined threshold value, wherein the non-image-printed area contains a third pixel value that is different from the first pixel value or the second pixel value, and the image checking unit suspends a determination whether or not there is an error in the image printed area associated with the non-image-printed area.

The present invention in its first aspect provides an image processing apparatus as specified in claims <NUM> to <NUM>.

The present invention in its second aspect provides an image processing method as specified in claim <NUM>.

The present invention in its third aspect provides a computer program as specified in claim <NUM>.

Note that the following embodiments are not intended to limit the scope of the claimed invention, and limitation is not made an invention that requires all combinations of features described in the embodiments. Two or more of the multiple features described in the embodiments may be combined as appropriate. Furthermore, the same reference numerals are given to the same or similar configurations, and redundant description thereof is omitted.

In the document <CIT>, a master image based on print image data used for printing and a read image of a printed product are compared. To guarantee the quality of an actual printed product, a read image of a defect-free printed product is desirably used as a reference image. However, when the positional relationship between a medium and a picture printed on the medium varies, as described above, if alignment is performed to make printed pictures in a target image and a reference image match with each other, the position of the periphery of the medium may change to increase a difference near the periphery of the medium. As a result, an inaccurate inspection result may be obtained at the periphery of the medium.

An embodiment of the present invention enables a proper inspection of a printed product even when a print position error occurs.

An image processing apparatus according to the first embodiment inspects the presence/absence of a defect on an inspection target medium having undergone printing. In this embodiment, out of the inspection target medium, a region where printing is performed (region where a color material is fixed and a picture is formed; to be simply referred to as a picture region), and a region at the periphery of the medium where no printing is performed (to be simply referred to as an peripheral region) are determined, and inspection processing corresponding to each region is selected. According to the embodiment, even when a print position error occurs, a defect at the periphery of a medium can be detected more accurately.

<FIG> is a view showing the arrangement of a whole printing system that includes an image processing apparatus <NUM> serving as an image processing apparatus according to the first embodiment, and performs output and inspection of a printed product. The printing system according to the first embodiment includes the image processing apparatus <NUM> and a printing apparatus <NUM>. The printing system according to the first embodiment may further include a printing server <NUM>.

The printing server <NUM> generates a print job including an original to be printed, and inputs the print job to the printing apparatus <NUM>. The printing apparatus <NUM> forms an image on a print medium based on the print job input from the printing server <NUM>. The printing apparatus <NUM> includes a sheet feeding unit <NUM>, and the user can supply in advance print sheets to the sheet feeding unit <NUM>. When the print job is input, the printing apparatus <NUM> forms an image on one or two surfaces of a print medium supplied to the sheet feeding unit <NUM> while conveying the print medium along a conveyance path <NUM>. Then, the printing apparatus <NUM> sends the print medium to the image processing apparatus <NUM>.

The image processing apparatus <NUM> inspects a defect on a print medium (inspection target medium) having undergone printing. The inspection target medium is obtained by forming an image on the print medium by the printing apparatus <NUM>, and is conveyed through the conveyance path <NUM> inside the printing apparatus <NUM>. The image processing apparatus <NUM> may incorporate a CPU <NUM>, a RAM <NUM>, and a ROM <NUM>. The image processing apparatus <NUM> may include an image reading device <NUM>, a printing apparatus interface (I/F) <NUM>, a general-purpose interface (I/F), a user interface (UI) panel <NUM>, and a main bus <NUM>. Further, the image processing apparatus <NUM> may have a conveyance path <NUM> for a print medium that is connected to the conveyance path <NUM> of the printing apparatus <NUM>. The image processing apparatus <NUM> may include an output tray <NUM> to which an inspection target medium determined to be accepted by inspection is output, and an output tray <NUM> to which an inspection target medium determined to be rejected by inspection is output. In the example of <FIG>, the output trays <NUM> and <NUM> are connected to the CPU <NUM> via the main bus <NUM>. The output tray <NUM> or <NUM> is set as the conveyance destination of an inspection target medium in accordance with the result of inspection on the inspection target medium.

The image processing apparatus according to each embodiment to be described later can be implemented by a computer including a processor and a memory. For example, the function of each unit shown in <FIG>, <FIG>, and the like to be described later can be implemented by executing a program stored in a memory such as the RAM <NUM> or the ROM <NUM> by a processor such as the CPU <NUM>. The processor such as the CPU <NUM> can also control each module in the image processing apparatus <NUM>, as needed. Note that the image processing apparatus according to the embodiment of the present invention may be constituted by, for example, a plurality of processing apparatuses connected via a network.

The CPU <NUM> is a processor that controls each unit in the image processing apparatus <NUM>. The RAM <NUM> temporarily holds an application executed by the CPU <NUM>, data used for image processing, or the like. The ROM <NUM> stores programs executed by the CPU <NUM>.

The image reading device <NUM> reads, on the conveyance path <NUM>, one or two surfaces of a print medium sent from the printing apparatus <NUM>, and obtains them as image data. Since the conveyance path <NUM> serves as a background when the image reading device <NUM> reads an image on a print medium, it can be constituted to have a color (for example, black) easily discriminable from a print medium on an image. The printing apparatus I/F <NUM> is connected to the printing apparatus <NUM>, and the image processing apparatus <NUM> can communicate with the printing apparatus <NUM> via the printing apparatus I/F <NUM>. For example, the printing apparatus <NUM> and the image processing apparatus <NUM> can be synchronized via the printing apparatus I/F <NUM> to notify each other of their operating situations. The UI panel <NUM> can output information to the user. The UI panel <NUM> may be a display device such as a liquid crystal display and can function as the user interface of the image processing apparatus <NUM>. The UI panel <NUM> can notify the user of, for example, the current situation or settings of the image processing apparatus <NUM>. The UI panel <NUM> may include an input device such as a touch panel or a button and can accept an instruction from the user. The main bus <NUM> is a transmission path that connects the modules of the image processing apparatus <NUM>.

The image processing apparatus <NUM> performs inspection processing to check the presence/absence of a defect on a print medium based on image data of the print medium obtained by the image reading device <NUM> while the print medium output from the printing apparatus <NUM> is conveyed along the conveyance path <NUM>. If the print medium is determined to be accepted as a result of the inspection processing, it is conveyed to the output tray <NUM>. If the print medium is determined to be rejected as a result of the inspection processing, it is conveyed to the output tray <NUM>. By this operation, only print media determined to have no defect are output onto the output tray <NUM>.

<FIG> is a block diagram showing the functional arrangement of the image processing apparatus <NUM> according to the embodiment. Each rectangular frame represents a functional module that performs each processing according to the embodiment, and each arrow indicates a flow of data. The arrangement in <FIG> is merely an example, and the image processing apparatus <NUM> according to the embodiment is not limited to one shown in <FIG>.

An image obtaining unit <NUM> obtains the first image serving as a read image of an inspection target medium having undergone printing, and the second image serving as a read image of a reference medium representing a target print result. In this embodiment, the image obtaining unit <NUM> obtains image data obtained by reading a print medium on the conveyance path <NUM> by the image reading device <NUM>. The image reading device <NUM> reads print media at least at two different times and generates respective image data of the print media. An image obtained by reading a reference medium at the first time by the image reading device <NUM> will be called a reference image <NUM>, and an image obtained by reading an inspection target medium at the second or subsequent time will be called a target image <NUM>.

A region determination unit <NUM> determines a picture region <NUM> and a peripheral region <NUM> in each of the reference image <NUM> and the target image <NUM> obtained by the image obtaining unit <NUM>. The region determination unit <NUM> can determine a region to which each pixel of image data belongs. In this embodiment, the region determination unit <NUM> divides the target image <NUM> into the picture region <NUM> and the peripheral region <NUM>. The region determination unit <NUM> can also divide the reference image <NUM> into the picture region <NUM> and the peripheral region <NUM>.

A processing selection unit <NUM> sets an inspection to be performed by an inspection processing unit <NUM> in accordance with the type of a region determined by the region determination unit <NUM>. In this embodiment, the processing selection unit <NUM> selects inspection processing used for each of the picture region <NUM> and the peripheral region <NUM>.

An alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM>. The alignment unit <NUM> can align images in accordance with the brightness of the images. For example, the alignment unit <NUM> can align the reference image <NUM> and the target image <NUM> based on objects in the images. More specifically, the alignment unit <NUM> can calculate a geometric correction parameter so that when geometric correction is performed on one image, an object in one image comes close to an object in the other image.

The alignment unit <NUM> according to the embodiment performs alignment with the reference image <NUM> for the picture region <NUM> of the target image <NUM>. For example, the alignment unit <NUM> can calculate a position displacement amount between images in the picture regions <NUM> of the target image <NUM> and reference image <NUM> based on the brightness of the picture region <NUM> observed from each of the target image <NUM> and the reference image <NUM>. The position displacement amount calculated in this embodiment can include a translation amount, a rotation amount, and a scaling amount.

The inspection processing unit <NUM> inspects a defect on an inspection target medium based on the reference image <NUM> and the target image <NUM>. In this embodiment, the inspection processing unit <NUM> performs inspection at inspection settings different between the print region and peripheral region of an inspection target medium. The processing selection unit <NUM> makes inspection settings. In this embodiment, as for the print region (that is, the picture region <NUM> of the target image <NUM>) of the inspection target medium, the inspection processing unit <NUM> determines a defect based on a comparison between the target image <NUM> and the reference image <NUM>. For example, the inspection processing unit <NUM> can calculate a difference between the reference image <NUM> and the target image <NUM> and perform inspection in a state in which the alignment unit <NUM> aligns them. The inspection processing unit <NUM> can determine that a portion having a large difference between the reference image <NUM> and the target image <NUM> is a defective portion. As for the peripheral region (that is, the peripheral region <NUM> of the target image <NUM>) of the inspection target medium, the inspection processing unit <NUM> determines a defect at an inspection setting different from that of the print region. A detailed method will be described later.

Processing performed by the image processing apparatus <NUM> having the above-described arrangement according to the embodiment will be described below. <FIG> is a flowchart showing a sequence of processing performed by the image processing apparatus <NUM>.

In step S1010, the image obtaining unit <NUM> obtains the reference image <NUM> obtained by reading a reference medium on the conveyance path <NUM> by the image reading device <NUM> in the above-described manner, and stores it in the RAM <NUM>. The reference image <NUM> is used for subsequent processing to inspect each target image <NUM>.

In step S1020, the image obtaining unit <NUM> obtains the target image <NUM> obtained by reading an inspection target medium on the conveyance path <NUM> by the image reading device <NUM> in the above-described manner, and stores it in the RAM <NUM>. In subsequent steps S1030 to S1070, inspection of the target image <NUM> obtained in step S1020 is performed.

In step S1010, the image reading device <NUM> can generate the reference image <NUM> by reading the reference medium. In step S1020, the image reading device <NUM> can generate the target image <NUM> by reading the inspection target medium. The embodiment is also applicable to a case in which the reference image <NUM> or the target image <NUM> obtained using another device is used. For example, the reference image <NUM> or the target image <NUM> obtained by a device different from the image reading device <NUM> may be stored in an auxiliary storage device (not shown). In this case, the image obtaining unit <NUM> can obtain the reference image <NUM> or the target image <NUM> from the auxiliary storage device in step S1010 or S1020.

<FIG> is a view showing an example of the target image <NUM>. The target image <NUM> includes a print medium region <NUM> where a print medium is captured, and a background region <NUM> where no print medium is captured. In the example of <FIG>, the image reading device <NUM> reads the target image <NUM> so that the conveyance path <NUM> is captured as a background around the print medium region <NUM> in order to obtain the image of the entire print medium. In this embodiment, the conveyance path <NUM> is black, so the background region <NUM> becomes black. Similar to the target image <NUM>, the reference image <NUM> includes a print medium region where a print medium is captured, and a background region where no print medium is captured.

In step S1030, the region determination unit <NUM> detects the picture region <NUM> and the peripheral region <NUM> in the target image <NUM> by performing region determination for the target image <NUM>. In this example, the region determination unit <NUM> first extracts the print medium region <NUM> from the target image <NUM>. The region determination unit <NUM> can extract the print medium region <NUM> in the following way. First, the region determination unit <NUM> binarizes the target image <NUM>, traces pixels serving as the boundary between white pixels and black pixels, and linearly approximates four sides representing the outline of the print medium. As a result, four straight lines representing the outline of the print medium region <NUM> are estimated. Then, the region determination unit <NUM> calculates the intersection points of the four straight lines. The intersection points correspond to vertices 308a to 308d of the print medium region <NUM> shown in <FIG>. Needless to say, the method of extracting the print medium region <NUM> is not limited to the above-described one, and another method is also available.

After that, the region determination unit <NUM> detects the picture region <NUM> and the peripheral region <NUM> from the print medium region <NUM> of the target image <NUM>. In this embodiment, the region determination unit <NUM> determines to which of the picture region <NUM> and the peripheral region <NUM> each pixel constituting the print medium region <NUM> belongs. <FIG> shows the relationship between the target image <NUM>, the print medium region <NUM>, the picture region <NUM> (shown in <FIG> as a region where white and pictures exist), and the peripheral region <NUM> (hatched in <FIG>). In the example of <FIG>, the inside of the print medium region <NUM> belongs to either the picture region <NUM> or the peripheral region <NUM>.

In this embodiment, the region determination unit <NUM> can determine, as the peripheral region <NUM>, a region within a predetermined distance from the outline of the medium on the reference image <NUM> or the target image <NUM>. For example, the region determination unit <NUM> can extract, as the peripheral region <NUM>, a region within a predetermined distance from the outline of the print medium region <NUM>, and extract the remaining region as the picture region <NUM>. The predetermined distance that defines the peripheral region <NUM> can be called a peripheral margin and set in advance by the user prior to processing.

The method of detecting the peripheral region <NUM> is not limited to the above-described one. For example, the region determination unit <NUM> can detect a marker applied to a medium on the reference image <NUM> or the target image <NUM>, and determine the peripheral region <NUM> based on the coordinates of the marker. More specifically, when an alignment marker such as a register mark is printed on a print medium, the region determination unit <NUM> may set a peripheral margin based on the coordinates of the alignment marker. The peripheral margin may be set based on a margin amount or a print position error amount when the printing apparatus <NUM> prints on a medium on the reference image <NUM> or the target image <NUM>. For example, the region determination unit <NUM> may obtain information representing the average values of a margin size and print error amount at the time of printing from the printing apparatus <NUM>, and set the sum of the average values of the margin size and print error amount as the peripheral margin. Further, the region determination unit <NUM> may determine the plain region of the print medium region <NUM> as the peripheral region <NUM> and the remaining region as the picture region <NUM>.

In this embodiment, the region determination unit <NUM> calculates feature information (in this example, average brightness) about the peripheral region <NUM> detected from the reference image <NUM>. The feature information is used in step S1060, details of which will be described later.

By performing similar processing on the reference image <NUM>, the region determination unit <NUM> can extract the print medium region <NUM> of the reference image <NUM>. Also, the region determination unit <NUM> can extract the picture region <NUM> and peripheral region <NUM> of the reference image <NUM>. Note that the image obtaining unit <NUM> may extract the print medium region <NUM>, picture region <NUM>, and peripheral region <NUM> of the reference image <NUM> in step S1010.

In step S1040, the processing selection unit <NUM> selects the details of detection processing to be performed for the picture region <NUM> in step S1060, and those of inspection processing to be performed for the peripheral region <NUM> in step S1070. In step S1060, defect determination is performed for the picture region <NUM> at the settings selected by the processing selection unit <NUM>. In step S1070, defect determination is performed for the peripheral region <NUM> at the settings selected by the processing selection unit <NUM>. The details of inspection processing selected by the processing selection unit <NUM> can be set in advance by the user prior to processing. In this embodiment, the processing selection unit <NUM> selects defect determination processing based on a comparison between the reference image <NUM> and the target image <NUM> for the picture region <NUM>, and defect determination processing based on a comparison between the target image <NUM> and feature information for the peripheral region <NUM>.

In step S1050, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM>. In this embodiment, defect determination processing based on a comparison between the reference image <NUM> and the target image <NUM> is performed only for the picture region <NUM>. Hence, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the picture region <NUM>.

An example of processing performed by the alignment unit <NUM> will be explained with reference to <FIG> showing an outline of alignment processing. <FIG> shows the picture region <NUM> and reference points 307a to 307c in the reference image <NUM>. <FIG> shows the picture region <NUM> and the reference points 307a to 307c in the target image <NUM>. The reference point <NUM> is a point indicating the same portion of the same object in the picture regions <NUM> of the reference image <NUM> and the target image <NUM>, and is also called a feature point. In this embodiment, the three reference points 307a to 307c are set and used for alignment. In <FIG>, the same reference numerals denote corresponding reference points. For example, the reference point 307a of the reference image <NUM> and the reference point 307a of the target image <NUM> indicate the same portions of a picture though the coordinates in the respective images are different. This also applies to the reference points 307b and 307c.

In this embodiment, the positions of the reference points 307a to 307c with respect to a picture to be printed by the printing apparatus <NUM> are set in advance. Note that the user may manually set the reference points 307a to 307c while checking the picture. The reference points 307a to 307c may be automatically set using an image feature amount such as SIFT or SURF. The alignment unit <NUM> can detect the set reference points 307a to 307c by image analysis on the picture regions <NUM> of the reference image <NUM> and the target image <NUM>. In this embodiment, printing is performed on an inspection target medium in accordance with preset print data, so rough appearance positions of the reference points can be predicted. The alignment unit <NUM> can detect the reference points 307a to 307c by setting windows of a predetermined size (for example, <NUM> × <NUM> pixels) near the predicted positions of the reference points 307a to 307c, and performing template matching. As another method, the alignment unit <NUM> may detect the reference points 307a to 307c using processing of detecting an image feature amount such as SIFT or SURF mentioned above.

The alignment unit <NUM> detects the reference points 307a to 307c, obtaining the coordinates of the respective reference points 307a to 307c in each of the reference image <NUM> and the target image <NUM>. The coordinates of the reference points 307a, 307b, and 307c in the reference image <NUM> are defined as (x1a, y1a), (x1b, y1b), and (x1c, y1c), respectively. The coordinates of the reference points 307a, 307b, and 307c in the target image <NUM> are defined as (x2a, y2a), (x2b, y2b), and (x2c, y2c).

Then, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the positions of the corresponding reference points 307a to 307c detected from the reference image <NUM> and the target image <NUM>. For example, when geometric transformation is applied to the reference image <NUM>, the alignment unit <NUM> can calculate a geometric transformation for alignment so that the positions of the reference points 307a to 307c in the reference image <NUM> and the target image <NUM> match with each other. In this embodiment, the alignment unit <NUM> calculates a transformation X of the picture region <NUM> from the reference image <NUM> to the target image <NUM> according to equation (<NUM>): <MAT> where <MAT> <MAT> <MAT>.

In equation (<NUM>), X is an affine transformation and represents a displacement amount obtained by combining translation, rotation, scaling, and shearing from the reference image <NUM> to the target image <NUM>. The transformation X can be calculated by multiplying the inverse matrix of A from the right side of B in equation (<NUM>).

After that, the alignment unit <NUM> generates a transformed image <NUM> by applying the calculated transformation X to each pixel constituting the print medium region <NUM> in the reference image <NUM>. As shown in <FIG>, the picture in the picture region <NUM> of the generated transformed image <NUM> is aligned with the target image <NUM>. That is, the positions of the reference points 307a to 307c in the transformed image <NUM> and the target image <NUM> match with each other. In this manner, the alignment unit <NUM> can align the reference image <NUM> and the target image <NUM>.

In step S1060, the inspection processing unit <NUM> performs for the peripheral region <NUM> inspection processing selected by the processing selection unit <NUM> in step S1040. As described above, in this embodiment, the inspection processing unit <NUM> performs defect determination processing based on a comparison between the target image <NUM> and feature information for the peripheral region <NUM>. More specifically, the inspection processing unit <NUM> can detect a defect in the peripheral region <NUM> of the inspection target medium by comparing image information at each position of the peripheral region <NUM> of the target image <NUM> with feature information having a predetermined value.

The image information at each position of the peripheral region <NUM> of the target image <NUM> may be the brightness of each pixel. The feature information (to be referred to as a feature value hereinafter) having a predetermined value may be feature information about the peripheral region <NUM>. The feature information may be, for example, the representative brightness of pixels belonging to the peripheral region <NUM>. The representative brightness is a brightness representing the peripheral region <NUM>. For example, when a print medium is white paper, the representative brightness may be the typical brightness of white paper read by the image obtaining unit <NUM>.

In this embodiment, the inspection processing unit <NUM> uses, as the feature value, feature information about the peripheral region <NUM> of the reference image <NUM> obtained by the image obtaining unit <NUM>. In this embodiment, the inspection processing unit <NUM> uses, as the feature value, the average brightness of the peripheral region <NUM> detected from the reference image <NUM> in step S1030. Then, the inspection processing unit <NUM> calculates a difference between the pixel value and the feature value for each pixel of the peripheral region <NUM> of the target image <NUM>. The inspection processing unit <NUM> can determine that a pixel having a calculated difference larger than a threshold is a defective pixel.

Note that the inspection processing unit <NUM> may use a preset value as the feature value instead of the representative brightness of the peripheral region <NUM> detected from the reference image <NUM>. For example, the feature value can be set in advance in accordance with the type of print medium. This setting can omit the processing of detecting the peripheral region <NUM> of the reference image <NUM> by the region determination unit <NUM>. Even when a print position error occurs, a printed product can be inspected properly.

In step S1070, the inspection processing unit <NUM> performs for the picture region <NUM> inspection processing selected by the processing selection unit <NUM> in step S1040. As described above, in this embodiment, the inspection processing unit <NUM> performs defect determination processing based on a comparison between the reference image <NUM> and the target image <NUM> for the picture region <NUM>. More specifically, the inspection processing unit <NUM> detects a defect in the picture region <NUM> of the inspection target medium by comparing the target image <NUM> and reference image <NUM> aligned based on objects in the images. As described above, the alignment unit <NUM> generates the transformed image <NUM> by alignment processing of the reference image <NUM> to the target image <NUM> in step S1050. The inspection processing unit <NUM> calculates a difference between the target image <NUM> and the transformed image <NUM> for each pixel of the picture region <NUM> in the target image <NUM>. The inspection processing unit <NUM> can determine that a pixel having a calculated difference larger than a threshold is a defective pixel.

When the inspection processing unit <NUM> detects a defective pixel in step S1060 or S1070, the inspection target medium is determined to be rejected. At this time, the CPU <NUM> of the image processing apparatus <NUM> controls to convey the inspection target medium to the output tray <NUM>. When the inspection processing unit <NUM> detects no defective pixel, the inspection target medium is determined to be accepted. At this time, the CPU <NUM> of the image processing apparatus <NUM> controls to convey the inspection target medium to the output tray <NUM>.

In step S1080, the inspection processing unit <NUM> determines whether to convey the next inspection target medium to the image processing apparatus <NUM>. If the printing apparatus <NUM> further prints on a print medium and the inspection target medium is conveyed to the image processing apparatus <NUM>, the process returns to step S1020 to continue the processing in <FIG>. If printing and inspection end, the processing in <FIG> ends.

In the above-described example, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> by transforming the reference image <NUM> using the transformation X in step S1050. Alternatively, the alignment unit <NUM> may align the target image <NUM> with respect to the reference image <NUM> by transforming the target image <NUM>. For example, a transformed image can be generated by transforming the target image <NUM> using a different transformation Y. The transformation Y can be given by equation (<NUM>): <MAT> In equation (<NUM>), the matrices A and B are the same as those in equation (<NUM>). In the transformed image, a picture in the picture region <NUM> is aligned with the reference image <NUM>. In this case, the inspection processing unit <NUM> can calculate a difference between the reference image <NUM> and the transformed image in step S1070.

According to the first embodiment, inspection processing corresponding to a region is performed for each of the picture region and the peripheral region on an inspection target medium. With this arrangement, even when a print position error occurs, a defect at the periphery of a medium can be detected more accurately.

In the first embodiment, defect determination processing based on a comparison between the reference image <NUM> and the target image <NUM> is used for the picture region <NUM>, and defect determination processing based on a comparison between the target image <NUM> and feature information is used for the peripheral region <NUM>. However, a combination of the inspection setting used for defect determination of the picture region <NUM> and the inspection setting used for defect determination of the peripheral region <NUM> is not limited to this. For example, the processing selection unit <NUM> may select defect determination processing based on a comparison between the reference image <NUM> and the target image <NUM> even for the peripheral region <NUM>. In this case, the processing selection unit <NUM> can set, as the threshold used for defect determination by the inspection processing unit <NUM>, values different between inspection of the picture region <NUM> and that of the peripheral region <NUM>. For example, the inspection processing unit <NUM> can detect a defect in the picture region <NUM> of an inspection target medium by comparing with the first threshold a difference between the transformed image <NUM> and the target image <NUM> in the picture region <NUM>. In contrast, the inspection processing unit <NUM> can detect a defect in the peripheral region <NUM> of the inspection target medium by comparing, with the second threshold different from the first threshold, a difference between the transformed image <NUM> and the target image <NUM> in the peripheral region <NUM>. Even with this arrangement, an inspection can be performed at inspection settings different between the picture region <NUM> and the peripheral region <NUM>.

The processing selection unit <NUM> detects a defect in the picture region <NUM> of an inspection target medium, whereas it can omit detection of a defect in the peripheral region <NUM> of the inspection target medium. For example, the inspection method may be set not to perform defect determination for the peripheral region <NUM> based on an input from the user or a setting. Even with this arrangement, an inspection can be performed at inspection settings different between the picture region <NUM> and the peripheral region <NUM>. Further, the processing selection unit <NUM> may set the inspection method so as to perform defect determination using the same method between the picture region <NUM> and the peripheral region <NUM> based on an input from the user or a setting.

In the second embodiment, similar to the first embodiment, the presence/absence of a defect on an inspection target medium is inspected using inspection processing corresponding to each of the picture region and the peripheral region. In the second embodiment, in particular, a defect is determined based on a comparison between a reference image and a target image also for the peripheral region of an inspection target medium. In the second embodiment, alignment processing corresponding to each of the picture region and the peripheral region is performed to determine a defect at inspection settings different between the picture region and the peripheral region. The functional arrangement of an image processing apparatus <NUM> according to the second embodiment is similar to that of the image processing apparatus <NUM> according to the first embodiment shown in <FIG>, and a difference from the first embodiment will be described below.

A processing selection unit <NUM> selects inspection settings for a picture region <NUM> and a peripheral region <NUM>. In the second embodiment, the processing selection unit <NUM> selects the details of alignment processing for inspection of the picture region <NUM>, and those of alignment processing for inspection of the peripheral region <NUM>.

An alignment unit <NUM> aligns a reference image <NUM> and a target image <NUM> by the first method for inspection of the picture region <NUM>. In the second embodiment, similar to the first embodiment, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the picture region <NUM> for inspection of the picture region <NUM>. An inspection processing unit <NUM> compares the aligned reference image <NUM> and the target image <NUM>, detecting a defect in the picture region <NUM> of the inspection target medium. The alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> by the second method for inspection of the peripheral region <NUM>. In the second embodiment, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the periphery positions of the inspection target medium and reference medium for inspection of the peripheral region <NUM>. The inspection processing unit <NUM> compares the aligned reference image <NUM> and the target image <NUM>, detecting a defect in the peripheral region <NUM> of the inspection target medium. Details of this processing will be described below.

Processing performed by the image processing apparatus <NUM> according to the second embodiment will be described with reference to the flowchart of <FIG>. Processes in steps S1010 to S1030 are similar to those in the first embodiment. In step S <NUM>, the processing selection unit <NUM> selects the details of alignment processing for the picture region <NUM> and those of alignment processing for the peripheral region <NUM> that are performed in step S1050, as described above. In the second embodiment, similar to the first embodiment, alignment processing using affine transformation based on reference points 307a to 307c is selected for the picture region <NUM>. For the peripheral region <NUM>, alignment processing using affine transformation based on the positions of four vertices of a print medium is selected.

The reference image <NUM> and the target image <NUM> are aligned based on the picture region <NUM> in step S1050 similarly to the first embodiment. That is, the alignment unit <NUM> can calculate the transformation X based on the reference points 307a to 307c for the reference image <NUM>, and generate a transformed image <NUM> by applying the transformation X to the reference image <NUM>. In step S1050, the alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the peripheral region <NUM>.

<FIG> are views for explaining an outline of alignment processing based on the peripheral region <NUM>. <FIG> show the relationship between the reference image <NUM>, the target image <NUM>, the picture region <NUM>, the peripheral region <NUM>, and vertices 308a to 308d of a print medium region <NUM>. The alignment unit <NUM> aligns the reference image <NUM> and the target image <NUM> based on the coordinates of the vertices 308a to 308d of the respective print medium regions <NUM> in the reference image <NUM> and the target image <NUM> that have been detected in step S1030. For example, when geometric transformation is applied to the reference image <NUM>, the alignment unit <NUM> can calculate a geometric transformation for alignment so that the positions of the vertices 308a to 308d in the reference image <NUM> and the target image <NUM> match with each other. In this embodiment, the alignment unit <NUM> can calculate a transformation X' of the peripheral region <NUM> from the reference image <NUM> to the target image <NUM> according to equation (<NUM>): <MAT> where <MAT> <MAT> <MAT> Since A' and B' in equation (<NUM>) are not square matrices, the alignment unit <NUM> calculates a Moore-Penrose pseudo-inverse matrix with respect to the matrix A' and can calculate X'.

The alignment unit <NUM> generates a periphery transformed image <NUM> by applying the calculated transformation X' to each pixel in the print medium region <NUM> of the reference image <NUM>. <FIG> shows a state in which the target image <NUM> is aligned by alignment processing with the periphery transformed image <NUM> obtained by transforming the reference image <NUM> using the transformation X'. At this stage, the positions of the vertices 308a to 308d of the print medium regions <NUM> and the positions of the peripheral regions <NUM> in the periphery transformed image <NUM> and the target image <NUM> match with each other. To the contrary, the positions of the picture regions <NUM> in the periphery transformed image <NUM> and the target image <NUM> may not match with each other.

Finally, the alignment unit <NUM> generates an overall transformed image <NUM> by compositing the periphery transformed image <NUM> and the transformed image <NUM>. <FIG> are views for explaining the overall transformed image <NUM>. The alignment unit <NUM> generates the overall transformed image <NUM> by combining an image corresponding to the picture region <NUM> of the target image <NUM> out of the transformed image <NUM> and an image corresponding to the position of the peripheral region <NUM> of the target image <NUM> out of the periphery transformed image <NUM>. Since the picture region <NUM> and peripheral region <NUM> of the target image <NUM> do not overlap each other, the alignment unit <NUM> can generate the unique overall transformed image <NUM>. The generated overall transformed image <NUM> corresponds to the result of aligning the overall reference image <NUM> with the target image <NUM>.

In this embodiment, processes in steps S1060 and S1070 can be performed simultaneously. That is, the inspection processing unit <NUM> can calculate a difference between the target image <NUM> and the overall transformed image <NUM> for each pixel of the target image <NUM>. The inspection processing unit <NUM> can determine that a pixel having a calculated difference larger than a threshold is a defective pixel. Processing in step S1080 is similar to that in the first embodiment. In this fashion, the processing according to the second embodiment can be performed.

Note that it is not essential to generate the overall transformed image <NUM> in step S1050. For example, a defect may be detected using different transformed images for the picture region <NUM> and the peripheral region <NUM>. In this case, in step S1060, the inspection processing unit <NUM> can calculate a difference between the periphery transformed image <NUM> and the target image <NUM> for each pixel in the peripheral region <NUM>, and compare the difference with a threshold. In step S1070, the inspection processing unit <NUM> can calculate a difference between the transformed image <NUM> and the target image <NUM> for each pixel in the picture region <NUM>, and compare the difference with a threshold.

According to the second embodiment, inspection processing using different alignment processing corresponding to a region is performed for each of the picture region and the peripheral region on an inspection target medium. With this arrangement, even when a print position error occurs, a defect at the periphery of a medium can be detected more accurately. Especially in the second embodiment, image comparison is performed even in the peripheral region, and a defect near the periphery of a medium can be detected more accurately.

In the first and second embodiments, a defect in a target image is detected by comparing the target image with a reference image in at least the picture region. Even in a conventional technique, a defect in a target image is detected by comparing the target image with a reference image. In the first embodiment, a reference image is obtained by reading a reference medium. In the third embodiment, a reference image is generated based on the reading results of reference media. For example, in the third embodiment, a reference image can be generated based on read images obtained by reading respective reference media. This arrangement increases the S/N ratio of the reference image, and high accuracy of defect inspection is expected.

If a print position error occurs on each of reference media, read images need to be aligned before compositing them. If alignment is performed to make pictures match with each other even in this case, similar to the first and second embodiments, a mismatch at the peripheries of the media increases, and an improper reference image may be generated. Therefore, in the third embodiment, a picture region and a peripheral region on a reference medium are determined, and a plurality of read images are composited into a reference image by compositing processing corresponding to each region. The thus-generated reference image can be used to increase the accuracy of inspection according to the first and second embodiments. The reference image generated according to the third embodiment can also be used in inspection according to the conventional technique.

<FIG> is a block diagram showing the functional arrangement of an image processing apparatus <NUM> according to the third embodiment. The functional arrangement of the image processing apparatus <NUM> according to the third embodiment is similar to that of the image processing apparatus <NUM> according to the first embodiment shown in <FIG>, and a difference from the first embodiment will be explained.

An image obtaining unit <NUM> obtains the first image serving a read image of a reference medium representing a target print result, and the second image different from the first image. In this embodiment, an image obtained by reading a reference medium at the first time by an image reading device <NUM> will be called the first read image, and an image obtained by reading another reference medium at the second or subsequent time will be called the second read image. The image obtaining unit <NUM> is similar to that in the first embodiment except that it obtains the first and second read images instead of a reference image <NUM> and a target image <NUM>. The image obtaining unit <NUM> can obtain a plurality of second read images by reading respective reference images. The second read images can be sequentially composited to the first read image. The first read image or the first read image to which one or more second read images are composited will sometimes be called a processed image.

A region determination unit <NUM>, a processing selection unit <NUM>, and an alignment unit <NUM> are similar to those in the first embodiment except that they process the processed image and the second read image instead of the reference image <NUM> and the target image <NUM>.

A compositing processing unit <NUM> composites the first and second read images. The compositing processing unit <NUM> can generate a reference image that is compared with a read image of an inspection target medium in order to detect a defect on the inspection target medium having undergone printing. The compositing processing unit <NUM> performs compositing processing at compositing settings different between a picture region <NUM> and peripheral region <NUM> of the medium. In this embodiment, the compositing processing unit <NUM> can generate a reference image by repeating compositing processing of the second read image to a processed image. An image obtained by compositing one second read image to a processed image will be called a composite image.

In this embodiment, the compositing processing unit <NUM> generates an image in the picture region <NUM> of a composite image by compositing a processed image and the second read image. The compositing processing unit <NUM> generates an image in the picture region <NUM> of the composite image by compositing the processed image and the second read image in accordance with alignment by the alignment unit <NUM>. In this embodiment, the compositing processing unit <NUM> generates an image in the picture region <NUM> of the composite image by compositing the processed image and second read image aligned based on an object in the image.

The compositing processing unit <NUM> generates information used to inspect the peripheral region <NUM> on an inspection target medium at a compositing setting different from that of the picture region <NUM>. The compositing processing unit <NUM> composites pieces of feature information of images in the peripheral regions <NUM> of media out of the processed image and the second read image. Such feature information can be used to inspect a peripheral region on an inspection target medium (target image <NUM>) in the first embodiment. In the third embodiment, the compositing processing unit <NUM> sets a pixel value in the peripheral region <NUM> of a composite image at a feature value obtained by compositing the feature value of the peripheral region <NUM> of the processed image and that of the peripheral region <NUM> of the second read image. The obtained composite image including the picture region <NUM> in which the aligned processed image and the second read image are composited, and the peripheral region <NUM> having a predetermined pixel value can be used as a reference image in the first and second embodiments.

Processing performed by the image processing apparatus <NUM> having the above-described arrangement according to the embodiment will be described below. <FIG> is a flowchart showing a sequence of processing performed by the image processing apparatus <NUM>. In the processing shown in <FIG>, a plurality of second read images are sequentially composited to the first read image.

In step S1010, the image obtaining unit <NUM> obtains the first read image similarly to the first embodiment except that the first read image is obtained instead of the reference image <NUM>. The obtained first read image is used as a processed image. In step S1020, the image obtaining unit obtains the second read image similarly to the first embodiment except that one of the second read images is obtained instead of the target image <NUM>.

In step S1030, the region determination unit <NUM> detects the picture region <NUM> and the peripheral region <NUM> in the processed image by performing region determination for the processed image similarly to the first embodiment. Similarly, the region determination unit <NUM> detects the picture region <NUM> and the peripheral region <NUM> in the second read image by performing region determination for the second read image. Further, the region determination unit <NUM> calculates a feature value for the peripheral region <NUM> of the second read image. The feature value is used in step S1100. Only in the first loop, the region determination unit <NUM> replaces, with the feature value of the peripheral region <NUM>, the pixel values of all pixels belonging to the peripheral region <NUM> of the first read image (= processed image). As for the feature value, the feature value of the peripheral region <NUM> in this example is the average brightness of pixels belonging to the peripheral region <NUM>, which will be described later.

In step S1040, the processing selection unit <NUM> selects the details of compositing processing to be performed for the picture region <NUM> in step S1100, and those of compositing processing to be performed for the peripheral region <NUM> in step S1110. In this embodiment, compositing processing based on averaging of the processed image and the second read image is selected for the picture region <NUM>, and compositing processing based on the feature value is selected for the peripheral region <NUM>. A detailed processing selection method is similar to that in the first embodiment.

In step S1050, the alignment unit <NUM> aligns the processed image and the second read image. In the third embodiment, similar to the first embodiment, the processed image and the second read image are aligned based on the picture region <NUM>. For example, the alignment unit <NUM> can calculate the transformation X of the picture region <NUM> from the processed image to the second read image based on reference points. Then, similar to the first embodiment, the alignment unit <NUM> generates a transformed image by applying the calculated transformation X to each pixel constituting a print medium region <NUM> in the processed image. As a result, the alignment unit <NUM> can align the processed image and the second read image.

In step S1100, the inspection processing unit <NUM> performs for the peripheral region <NUM> compositing processing selected by the processing selection unit <NUM> in step S1040. As described above, in this embodiment, the compositing processing unit <NUM> performs compositing processing based on the feature value for the peripheral region <NUM>. The feature value in this embodiment is the representative brightness of pixels belonging to the peripheral region <NUM>. The significance of the feature value may be similar to that in the first embodiment. In this example, the average brightness of pixels belonging to the peripheral region <NUM> is used as the feature value.

For example, the compositing processing unit <NUM> performs compositing processing using the feature value for each pixel of the peripheral region <NUM> in the second read image. More specifically, the compositing processing unit <NUM> calculates the average of a feature value (in this example, the average brightness of the peripheral region <NUM>) in the second read image and a feature value in the processed image for each pixel of the peripheral region <NUM>.

As an example of the processing by the compositing processing unit <NUM>, first, the compositing processing unit <NUM> can replace, with the feature value of the peripheral region <NUM>, the pixel values of all pixels belonging to the peripheral region <NUM> of the second read image. In this example, the feature value is the average brightness of all pixels belonging to the peripheral region <NUM> of the second read image. The compositing processing unit <NUM> can calculate an average according to equation (<NUM>): <MAT> where x and y are indices of each pixel in the peripheral region <NUM>, I<NUM>(x, y), I<NUM>(x, y), and I<NUM>(x, y) are pixel values in the processed image, the second read image, and the composite image, respectively, and N is the number of the second read image to be composited. In the case of processing the third, second read image, N = <NUM>.

As described above, the pixel value of the peripheral region <NUM> in the first read image is replaced with the average brightness of the peripheral region <NUM> of the first read image in step S1030. The pixel value of the peripheral region <NUM> in the second read image is also replaced with the average brightness of the peripheral region <NUM> of the second read image in step S1100. Therefore, all pixels (x, y) belonging to the peripheral regions <NUM> of the first and second read images have the same value. As a result, all the pixels of the peripheral region <NUM> have the same value even in a composite image obtained from the first read image (= processed image) and the second read image according to equation (<NUM>). The thus-obtained composite image is used as a processed image in the next processing loop, so all the pixels of the peripheral region <NUM> of the composite image have the same value even in subsequent processing loops. The I<NUM>(x, y) value obtained from equation (<NUM>) is the average value (I<NUM>(x, y)) of the processed image and the average value (I<NUM>(x, y)) of the second read image, which are weighted by the number of composited read images. In other words, the I<NUM>(x, y) value is the average brightness of the peripheral regions <NUM> of the first and second read images processed so far.

In step S1110, the compositing processing unit <NUM> performs for the picture region <NUM> compositing processing selected by the processing selection unit <NUM> in step S1040. As described above, in this embodiment, the compositing processing unit <NUM> performs compositing processing based on averaging of the processed image and the second read image for the picture region <NUM>. For example, the compositing processing unit <NUM> can composite the second read image and a transformed image obtained from the processed image by alignment processing in step S1050 for each pixel of the picture region <NUM> in the second read image. More specifically, the compositing processing unit <NUM> can calculate the pixel value of each pixel (x, y) of the picture region <NUM> of the composite image using equation (<NUM>) described above (in this case, I<NUM>(x, y) is the pixel value of the transformed image). In steps S1100 and S1110, the composite image including the picture region <NUM> and the peripheral region <NUM> is generated.

In step S1120, the compositing processing unit <NUM> determines whether there is a read image of a reference medium which has not been composited yet. When compositing a read image of the next reference medium, the image obtaining unit <NUM> replaces the processed image with the composite image. After that, the process returns to step S1020 to composite the processed image with the second read image of a new reference medium. In steps S1100 and S1110 in the next processing loop, the N value used in equation (<NUM>) is incremented by one.

If the compositing processing unit <NUM> determines in step S1120 that read images of all reference media have been composited, the generated composite image is output to an auxiliary storage device (not shown), and the processing in <FIG> ends. As described above, the output composite image can be used as the reference image <NUM> in the first and second embodiments. By using the composite image generated in this way as the reference image <NUM>, high accuracy of inspection processing in the first and second embodiments is expected.

In the above-described example, the compositing processing unit <NUM> generates a composite image by sequentially calculating an average according to equation (<NUM>) while repeating steps S1020 to S1120. However, the composite image generation method is not limited to this. For example, in step S1020, the image obtaining unit <NUM> can obtain a plurality of second read images as the reading results of a plurality of reference media. In steps S1100 and S1110, the compositing processing unit <NUM> may composite all the first and second read images. For example, the compositing processing unit <NUM> can calculate an average using equation (<NUM>) instead of equation (<NUM>): <MAT> where N is the total number of read images, I<NUM>(x, y) is the pixel value of the first read image, and I<NUM>(x, y) to I2N-<NUM>(x, y) are the pixel values of respective second read images. Even in this case, the pixel value of the peripheral region <NUM> of the composite image is the average of the feature values of the peripheral regions <NUM> in the first and second read images. The pixel value of the picture region <NUM> of the composite image is the average pixel value of each pixel after the first and second read images are aligned based on the picture of the picture region <NUM>.

The compositing processing unit <NUM> may adopt the median of the pixels of the first and second read images as the pixel value of the composite image. In this case, the compositing processing unit <NUM> can calculate the pixel value of the composite image using equation (<NUM>) instead of equation (<NUM>): <MAT> where median is the function of calculating a median.

In this embodiment, the pixel value of the peripheral region <NUM> in a read image is replaced with the average brightness of the peripheral region <NUM>. Then, read images are composited according to equation (<NUM>) or the like, generating a composite image in which the peripheral region <NUM> has a predetermined pixel value. However, the compositing processing unit <NUM> may generate feature information about the peripheral region <NUM> of a reference image by another method. For example, the compositing processing unit <NUM> may calculate the average brightness of the peripheral regions <NUM> of the first and second read images and output it as feature information about the peripheral region <NUM> of the reference image. This feature information can be used as feature information about the peripheral region <NUM> having a predetermined value that is compared with image information at each position of the peripheral region <NUM> of the target image <NUM> in the first embodiment. In this case, the compositing processing unit <NUM> can output a reference image generated by compositing a processed image and second read image aligned based on an object in the picture region <NUM>, and feature information about the peripheral region <NUM> of this reference image. As another example, the compositing processing unit <NUM> may generate a reference image by compositing a processed image and second read image aligned based on an object in the picture region <NUM>, and replacing the pixel value of the peripheral region <NUM> of the obtained image with the feature information.

According to the third embodiment, a reference image is obtained by determining the picture region and peripheral region of a reference medium, and compositing read images of a plurality of reference media using compositing processing corresponding to each region. With this arrangement, even when a print position error occurs, a more proper inspection reference image can be generated.

Also in the fourth embodiment, the picture region and peripheral region of a reference medium are determined, and a plurality of read images are composited into a reference image by compositing processing corresponding to each region. Especially in the fourth embodiment, the compositing processing of a reference image is performed at compositing settings different between the picture region and the peripheral region by performing alignment processing corresponding to each of the picture region and the peripheral region. The functional arrangement of an image processing apparatus <NUM> according to the fourth embodiment is similar to that of the image processing apparatus <NUM> according to the third embodiment shown in <FIG>, and a difference from the third embodiment will be described below.

A processing selection unit <NUM> selects the details of compositing processing for a picture region <NUM> and a peripheral region <NUM>. In the fourth embodiment, similar to the second embodiment, as the details of alignment processing performed for the compositing processing of the picture region <NUM>, the processing selection unit <NUM> selects alignment processing based on reference points in the picture region <NUM>. Also similar to the second embodiment, as the details of alignment processing performed for the compositing processing of the peripheral region <NUM>, the processing selection unit <NUM> selects alignment processing based on the positions of four vertices of a print medium in the peripheral region <NUM>. The details of alignment processing performed by an alignment unit <NUM> are similar to those in the second embodiment.

Even in the fourth embodiment, a compositing processing unit <NUM> generates a composite image. Similar to the third embodiment, the picture region <NUM> of the composite image is a composite image of a processed image and second read image aligned based on an object in the image. The peripheral region <NUM> of the composite image is a composite image of a processed image and second read image aligned based on the periphery position of the medium. The thus-obtained composite image can also be used as a reference image in the first and second embodiments.

Processing performed by the image processing apparatus <NUM> having the above-described arrangement according to the embodiment will be described with reference to the flowchart of <FIG>. Processes in steps S1010 to S1030 are similar to those in the third embodiment. Processing in step S1040 is also similar to that in the third embodiment except that the processing selection unit <NUM> selects the details of compositing processing in the above-described manner.

In step S1050, the alignment unit <NUM> performs processing as in the second embodiment except that a processed image and the second read image are aligned. By processing in step S1050, the transformation X' of the peripheral region <NUM> from the processed image to the second read image, and the transformation X of the picture region <NUM> from the processed image to the second read image are obtained. An overall transformed image obtained by the processing in step S1050 has, in a region corresponding to the position of the peripheral region <NUM> of the second read image, a peripheral transformed image obtained by transforming the processed image using the transformation X'. Further, the overall transformed image has, in a region corresponding to the position of the picture region <NUM> of the second read image, a transformed image obtained by transforming the processed image using the transformation X.

In step S1100, the compositing processing unit <NUM> generates a composite image by compositing the overall transformed image obtained in step S1050 and the second read image. In this embodiment, the compositing processing unit <NUM> can perform calculation according to equation (<NUM>) for each pixel of the print medium region <NUM> (that is, both the picture region <NUM> and the peripheral region <NUM>) of the second read image. In this case, I<NUM>(x, y) represents the pixel value of the overall transformed image. In this fashion, a composite image having the pixel value I<NUM>(x, y) calculated according to equation (<NUM>) can be generated. Processing in step S1120 is similar to that in the third embodiment.

According to the fourth embodiment, even when a print position error occurs, a more proper inspection reference image can be generated. Particularly in the fourth embodiment, image compositing processing is performed even in the peripheral region, and a defect near the periphery of a medium can be detected more accurately.

In the second embodiment, alignment processing based on the positions of four vertices of a print medium in the peripheral region <NUM> is performed as an alignment method when performing inspection of the peripheral region <NUM>. In the fifth embodiment, when comparing the pixel values of a target image and a reference image, pixels in a predetermined search range are compared as shown in <FIG>, details of which will be described later. The inspection of a peripheral region <NUM> can therefore be performed using images in inspection ranges cut out from the reference image and the target image to have a region of a predetermined number of pixels around a print medium region <NUM>.

This arrangement can increase the defect detection accuracy when a wrinkle or a distortion exists at the periphery of a print medium. For example, as shown in the enlarged view of <FIG>, a reference image <NUM> obtained by compositing read images of a plurality of reference media may have a dark portion generated by compositing paper white and a black background at the periphery of the image. In addition, the black background portion may be captured at a periphery corresponding to the paper white portion of the print medium region <NUM> in a target image <NUM>. According to the embodiment, when a black region or a dark region is generated in the peripheral region of the reference image or the target image, detection of the region as a defect can be suppressed.

First, a method of generating a reference image by compositing read images of a plurality of reference media in this embodiment will be explained. According to the following method, a reference image can be generated to include a background region at the periphery. However, it is not essential to use the reference image generated as follows for inspection of an inspection target medium.

Processing in the fifth embodiment is different from that in the fourth embodiment in processing of compositing the peripheral regions of a plurality of reference images. This processing in the fifth embodiment will be described below with reference to the flowchart of <FIG>. The following processing can be used in combination with processes such as alignment and compositing processing of a picture region in the fourth embodiment. That is, a composite image can be generated by performing compositing processing of a picture region <NUM> according to steps S1030 to S1110 in <FIG> while compositing the peripheral region <NUM> and a margin region according to steps S1180 to S1210 in <FIG>.

In step S1170, an image obtaining unit <NUM> obtains the second read image as in step S1020 of the fourth embodiment. In step S1180, a region determination unit <NUM> extracts a margin region in addition to the peripheral region <NUM>. The margin region is a region of a predetermined pixel width provided on upper, lower, right, and left sides around the peripheral region <NUM> (or print medium region <NUM>). Although the pixel width is not particularly limited, the predetermined pixel width is set to <NUM> pixels in the following description. Similar to the above-described peripheral margin, a predetermined pixel width may be set based on a margin amount or print position error amount generated when a printing apparatus <NUM> prints. For example, the margin region can be extracted to include the black region of the background. If an error of the print position of the printing apparatus with respect to the print medium is about <NUM> pixels, the width of the margin region can be set to about <NUM> pixels. A mechanism for setting a predetermined pixel width by the user may be provided separately.

In step S1190, an alignment unit <NUM> aligns a processed image and the second read image based on the peripheral region <NUM> as in step S1050 of the fourth embodiment. That is, the alignment unit <NUM> can perform alignment processing based on the positions of four vertices of a print medium in the peripheral region <NUM>. Similar to the fourth embodiment, the alignment unit <NUM> can transform the processed image so as to align the processed image with the second read image.

In step S1200, the alignment unit <NUM> obtains regions corresponding to the peripheral region <NUM> and the margin region from the transformed processed image obtained in step S1190. The obtained image includes black pixels corresponding to the background region around the print medium region <NUM>, like a reference image <NUM> in <FIG>.

In step S1210, the compositing processing unit <NUM> composites the second read image and the transformed processed image obtained in step S1190 in the peripheral region <NUM> and the margin region. In this way, the compositing processing unit <NUM> can generate the peripheral region <NUM> and margin region of the composite image serving as a composite image of the processed image and second read image aligned based on the periphery position of the medium. The compositing processing unit <NUM> can generate a composite image by sequentially calculating an average according to equation (<NUM>) as in the fourth embodiment for both the peripheral region <NUM> and the margin region. In the fifth embodiment, the compositing processing unit <NUM> may calculate a difference in pixel value between images and if the difference exceeds a predetermined threshold, employ the pixel value of an image having a smaller pixel value without averaging, in order to hold the contrast between the margin region and paper white at the periphery of the image. Instead of calculating a difference in pixel value, the compositing processing unit <NUM> may adopt another method of, for example, when the pixel value of the second read image is smaller than a predetermined threshold, replacing it with a predetermined pixel value representing a black region.

As described above, similar to the fourth embodiment, the compositing processing unit <NUM> can generate the picture region <NUM> and margin region of the composite image serving as a composite image of the processed image and second read image aligned based on the picture region <NUM>. Accordingly, the composite image including the picture region <NUM>, the peripheral region <NUM>, and the margin region can be generated.

Processing in step S1220 is similar to that in the fourth embodiment. After the end of compositing read images of all reference media, the generated composite image is output to an auxiliary storage device (not shown), and the processing ends. By this processing, a reference image in which read images of reference media including the background region at the periphery is obtained.

Next, processing in the fifth embodiment in which an inspection target medium is inspected by comparing a target image and a reference image including the background region at the periphery will be explained with reference to the flowchart of <FIG>. In step S1230, the image obtaining unit <NUM> obtains a reference image including the background region at the periphery. The reference image may be a composite image generated according to the above-described method by compositing read images of a plurality of reference media. In step S1240, the image obtaining unit <NUM> obtains a target image as in step S1020 of the second embodiment.

In step S1250, an inspection processing unit <NUM> extracts the picture region <NUM>, the peripheral region <NUM>, and the margin region from the target image. The method of extracting the picture region <NUM> and the peripheral region <NUM> is similar to that in the second embodiment. The method of extracting the margin region has been described above. The inspection processing unit <NUM> can generate an image in which the margin region is provided around the periphery of the print medium region <NUM>.

In step S1260, similar to the second embodiment, the inspection processing unit <NUM> aligns the reference image obtained in step S1230 and the processed image obtained in step S1250. For example, the inspection processing unit <NUM> can transform the reference image into an overall transformed image by performing alignment for the picture region <NUM> and alignment for the peripheral region <NUM>. As for the margin region as well as the peripheral region <NUM>, the inspection processing unit <NUM> can perform alignment based on the positions of four vertices of the print medium.

In step S1270, the inspection processing unit <NUM> decides a search range used to compare the pixel values of the reference image and the target image. In this embodiment, the margin region around the print medium region <NUM> is also extracted, and a detection error in the peripheral region can be suppressed by comparing pixel values in a predetermined range. The size of the search range is not particularly limited and can be <NUM> pixels, which is equal to the width of the margin region in the following description. Alternatively, similar to the width of the margin region, the size of the search range may be determined based on a margin amount or a print position error amount when the printing apparatus <NUM> prints.

In step S1280, the inspection processing unit <NUM> calculates the difference value of each value between the target image and the reference image in the peripheral region <NUM>. As shown in <FIG>, the inspection processing unit <NUM> can calculate a difference value between the pixel value of a pixel of interest of a reference image <NUM> and the pixel value of each pixel of the reference image <NUM> in the search range that corresponds to the pixel of interest. The search range may be a region whose vertical and horizontal distances from a pixel corresponding to the pixel of interest in the reference image are equal to or shorter than the number of pixels decided in step S1270. In this embodiment, the inspection processing unit <NUM> can calculate a difference value for each pixel by scanning the reference image in the vertical and horizontal directions by the number of pixels corresponding to the search range, and employ a minimum difference value as a difference used for defect determination.

In step S1290, the inspection processing unit <NUM> determines whether the calculation of a difference value has ended for all the pixels of the target image. If the calculation has not ended, the process returns to step S1280 to calculate a difference value for another pixel. If the calculation has ended, the inspection processing unit <NUM> determines based on the difference value whether the pixel of the peripheral region <NUM> of the target image is a defective pixel, similarly to the second embodiment. Then, the inspection processing ends.

In the fifth embodiment, an inspection image having a margin region around a print medium region is used. When comparing the pixel values of peripheral regions, a minimum value among the difference values of pixels in a predetermined range is adopted as a difference value used for defect determination. For example, even when the pixel of interest of a target image represents paper white and a corresponding pixel of a reference image represents the background, if a pixel of the same color (pixel representing paper white) as that of the pixel of interest exists near the corresponding pixel of the reference image, the pixel is not determined as a defect. Even when the pixel of interest of a target image represents the background and a corresponding pixel of a reference image represents paper white, if a pixel of the same color (pixel representing the background) as that of the pixel of interest exists near the corresponding pixel of the reference image, the pixel is not determined as a defect. With this arrangement, a defect near the periphery of a medium can be detected more accurately while suppressing a detection error.

In the above-described embodiments, inspection and alignment are performed for each of the picture region and the peripheral region. However, inspection or alignment may be performed at an inspection setting or alignment setting for three or more regions. In the sixth embodiment, a method will be described in which a preprint region is newly added to inspection target regions and an image on a print medium is divided into three regions and processed. The preprint region is the region of an image printed in advance on a print medium before actual printing by a printing apparatus. Note that the preprint region may exist at the center of the print medium.

Alignment processing and inspection processing for the preprint region in the sixth embodiment, which is a difference from the second embodiment, will be explained below with reference to the flowchart of <FIG>. Alignment processing and inspection processing for the picture region and the peripheral region in the sixth embodiment are similar to those in the second embodiment, and a description thereof will not be repeated.

In step S1300, as in step S1010 of the second embodiment, an image obtaining unit <NUM> obtains a reference image serving as a read image of a reference medium representing a target print result. In step S1310, as in step S1020 of the second embodiment, the image obtaining unit <NUM> obtains a target image serving as a read image of an inspection target medium having undergone printing.

In step S1320, a region determination unit <NUM> performs region determination on the target image. In this embodiment, the region determination unit <NUM> extracts a picture region, a peripheral region, and a preprint region from the target image. The region determination unit <NUM> can extract the picture region, the peripheral region, and the preprint region by referring to a region map image. The region map image is used to discriminate a preprint region and can be created in advance by the user. The region map image is an image having the same vertical and horizontal widths as those of a processed image, and a different pixel value is stored for each region. For example, the pixel of the picture region may have a pixel value (R, G, B) = (<NUM>, <NUM>, <NUM>), that of the peripheral region may have a pixel value (R, G, B) = (<NUM>, <NUM>, <NUM>), and the preprint region may have a pixel value (R, G, B) = (<NUM>, <NUM>, <NUM>). Needless to say, the pixel value of the pixel of each region is not limited to this value. In this case, the region determination unit <NUM> may extract a print medium region from the target image similarly to the second embodiment, and extract the picture region, the peripheral region, and the preprint region from the print medium region based on the region map image. Instead of using the region map image, the region determination unit <NUM> may perform region determination based on feature information of an image similarly to the second embodiment.

In step S1330, a processing selection unit <NUM> selects an inspection setting for each region. In this embodiment, inspection is performed at the inspection setting of the preprint region printed in advance on an inspection target medium and those of the print region and peripheral region of the inspection target medium. For example, similar to the second embodiment, the processing selection unit <NUM> can select alignment based on the picture region (that is, an object in the image) for the picture region, and alignment based on the periphery position of the medium for the peripheral region. As for the preprint region, the processing selection unit <NUM> can select alignment based on the periphery position of the medium.

In step S1340, similar to the second embodiment, an alignment unit <NUM> performs alignment processing at the inspection setting for the peripheral region. In step S1350, similar to the second embodiment, the alignment unit <NUM> performs alignment at the inspection setting for the picture region.

In step S1360, the alignment unit <NUM> performs alignment at the inspection setting for the preprint region. In this embodiment, alignment based on the periphery position of the reference medium is performed even for the preprint region as in step S1350. When an error of the preprint position on a reference medium is smaller than an error of alignment based on the feature point of a preprint picture, the alignment accuracy can be increased using the above-mentioned setting. When an error of the preprint position on a reference medium is larger than an error of alignment based on the feature point of a preprint picture, alignment based on the preprint region may be employed.

In step S1370, as in step S1050 of the second embodiment, the alignment unit <NUM> generates an overall transformed image by combining the results of alignment processing on the picture region, peripheral region, and preprint region of a reference image <NUM>.

In step S1380, as in steps S1060 and S1070 of the second embodiment, an inspection processing unit <NUM> inspects a defect on the inspection target medium by comparing the target image and the overall transformed image. In this embodiment, defect detection in the preprint region uses the reference image aligned based on the periphery position of the medium.

In step S1390, the inspection processing unit <NUM> determines whether the inspection has ended for all target images. If the inspection has not ended, the process returns to step S1310. If the inspection has ended, the inspection processing ends.

According to the sixth embodiment, inspection can be performed even for the preprint region at the inspection setting of the preprint region. For example, a defect in the preprint region can be detected accurately using a reference image aligned based on the periphery position of a medium in inspection processing for the preprint region. The inspection accuracy can be increased not only by using inspection settings different between the picture region and the peripheral region, but also by using inspection settings different between the first region (picture region) of an image and the second region (preprint region) of the image. An inspection setting different from those of the picture region and the peripheral region may be used for the preprint region.

By using a similar method, a read image of a reference medium can also be composited at the compositing settings of the picture region, the peripheral region, and the preprint region. For example, a composite image used for inspection can be generated by performing compositing processing according to the fourth embodiment for the picture region and the peripheral region, and performing alignment and then compositing processing in the above-described way for the preprint region. For example, compositing processing based on averaging may be selected for the preprint region as well as the picture region.

The arrangements of the image obtaining unit <NUM> and the image reading device <NUM> are not particularly limited. For example, the type of image obtained by the image obtaining unit <NUM> is not limited, and the image may be an RGB color image, a grayscale image, or a monochrome image.

Although the image reading device <NUM> reads a reference medium first and then reads an inspection target medium in the first and second embodiments, the generation order of a reference image and a target image by the image reading device is not particularly limited. In each embodiment, the image obtaining unit <NUM> may obtain a reference image, a target image, or a read image from an auxiliary storage device (not shown). The reference image and the target image may be arbitrary images that allow calculating a difference between the reference image and the target image for inspection of the target image. The read image may be an arbitrary image that allows creating a reference image for inspection of the target image.

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 computerreadable 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).

Claim 1:
An image processing apparatus comprising:
an obtaining means (<NUM>) for obtaining a first image serving as a read image of an inspection target medium having undergone printing, and a second image serving as a read image of a reference medium representing a target print result; and
an inspection means (<NUM>) for inspecting a defect on the inspection target medium based on the first image and the second image by performing inspection at inspection settings different between a print region (<NUM>) and a peripheral region (<NUM>) of the inspection target medium,
characterized in that
the inspection means (<NUM>) is further for detecting a defect in the print region of the inspection target medium by comparing the first image and the second image aligned by a first method, and detecting a defect in the peripheral region of the inspection target medium by comparing the first image and the second image aligned by a second method different from the first method, wherein
the inspection means (<NUM>) is further for detecting a defect in the peripheral region of the inspection target medium by comparing the first image and the second image aligned based on vertices (308a - 308d) of the inspection target medium and the reference medium, and
the inspection means (<NUM>) is further for detecting a defect in the print region of the inspection target medium by comparing the first image and the second image aligned based on an object in the first and second image.