# Patent

## Title
Image processing method and computer-readable storage medium

## Abstract

In a control method for a processing apparatus connected to an image reading apparatus, in a case where the processing apparatus receives a cancellation instruction while the image reading apparatus performs a reading step, the processing apparatus causes the image reading apparatus to terminate the reading step and deletes image data of a page being read, and in a case where the processing apparatus receives a cancellation instruction after the image reading apparatus has performed the reading step, the processing apparatus performs controlling processing for deleting image data that has been acquired in the last reading step and has yet to be stored.

## Background
CROSS-REFERENCE TO RELATED APPLICATIONS
This application is a continuation of U.S. patent application Ser. No. 14/017,539, filed Sep. 4, 2013, which is a continuation of U.S. patent application Ser. No. 13/617,170, filed Sep. 14, 2012, now U.S. Pat. No. 8,547,605, which is a continuation of U.S. patent application Ser. No. 12/431,487, filed Apr. 28, 2009, now U.S. Pat. No. 8,289,583, which claims the benefit of Japanese Application No. 2008-118822, filed Apr. 30, 2008, all of which are hereby incorporated by reference herein in their entirety.


BACKGROUND OF THE INVENTION
Field of the Invention
The present invention relates to a technique for controlling an image reading apparatus for sequentially reading images of documents placed on a document plate.
Description of the Related Art
As a device for digitalizing data of an image displayed on a paper medium and inputting the digitalized data into a PC or the like, an image input device such as an imaging scanner or a multifunction device is used. If an image is read, a user sets a document on an image reading apparatus and presses a reading start instruction button provided with the image reading apparatus so as to start reading of the image.
Such a reading start instruction button and a reading termination instruction button are provided with image reading apparatuses so as to prevent a user who is using the image reading apparatus connected to a network from being interrupted from another user.
However, if the above-described image reading procedure is performed for a plurality of documents and a plurality of read images are stored as one file, it is impossible to transmit file storage start information, file storage continuation information, file storage termination information, etc. to an application and prevent file storage being interrupted by another job.
If a user misplaces a document or places a page different from a desired page on a document plate of an image reading apparatus and discards/cancels a read image, the user is required to move from the image reading apparatus to a personal computer so as to retrieve the read image and discard the retrieved image in the personal computer. This is a cumbersome and inefficient operation.
SUMMARY OF THE INVENTION
The present invention provides an image reading system allowing a user to perform image reading and image reading cancellation a plurality of times and store read images as one file without being interrupted only by exclusively operating an image reading apparatus.
According to an embodiment of the present invention, there is provided a control method for an image reading system provided with an image reading apparatus and a processing apparatus for receiving image data from the image reading apparatus and storing the received image data as a file. The control method includes: causing the image reading apparatus to perform a reading step of reading image data of one page under control of the processing apparatus and transmitting the read image data to the processing apparatus; causing the image reading apparatus to perform a start instructing step of transmitting to the processing apparatus a start instruction for starting sequential image reading; causing the image reading apparatus to perform a continuation instructing step of transmitting to the processing apparatus a continuation instruction for continuously reading image data of the next page; causing the image reading apparatus to perform a termination instructing step of transmitting to the processing apparatus a termination instruction for terminating the sequential image reading; causing the image reading apparatus to perform a cancellation instructing step of transmitting to the processing apparatus a cancellation instruction for canceling image reading; causing the processing apparatus to perform a receiving step of receiving from the image reading apparatus the start instruction, the continuation instruction, the termination instruction, and the cancellation instruction; causing the processing apparatus to perform a reading controlling step of controlling the image reading apparatus so as to cause the image reading apparatus to perform the reading step and receiving from the image reading apparatus the read image data; and causing the processing apparatus to perform a storing step of storing image data of at least one page received from the image reading apparatus in a period between reception of the start instruction and reception of the termination instruction as one file. After receiving the start instruction in the receiving step, the processing apparatus performs the reading controlling step. In a case where the processing apparatus receives the cancellation instruction in the receiving step while causing the image reading apparatus to perform the reading step in the reading controlling step, the image processing apparatus causes the image reading apparatus to terminate the reading step and deletes image data of a page being read. In a case where after the reading step has been performed in the reading controlling step, i) the processing apparatus receives the termination instruction in the receiving step, the processing apparatus terminates the reading controlling step and performs the storing step, ii) the processing apparatus receives the continuation instruction in the receiving step, the processing apparatus causes the image reading apparatus to perform the next reading step, or iii) the processing apparatus receives the cancellation instruction in the receiving step, the processing apparatus performs controlling processing for deleting image data that has been acquired in the last reading step and has yet to be stored.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.



BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a block diagram of an image reading system according to a first embodiment of the present invention.
FIG. 2 is a block diagram of an image reading apparatus.
FIG. 3 is a diagram illustrating an operation panel.
FIG. 4 is a block diagram illustrating the relationship among programs performed in an image reading system.
FIG. 5 is a flowchart illustrating the processes performed by an application, an image reading control unit, and a user instruction monitor unit.
FIG. 6A is a diagram illustrating the process performed when a cancellation button is pressed during image reading.
FIG. 6B is a diagram illustrating the process performed when image acquisition fails during image reading.
FIG. 6C is a diagram illustrating the process performed when a total image data amount of acquired pieces of image data does not reach an image data amount set in advance.
FIG. 6D is a diagram illustrating the process performed when a total image data amount of acquired pieces of image data reaches an image data amount set in advance.
FIG. 6E is a diagram illustrating the process performed when a cancellation button is pressed in a user instruction monitoring state.
FIG. 6F is a diagram illustrating the process performed when a continuation button is pressed in the user instruction monitoring state.
FIG. 6G is a diagram illustrating the process performed when a clear button is pressed in the user instruction monitoring state.
FIG. 6H is a diagram illustrating the process performed when an end button is pressed in the user instruction monitoring state.



DESCRIPTION OF THE EMBODIMENTS
FIG. 1 is a block diagram illustrating an image reading system RS according to a first embodiment of the present invention. The image reading system RS includes host PCs 10, 10a, and 10b and an image reading apparatus R1.
The host PC 10 includes a central processing unit 11, a ROM 12, a RAM 13, a disk apparatus 14, a bus 15, an I/F 16, an I/F 17, an I/F 18, and an external storage apparatus 19.
The central processing unit 11 performs processing in accordance with a program stored in the RAM 13. The ROM 12 stores a program for a basic input output system (BIOS). An OS, a control program for the image reading apparatus R1, etc. are loaded into the RAM 13. The RAM 13 has a storage area required for the operation of the above-described control program and a work area.
The disk apparatus 14 stores an OS and a control program for the image reading apparatus R1. The bus 15 connects the above-described components to each other, and transfers data among the above-described components. The I/F 16 is connected to an input unit I including a mouse and a keyboard.
The external storage apparatus 19 drives a disk, a CD-ROM, etc. If the above-described program is not stored in the RAM 13 in advance and is stored in a CD-ROM or the like, the external storage apparatus 19 reads out the program from the CD-ROM and downloads the read program into the RAM 13. A single image reading apparatus R1 is connected to at least one host PC (in this example, three host PCs).
A communication line L connects the image reading apparatus R1 to the I/F 18 included in the host PC 10, and is compliant with, for example, USB, IEEE1394, or SCSI. A communication line L2 connects the image reading apparatus R1 to host PCs 10a and 10b using communication lines La and Lb, respectively, and is, for example, a LAN (Local Area Network) or WAN (Wide Area Network).
The configuration of the host PCs 10a and 10b is the same as that of the host PC 10.
FIG. 2 is a block diagram of the image reading apparatus R1. The image reading apparatus R1 includes an image-forming lens 22, a CCD 23 that is an example of a solid-state image pickup device, an AMP 24, an A/D converter 25, an image processing circuit 26, a buffer memory 27, an interface circuit 28, a CPU 29, a light control circuit 30, a light source lamp 31, a motor driving circuit 32, an optical driving motor 33, a work memory 34, a gamma LUT 35, and an operation panel 40.
The AMP 24 amplifies an analog image signal output from the CCD 23 that is a line image sensor. The A/D converter 25 converts the analog image signal output from the AMP 24 into a digital image signal. The image processing circuit 26 performs pieces of image processing such as offset compensation, shading compensation, digital gain control, color balance control, color masking conversion, and resolution conversion in a main scanning direction and a sub scanning direction upon the digital image signal.
The buffer memory 27 includes a RAM, and temporarily stores image data. The interface circuit 28 is used to receive/output a command and an image from/to a host PC connected thereto.
The CPU 29 is a controller for controlling the image reading apparatus R1 in accordance with a command transmitted from a host PC connected thereto, and controls the motor driving circuit 32, the light control circuit 30, the image processing circuit 26, etc.
The light control circuit 30 drives and turns on the light source lamp 31. The light source lamp 31 illuminates a document D1. Light that is reflected from the document D1 in accordance with the surface density of the document D1 is formed on a line image sensor such as the CCD 23, which is an example of a solid-state image pickup device, as an image via the image-forming lens 22.
The motor driving circuit 32 drives the optical drive motor 33 such as a stepper motor, and outputs an excitation signal to the optical drive motor 33 on the basis of a control signal transmitted from the CPU 29 that is a system control unit for the image reading apparatus R1.
The work memory 34 is used as a temporary work memory used for image processing performed by the image processing circuit 26. Furthermore, the work memory 34 is used for the correction of RGB interlinear offsets of image signals obtained from RGB line sensors disposed in parallel with each other at predetermined offset intervals on the CCD 23 such as a line image sensor. Still furthermore, the work memory 34 temporarily stores various pieces of data including shading correction data.
The gamma LUT 35 stores a density gamma conversion LUT and performs gamma correction.
The CPU 29 detects pressing of a switch disposed on the operation panel 40, and notifies a host PC connected thereto of the fact that the switch has been pressed via an interface.
FIG. 3 is a diagram illustrating the operation panel 40. The operation panel 40 includes an LCD 41 for displaying scanning information, etc., an operation button 42, an OK button 43, a cancellation button 44, a clear button 45, a start button 46, a continuation button 47, and an end button 48.
The LCD 41 displays scanning setting items including a color mode, a resolution, and a size. If the OK button 43 is pressed after one of the setting items has been selected using the operation button 42, the setting of scanning, for example, a color mode, a resolution, or a size can be performed. If the cancellation button 44, the clear button 45, the start button 46, the continuation button 47, and the end button 48 are pressed, corresponding instruction signals are transmitted to a host PC connected to the operation panel 40.
The start button 46 is an example of a reading start instruction unit for transmitting an image reading start instruction. The continuation button 47 is an example of a reading continuation instruction unit for transmitting an image reading continuation instruction. The end button 48 is an example of a reading termination instruction unit for transmitting an image reading termination instruction. The cancellation button 44 is an example of a reading cancellation instruction unit for transmitting an image reading cancellation instruction.
FIG. 4 is a block diagram illustrating the relationship among programs performed in the image reading system RS. The host PC 10 includes an OS 51, a device driver 52, an application 55, and the I/F 18. The device driver 52 includes an image reading control unit 53 and a user instruction monitor unit 54. Each program is installed in the disk apparatus 14 included in the host PC 10. If a user or another program calls a program, the called program is loaded into the RAM 13 and is then executed.
If the host PC 10 is turned on, the OS 51 is activated. The user instruction monitor unit 54 for monitoring ON/OFF of a user operation button is called when the OS 51 is activated and is resident in the RAM 13. Furthermore, the user instruction monitor unit 54 transmits signals to the image reading apparatus R1 at regular intervals, and determines which of the clear button 45, the start button 46, the continuation button 47, and the end button 48 has been pressed by checking a response signal transmitted from the image reading apparatus R1.
The application 55 is called when the pressing of the start button 46 is detected by the user instruction monitor unit 54. Furthermore, the application 55 calls the image reading control unit 53, reads an image in accordance with a condition set by a user, and performs image processing set in advance.
The configuration of the host PCs 10a and 10b included in the image reading system RS is the same as that of the host PC 10.
The image reading control unit 53 is an example of an image reading control unit for controlling an image reading apparatus so as to cause the image reading apparatus to read an image.
FIG. 5 is a flowchart illustrating processes performed by the application 55, the image reading control unit 53, and the user instruction monitor unit 54. The application 55 transmits a command to the image reading apparatus R1 and receives a result from the image reading apparatus R1 via the image reading control unit 53. The image reading control unit 53 is controlled by the application 55, and functions as a communication interface between the application 55 and the image reading apparatus R1. The processes performed by the image reading control unit 53 and the application 55 are illustrated on the left side of a dotted line in FIG. 5, and the process performed by the user instruction monitor unit 54 is illustrated on the right side of the dotted line in FIG. 5.
As described previously, the user instruction monitor unit 54 is called when the OS 51 is activated and is resident in the RAM 13 (step S1) so as to periodically determine whether a start button of the image reading apparatus R1 has been pressed. The user instruction monitor unit 54 repeats the above-described processing until an instruction is transmitted thereto (step S2). A user sets a desired image transmission destination host PC, a desired resolution, a desired color mode, a desired image size, etc. and then presses the start button 46. If the user instruction monitor unit 54 determines that the start button 46 has been pressed, it adds an argument representing the user instruction monitor unit 54 to a call to be transmitted to the application 55, and transmits the call to the application 55 (step S3).
If the application 55 recognizes that it has been called by the user instruction monitor unit 54, it calls the image reading control unit 53 so as to perform initialization processing (step S4). The application 55 checks the argument added by the user instruction monitor unit 54 and performs an image reading setting on the basis of the argument (step S5). The application 55 acquires data blocks each having a data amount set in advance into which data of a single document is divided (step S6).
The user instruction monitor unit 54 determines whether the cancellation button 44 has been pressed by the user each time one of these data blocks is acquired (step S7). If the user instruction monitor unit 54 determines that the cancellation button 44 has been pressed, it deletes the image data of the document being acquired (step S8), cancels the image acquisition of the current document, and is in a user instruction monitoring state so as to determine whether the next document to be read is present (steps S10, S12, S13, and S15). If the user instruction monitor unit 54 cannot determine that the cancellation button 44 has been pressed, it is determined whether the total image data amount of acquired data blocks reaches a desired image data amount so as to determine whether the acquisition of all of the data blocks corresponding to the single document has been completed (step S9). If the total image data amount of the acquired data blocks does not reach the desired image data amount of the single document, the application 55 determines that the acquisition of all of the data blocks has not been completed and acquires the next data block (step S6). If the total image data amount of the acquired data blocks reaches the desired image data amount of the single document, it is determined that the acquisition of all of the data blocks has been completed and the user instruction monitor unit 54 is in the user instruction monitoring state so as to determine whether the next document to be read is present (steps S10, S12, S13, and S15).
If images are acquired from a document feeding unit such as an automatic document feeder (ADF) on which a plurality of documents can be set at a time, it is determined that the acquisition of all of pieces of image data has been completed when all of these set documents are acquired.
In the user instruction monitoring state (steps S10, S12, S13, and S15), the user instruction monitor unit 54 periodically determines whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed until it determines that any one of these buttons has been pressed.
If the user instruction monitor unit 54 determines that the cancellation button 44 has been pressed (step S10), the last acquired image data of one page of the document is deleted (step S11) and the user instruction monitor unit 54 is in the user instruction monitoring state again (steps S10, S12, S13, and S15). If the user instruction monitor unit 54 determines that the continuation button 47 has been pressed (step S12), the image reading setting is performed again (step S5) and image acquisition is performed (step S6). If the user instruction monitor unit 54 determines that the clear button 45 has been pressed (step S13), all of acquired pieces of image data are deleted (step S14) and termination processing is performed (step S16). If the user instruction monitor unit 54 determines that the end button 48 has been pressed, acquired pieces of image data of a plurality of pages are stored as one file (step S17).
An image storage unit stores images received in a period between step S2 in which the start instruction unit transmits a start instruction and step S15 in which the termination instruction unit transmits a termination instruction as one file. Subsequently, the process returns to step S2 in which the start button 46 is monitored.
In step S5, the image reading control unit 53 transmits information about the image reading setting and a lock command for locking the image reading apparatus R1 to the image reading apparatus R1. Upon receiving the lock command, the image reading apparatus R1 is in an exclusion state in which the image reading apparatus R1 receives a command only from the image reading control unit 53 that has transmitted the lock command thereto. If a command is transmitted to the image reading apparatus R1 from the image reading control unit 53 included in another host PC, the image reading apparatus R1 transmits a busy error to the image reading control unit 53 in response to the command.
In step S16, the image reading control unit 53 transmits a termination command and an image reading apparatus unlock command to the image reading apparatus R1. Upon receiving the unlock command, the image reading apparatus R1 cancels the exclusion state so as to receive a command from the image reading control unit 53 included in each of all host PCs connected thereto.
FIG. 6A illustrates details of the process performed when the start button 46 of the image reading apparatus R1 is pressed (step S2), image reading is started, and the cancellation button 44 is pressed during image reading (step S7).
When the user instruction monitor unit 54 determines whether the start button 46 has been pressed (step S21), a user selects one of host PCs and presses the start button 46 of the image reading apparatus R1. The user instruction monitor unit 54 installed in the selected host PC detects the pressing of the start button 46 (step S22). The user instruction monitor unit 54 activates the application 55 and transmits a notification that the start button 46 has been pressed to the application 55 (step S23).
The application 55 activates the image reading control unit 53 (step S24). The activated image reading control unit 53 communicates with the image reading apparatus R1 so as to perform initialization processing (step S25). If the initialization processing is successfully performed, the image reading apparatus R1 transmits a notification that the initialization processing has been successfully performed to the image reading control unit 53 (step S26). The image reading control unit 53 transmits a notification that it has been successfully activated to the application 55 (step S27).
Subsequently, the application 55 transmits information about image reading settings to the image reading control unit 53 (step S28). The image reading control unit 53 transmits the information about the image reading settings to the image reading apparatus R1 (step S29). The image reading apparatus R1 transmits a notification that the image reading settings have been correctly completed to the image reading control unit 53 (step S30). The image reading control unit 53 transmits a notification that the image reading settings have been successfully performed to the application 55 (step S31). The image reading settings include the settings of a reading size, a resolution, a color, sharpness, etc.
Subsequently, the application 55 transmits an image acquisition command to the image reading control unit 53 (step S32). The image reading control unit 53 transmits the image acquisition command to the image reading apparatus R1 (step S33). At that time, if the user presses the cancellation button 44, the user instruction monitor unit 54 detects the pressing of the cancellation button 44 (step S34) and transmits a notification that the cancellation button 44 has been pressed to the application 55 (step S35). The application 55 deletes image data being acquired and transmits an instruction for causing the user instruction monitor unit 54 to determine whether the next page of the document is present to the user instruction monitor unit 54 (step S36). The user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed.
FIG. 6B illustrates the process performed when the start button 46 is pressed, image acquisition is started, and the image acquisition is failed in the middle of the image acquisition. The process illustrated in FIG. 6B is performed after the process from step S21 to step S33 in FIG. 6A.
If the image reading apparatus R1 fails to perform image acquisition due to an error, for example, the disconnection between the image reading apparatus R1 and a host PC, it transmits a notification that the image acquisition has failed to the image reading control unit 53 (step S41). The image reading control unit 53 transmits the notification that the image acquisition has failed to the application 55 (step S42). The application 55 deletes image data being acquired and transmits a termination command to the image reading control unit 53 (step S43).
The image reading control unit 53 communicates with the image reading apparatus R1 so as to perform termination processing (step S44). The image reading apparatus R1 transmits a notification that the termination processing has been successfully completed to the image reading control unit 53 (step S45). The image reading control unit 53 transmits a notification that the termination processing has been successfully completed to the application 55 (step S46). The application 55 stores pieces of image data of a plurality of pages acquitted in a period between step S23 in which an activation command is transmitted and step S46 in which a termination success notification is transmitted as one file.
FIG. 6C illustrates the process performed when the start button 46 of the image reading apparatus R1 is pressed, image acquisition is started, and the total image data amount of acquired pieces of image data does not reach an image data amount set in advance. The process illustrated in FIG. 6C is performed after the process from step S21 to step S33 in FIG. 6A.
If the image reading apparatus R1 successfully performs image acquisition, it transmits a notification that the image acquisition has been successfully performed to the image reading control unit 53 (step S51). The image reading control unit 53 compares a total image data amount of pieces of image data acquired after image reading has been started with an image data amount set in image reading setting processing. If the total image data amount does not reach the image data amount set in advance, the image reading control unit 53 transmits image data and an image acquisition incompletion notification to the application 55 (step S52). After the application 55 has received the image acquisition incompletion notification, the process returns to step S32 in which the application 55 transmits an image acquisition command to the image reading control unit 53 so as to acquire image data. The above-described processing is repeated until all of pieces of image data are acquired.
FIG. 6D illustrates the process performed when the start button 46 of the image reading apparatus R1 is pressed, image acquisition is started, and a total image data amount of acquired pieces of image data reaches an image data amount set in advance. The process illustrated in FIG. 6D is performed after the process from step S21 to step S33 in FIG. 6A.
The image reading control unit 53 receives image data and a notification that image acquisition has been successfully performed from the image reading apparatus R1 and compares a total image data amount of pieces of image data acquired after image reading has been started with a image data amount set in the image reading setting processing. If the total image data amount reaches the image data amount set in the image reading setting processing, the image reading control unit 53 transmits image data and an image acquisition completion notification to the application 55 (step S61). The application 55 determines whether the next page of a document is present and transmits a result of the determination to the user instruction monitor unit 54 (step S36). The user instruction monitor unit 54 is in the user instruction monitoring state (step S37), and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed.
FIG. 6E illustrates the process performed when the user instruction monitor unit 54 is in the user instruction monitoring state and a user presses the cancellation button 44 of the image reading apparatus R1 (step S10).
The user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed. If a user presses the cancellation button 44 of the image reading apparatus R1, the user instruction monitor unit 54 detects the pressing of the cancellation button 44 (step S71). The user instruction monitor unit 54 transmits a notification that the cancellation button 44 has been pressed to the application 55 (step S72). The application 55 deletes the last acquired image data of one page of a document and transmits an instruction for determining whether the next page of the document is present to the user instruction monitor unit 54 (step S36). The user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed.
FIG. 6F illustrates the process performed when the user instruction monitor unit 54 is in the user instruction monitoring state and a user presses the continuation button 47 of the image reading apparatus R1.
If the user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed. If a user presses the continuation button 47 of the image reading apparatus R1, the user instruction monitor unit 54 detects the pressing of the continuation button 47 (step S81).
The user instruction monitor unit 54 transmits a notification that the continuation button 47 has been pressed to the application 55 (step S82). The application 55 transmits information about image reading settings to the image reading control unit 53 again (step S28) and performs image acquisition (step S32).
FIG. 6G illustrates the process performed when the user instruction monitor unit 54 is in the user instruction monitoring state and a user presses the clear button 45 of the image reading apparatus R1.
The user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether the cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed. If a user presses the clear button 45 of the image reading apparatus R1, the user instruction monitor unit 54 detects the pressing of the clear button 45 (step S91).
The user instruction monitor unit 54 transmits a notification that the clear button 45 has been pressed to the application 55 (step S92). The application 55 deletes all of pieces of image data acquired in a period between step S23 in which an activation command is transmitted and step S92 in which a notification that the clear button 45 has been pressed is transmitted, and transmits a termination command to the image reading control unit 53 (step S43). The image reading control unit 53 communicates with the image reading apparatus R1 so as to perform termination processing (step S44).
The image reading apparatus R1 transmits a notification that the termination processing has been successfully performed to the image reading control unit 53 (step S45). The image reading control unit 53 transmits a notification that the termination processing has been successfully performed to the application 55 (step S46).
FIG. 6H illustrates the process performed when the user instruction monitor unit 54 is in the user instruction monitoring state and a user presses the end button 48 of the image reading apparatus R1.
The user instruction monitor unit 54 is in the user instruction monitoring state (step S37) and periodically causes the image reading apparatus R1 to determine whether cancellation button 44, the continuation button 47, the clear button 45, and the end button 48 have been pressed.
If a user presses the end button 48 of the image reading apparatus R1 (step S101), the user instruction monitor unit 54 detects the pressing of the end button 48. The user instruction monitor unit 54 transmits a notification that the end button 48 has been pressed to the application 55 (step S102). The application 55 transmits a termination command to the image reading control unit 53 (step S43). The image reading control unit 53 communicates with the image reading apparatus R1 so as to perform termination processing (step S44). The image reading apparatus R1 transmits a notification that the termination processing has been successfully performed to the image reading control unit 53 (step S45). The image reading control unit 53 transmits a notification that the termination processing has been successfully performed to the application 55 (step S46). The application 55 stores pieces of image data of a plurality of pages acquired in a period between step S23 in which an activation command is transmitted and step S46 in which a notification that the termination processing has been successfully performed is transmitted as one file.
The image reading apparatus R1 according to an embodiment of the present invention may be applied to a scanner having only an image reading function or a multifunction device in which a printer, a facsimile, and a scanner are integrated. If the image reading apparatus R1 is applied to a multifunction device, commands other than image reading commands, for example, a print command and a fax command transmitted from a host PC or another host PC, may be rejected while the above-described exclusion control processing is performed.
If a user specifies the number of sheets of a document to be read for the image reading apparatus R1, the first embodiment can be applied.
In order to achieve the above-described objects, a computer-readable storage medium storing program code of software achieving functions of the above-described embodiments may be supplied to a system or an apparatus and a computer (or a CPU or MPU) included in the system or apparatus may read the program code from the computer-readable storage medium and execute the read program code. In this case, the program code itself read from the computer-readable storage medium achieves the functions of the above-described embodiments. Accordingly, the present invention includes the computer-readable storage medium storing the program code.
According to the above-described embodiments, it is possible to store a plurality of read images in a personal computer as one file only by operating an instruction unit provided with an image reading apparatus and scanning a desired number of sheets of a document. During storing processing, a user can exclusively use the image reading apparatus and prevent the occurrence of an interrupt of another job. Even if a user sets a document different from a desired document, the user can delete falsely read image data only by operating the instruction unit provided with the image reading apparatus.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all modifications and equivalent structures and functions.

## Claims

1. An apparatus comprising:
a memory configured to store a program; and
at least one processor configured to execute the program,
wherein the at least one processor causes a reading mechanism to read a sheet by an image sensor of the reading mechanism and inputs image data, in accordance with a reading instruction by a user,
wherein the at least one processor executes exception of a page from pages to be contained in a file and inputting image data of an added page added to the pages respectively, in accordance with an exception instruction by the user and the reading instruction by the user for adding the added page, regardless of an operation order of the reading instruction and the exception instruction,
wherein the at least one processor stores, on a storage, a file which contains image data of a page which is not excepted by the exception instruction and does not contain image data of an excepted page excepted by the exception instruction, in accordance with an end instruction by the user for instructing an end of the input of image data to be contained in the file, and
wherein each of the exception instruction, the reading instruction for adding the added page, and the end instruction, is separately received by an operation mechanism which is included in one device having the reading mechanism.

2. The apparatus according to claim 1, wherein the at least one processor stores the file on the storage after the image data corresponding to the excepted page is deleted.

3. The apparatus according to claim 1, wherein the at least one processor stores, on the storage, the file containing image data of the pages input during a time from a start instruction, received by the operation mechanism, for instructing a start of the input of image data to be contained in the file, to the end instruction for instructing an end of the input of image data to be contained in the file.

4. The apparatus according to claim 3, wherein the at least one processor stores, on the storage, the file containing the image data of the pages which is input during a time from the start instruction to the end instruction and is not excepted by the exception instruction.

5. The apparatus according to claim 1, wherein in a case where image data of one page is input and the end instruction is received, the at least one processor is capable of storing on the storage a file which contains image data of the one page only.

6. The apparatus according to claim 5, wherein the end instruction is received by the operation mechanism, in response to an operation by a user to a common button which is operated commonly for storing a file containing image data of only one page and storing a file containing image data of a plurality of pages.

7. The apparatus according to claim 1, wherein the reading mechanism comprises a light resource and the image sensor, and reads a sheet by using the light resource and the image sensor.

8. The apparatus according to claim 1, wherein the excepted page is a page in which image data corresponding to whole of the page have been input.

9. The apparatus according to claim 8, wherein the excepted page is excepted in accordance with the exception instruction issued after the reading corresponding to the page to be excepted is wholly completed.

10. The apparatus according to claim 1, wherein the apparatus and the device including the reading mechanism and the operation mechanism, are contained in different cases.

11. The apparatus according to claim 10, wherein the device is connected to the apparatus via a network.

12. The apparatus according to claim 1, wherein the at least one processor is capable of inputting instruction information corresponding to the reading instruction, the exception instruction, and the end instruction, in a case where the inputting of image data of a page has been completed.

13. The apparatus according to claim 1, wherein the operation mechanism includes a display mechanism on which the user designates a reading setting, and
wherein the at least one processor causes the reading mechanism to read the sheet, in accordance with the reading setting designated on the display mechanism, in response to the reading instruction by the user.

14. The apparatus according to claim 1, wherein the at least one processor inputs the image data in a page unit, in accordance with each of the reading instructions.

15. The apparatus according to claim 1, wherein the at least one processor is capable of inputting the image data of a plurality of pages, in accordance with the reading instruction.

16. The apparatus according to claim 1, wherein, in a case where a reading instruction is received by the operation mechanism after the exception instruction is received by the operation mechanism, the at least one processor further inputs the image data of the added page, and in a case where the end instruction is further received by the operation mechanism after the inputting corresponding to the added page, the at least one processor stores, on the storage, the file which contains the image data of the added page and the image data of the page which is not excepted by the exception instruction and does not contain the image data of the excepted page.

17. The apparatus according to claim 1, wherein the operation mechanism is an operation panel for accepting the operation by a user as the reading instruction, the end instruction, and the exception instruction.

18. An apparatus comprising:
a memory configured to store a program; and
at least one processor configured to execute the program,
wherein the at least one processor causes a reading mechanism to read a sheet by an image sensor of the reading mechanism and inputs image data, in accordance with a reading instruction by a user,
wherein, in a case where an exception instruction by the user is received, and then a reading instruction by the user for adding a page to pages to be contained in a file is received, the at least one processor executes exception of a page from pages to be contained in a file and inputting image data of an added page added to the pages respectively,
wherein, in a case where an end instruction by the user is received, the at least one processor stores, on the storage, a file which contains image data of a page which is not excepted by the exception instruction and image data of an added page input by the reading instruction and does not contain image data of an excepted page excepted by the exception instruction, and
wherein each of the exception instruction, the reading instruction for adding the added page, and the end instruction, is separately received by an operation mechanism which is included in one device having the reading mechanism.

19. An apparatus comprising:
a memory configured to store a program; and
at least one processor configured to execute the program,
wherein the at least one processor causes a reading mechanism to read a sheet by an image sensor of the reading mechanism and inputs image data, in accordance with a reading instruction by a user,
wherein the at least one processor executes exception of a page from pages to be contained in a file and inputting image data of an added page added to the pages respectively, in accordance with the respective reading instruction by the user and an exception instruction by the user, either in a first case where the reading instruction is received after the exception instruction or in a second case where the exception instruction is received after the reading instruction,
wherein the at least one processor stores, in the storage, a file which contains image data of a page which is not excepted by the exception instruction and does not contain image data of an excepted page excepted by the exception instruction, in accordance with an end instruction for instructing an end of the input, and
wherein each of the exception instruction, the reading instruction for adding the added page, and the end instruction, is separately received by an operation mechanism which is included in one device having the reading mechanism.