(i) Technical Field
The present invention relates to an image processing apparatus, and a non-transitory computer readable medium storing an image processing program.
(ii) Related Art
When a document is read with an image reader such as a scanner or a camera, and thus an image is acquired, the image is tilted as compared with the original document in some cases. For this reason, a technique for correcting tilt of an image has been developed in the related art.
In a technique for correcting tilt, employed in the related art, only one tilt angle is detected from an image, and the entire image is corrected using the tilt angle. For example, when a bound original document is read on double-spread pages, since tilt angles are different in the double-spread pages or the original document is curved at the bound location, the bound original document is thus read so as to be further tilted than the outside thereof, and a tilt angle varies in the image. In addition, when several images are combined as well, a tilt angle may be different for each image. In this case, only one tilt angle may not be obtained, or it is unclear whether or not a corrected image is a correction result desired by a user even if the entire image is corrected using only one tilt angle.
In addition, an erroneously detected tilt angle is unable to be handled, and, even if a region on which tilt correction is desired by a user is limited, the tilt correction is performed on the entire image. In addition, some tilt correction is performed even on a region, such as a handwritten region on which tilt correction is not required to be performed.
According to an aspect of the invention, there is provided an image processing apparatus including:
a determination unit that determines a partial region which is a display object in an image;
an angle acquisition unit that acquires angle information indicating a tilt in the partial region;
a correction unit that corrects an angle of the partial region according to the angle information; and
a display that displays a partial region of which the angle is corrected.
Exemplary embodiments of the present invention will be described in detail based on the following figures, wherein:
The angle acquisition section 12 acquires angle information indicating a tilt in the partial region determined by the region determination section 11. For example, a tilt angle of the partial region may be calculated using a well-known method such as a Hough transform, and may be used as the angle information.
The correction section 13 at least corrects an angle of the partial region determined by the region determination section 11 according to the angle information acquired by the angle acquisition section 12. This process may also be performed using a well-known tilt correction method. A correction process may not be performed on regions other than the partial region, or tilt correction may be performed thereon according to the angle information acquired for the partial region.
The display 14 displays the partial region of which an angle is corrected by the correction section 13. In this case, regions other than the partial region may not be displayed, or may be displayed when tilt correction is performed thereon by the correction section 13.
In this image, a user designates a partial region so as to enlarge and display an image including the curved part surrounded by the broken line. For example, an image may be displayed as illustrated as an example in
When the partial region is designated by the user, the region determination section 11 receives the designation so as to determine the partial region. This partial region is illustrated in
A case where a user refers to the region surrounded by the bold broken line in this image is assumed. In this case, the user designates the region surrounded by the bold broken line, and the designation is received by the region determination section 11, and the region is designated as a partial region. In addition, a tilt angle of the partial region is acquired as angle information by the angle acquisition section 12. The correction section 13 performs an angle correction process on the entire image according to the angle information acquired by the angle acquisition section 12, and displays a corrected image on the display 14. Further, when the image is displayed, display for easy understanding when viewed, such as highlight display or comment display, may be performed in the partial region determined as a reference for the correction by the region determination section 11.
As a modification example of the second exemplary embodiment of the invention, there may be a configuration in which the region determination section 11 receives designation of a region to be uncorrected on which angle correction will not be performed, and the correction section 13 does not perform angle correction on the region to be uncorrected.
If the region determination section 11 receives designation of the partial region which is used as a reference for tilt correction and the region to be uncorrected on which tilt correction is not performed, the angle acquisition section 12 calculates a tilt angle in the partial region so as to acquire angle information. The correction section 13 performs the angle correction process on the entire image according to the angle information acquired by the angle acquisition section 12, but does not perform the correction process on the region to be uncorrected at this time.
An example of an image obtained through the correction process is illustrated in
The tilt angle calculation section 15 calculates a tilt angle for each divided region of an image. An image may be divided into regions with a predefined size, or may be divided using various well-known methods such as a method of dividing an image in a white region. A tilt angle is calculated for each divided region by using a well-known method such as, for example, a Hough transform, and is correlated with each divided region.
The process by the tilt angle calculation section 15 may be performed in advance, and may not be provided when a tilt correction process is performed. For example, when an image in which a tilt angle is correlated with each divided region is given, the tilt angle calculation section 15 may not be provided.
The region determination section 11 determines a partial region which is a display object in the image, for example, in response to an instruction or the like from a user as described in the first and second exemplary embodiments. In addition, a region to be uncorrected described in the modification example of the second exemplary embodiment may be set.
The angle acquisition section 12 specifies a divided region included in the partial region determined by the region determination section 11, and acquires angle information from a tilt angle corresponding to the divided region. For example, when a single divided region is included in a partial region, or a divided region is partially designated as a partial region, a tilt angle corresponding to the divided region may be acquired as angle information. When a tilt angle is calculated in advance, the angle acquisition section 12 may not calculate a tilt angle again. When a partial region includes two or more divided regions, tilt angles which respectively correspond to the two or more divided regions are read, and angle information is acquired from the tilt angles. A method of acquiring angle information may be selected from various well-known methods such as, for example, an average value of plural tilt angles, a weighted average depending on the area, and a majority rule.
The correction section 13 performs the angle correction process on at least the partial region which is determined by the region determination section 11 as described in the first exemplary embodiment, according to the angle information acquired by the angle acquisition section 12, or performs the angle correction process on the entire image as described in the second exemplary embodiment. Of course, when a region to be uncorrected described in the modification example of the second exemplary embodiment is set, correction may not be performed on the region to be uncorrected. An image or a partial image corrected by the correction section 13 is displayed on the display 14. Alternatively, the corrected image may be preserved, or may be transmitted to other devices or processing units. In addition, if the tilt angle information is not necessary after the correction process, the tilt angle information correlated with each divided region may be deleted.
In step S53, the region determination section 11 determines a partial region, for example, in response to an instruction or the like from a user. In addition, instep S54, a tilt angle corresponding to a divided region included in the partial region determined in step S53 is acquired.
This operation example illustrates an example of a case where correction of a tilt angle is not performed if there is no tilt angle exceeding a predefined threshold value. Instep S55, it is determined whether or not there is an angle exceeding the predefined threshold value in the tilt angle acquired in step S54. If there is no angle exceeding the predefined threshold value in the tilt angle acquired in step S54, the correction process of the tilt angle is not performed by the correction section 13, and an image of the partial region or the given image is displayed, for example, on the display 14 or is output to an external device, thereby finishing the process. There is a case where the correction process is wasteful since a user does not become aware even if correction is performed depending on a tilt angle, and the correction process is omitted in this case. Of course, this process may be performed based on the first exemplary embodiment, the second exemplary embodiment, and the modification example thereof, or, conversely, this determination may not be performed.
If it is determined in step S55 that there is an angle exceeding the predefined threshold value in the tilt angle acquired in step S54, in step S56, the angle acquisition section 12 acquires angle information on the basis of the tilt angle acquired in step S54. In the third exemplary embodiment, the tilt angle is calculated in advance in step S52, and thus the tilt angle is not calculated when the angle information is acquired in step S56. Therefore, processes subsequent to the determination of the partial region in step S53 are performed at a higher speed than in a case where a tilt angle is calculated when angle information is acquired.
In addition, in step S57, the correction section 13 performs a process of correcting an angle of the partial region or the entire image according to the angle information acquired in step S56. Of course, if a region to be uncorrected described in the modification example of the second exemplary embodiment is set, angle correction is not performed on the region to be uncorrected.
A corrected image or a corrected partial image is displayed on the display 14. Alternatively, the corrected image or the corrected partial image may be preserved, or may be output to an external device, for example, by being forwarded to other software circuits or other devices.
When a user designates the region surrounded by the bold broken line of
The correction section 13 performs, in this example, the angle correction process on the entire image according to the angle information acquired by the angle acquisition section 12.
All or some of the functions of the respective sections described in the above-described exemplary embodiments and modification examples of the invention may be realized by the program 21 executed by the computer. In this case, the program 21, data used by the program, and the like may be stored in the storage medium which is read by the computer. The storage medium causes a variation state of energy such as magnetism, light, or electricity in the reading section 43 provided in hardware resources of the computer according to content of the program, and forwards the content of the program to the reading section 43 in a form of a signal corresponding thereto. The magnetooptical disc 31, the optical disc 32 (including a CD, a DVD, or the like), the magnetic disk 33, the memory 34 (including an IC card, a memory card, a flash memory, or the like), and the like are examples of the storage medium. Of course, these storage media are not limited to a portable type.
The program 21 is stored in the storage medium, the storage medium is installed, for example, in the reading section 43 or the interface 45 of the computer 22, the program 21 is read from the computer so as to be stored in the internal memory 42 or the hard disk 44 (including a magnetic disk, a silicon disk, or the like) , and the CPU 41 executes the program 21, thereby realizing all or some of the functions described in the above-described respective exemplary embodiments and modification examples of the invention. Alternatively, the program 21 may be transmitted to the computer 22 via a communication path, the program 21 may be received by the communication section 46 in the computer 22 so as to be stored in the internal memory 42 or the hard disk 44, and the CPU 41 may execute the program 21, thereby realizing the functions.
In addition, hardware configuring the display 14 may be connected to the computer via the interface 45. The computer 22 may be connected to other various devices via the interface 45. For example, a reception unit which receives a designation or the like of a region performed by a user may be connected thereto, and thus an indication of a partial region or a region to be uncorrected or a selection of the option in the example of the screen illustrated in
The foregoing description of the exemplary embodiments of the present invention has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the invention to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the invention and its practical applications, thereby enabling others skilled in the art to understand the invention for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the invention be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2013-078504 | Apr 2013 | JP | national |
This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2013-078504 filed Apr. 4, 2013.