A non-transitory computer-readable recording medium storing computer-readable instructions for an image reading apparatus including:
- a platen configured to support an original;
- a reading device configured to optically read the original supported on the platen to obtain a plurality of line images for an entire image including an original image representing the original, wherein each of the plurality of line images extends in a crossing direction crossing an extending direction;
- and a processor, wherein the computer-readable instructions, when executed by the processor, cause the image reading apparatus to perform:
- controlling the reading device to start reading;
- controlling the reading device to read at least one line image;
- specifying a leading edge of the original image from the at least one line image, wherein the leading edge is in a first line image;
- before completing reading the entire image, determining whether a document image to be obtained represents a book document spread open on the platen, the book document being a bound document having a bound portion, wherein the processor determines that the document image to be obtained represents the book document spread open on the platen in a case where the leading edge represents a broken line broken at a center portion thereof;
- in a case where it is determined that the document image to be obtained represents the book document, determining whether a value satisfies a prescribed condition indicating that a content region is included in a bound-portion region in the document image, the content region being a region in the document image representing a content of the book document and the bound-portion region being a region in the document image representing the bound portion, the value being based on a difference between a first density distribution of an image in a first partial region of the entire image and a second density distribution of an image in a second partial region of the entire image, the first partial region including a part of a dark region, the dark region extending in the extending direction and an image in the dark region having a density larger than a prescribed density threshold value, the first partial region extending in the crossing direction crossing the extending direction, the second partial region including another part of the dark region and extending in the crossing direction, the second partial region being shifted from the first partial region with respect to the extending direction;
- wherein the computer-readable instructions, when executed by the processor, cause the image reading apparatus to further perform:
- controlling the reading device to read N number of line images, N being an integer larger than two, wherein the N number of line images include a second line image obtained after the first line image is read;
- specifying at least two density distributions of respective ones of at least two of the N number of line images;
- specifying, for a pair of line images among the at least two of the N-number of line images, a maximum difference in density at a same position in the crossing direction between the density distributions corresponding to the pair of line images, the maximum difference being larger than a prescribed difference threshold;
- specifying a position in the crossing direction at which the maximum difference is specified, as a significant-difference position included in the content region;
- and
- specifying a first range of the dark region in the first line image, the first range having a first width;
- specifying a second range of the dark region in the second line image, the second range having a second width;
- determining whether the significant-difference position is included in a part of the dark region in one of the pair of line images;
- and
- determining whether the significant-difference position is included in a reference range in a reference line image to be obtained, the reference range being extrapolated by using an index value of the first width, an index value of the second width, a distance between the first line image and the second line image, and a distance between the first line image and the reference line image;
- wherein in a case where it is determined that the significant-difference position is included in a part of the dark region in one of the pair of line images, the processor determines that the value satisfies the prescribed condition,
- in a case where the value satisfies the prescribed condition, controlling the reading device to interrupt reading the entire image;
- and
- in a case where the value does not satisfy the prescribed condition:
- controlling the reading device to continue reading the entire image so that all of the plurality of line images is read;
- and
- generating read data using the plurality of line images.