The present invention concerns a technology for processing image data.
In recent years, with the appearance of printers that connect directly to a digital camera, the operation of printing an image has been simplified.
By contrast, however, where the brightness or contrast of the image has been deliberately adjusted and modified, it is necessary to edit the image on a personal computer (“PC”).
Here, in order to facilitate the understanding of the present invention, a description will now be given of an application to be executed on a PC.
Most typical applications that process image data for brightness and contrast (such as, for example, that disclosed in Japanese Laid-Open Patent Publication No. 2001-57663) have a GUI (Graphical User Interface) comprising a brightness slider bar and a contrast slider bar, and adjust the brightness and contrast by adjusting the position of the slide on the slider bar.
However, under the existing brightness and contrast adjustment regime, these two adjustments are made independently of each other, and thus, for example, a phenomenon arises in which, when the contrast was increased, the brightness of the image further increased. In other words, despite having set the image to a target brightness, adjusting the contrast also changes the brightness. As a result, it is impossible to obtain the desired brightness and contrast without alternately adjusting the brightness and contrast multiple times. This situation arises because of the correlation between brightness and contrast, and because what kinds of changes are made to the image data by changing the brightness and contrast is not clearly understood by the user.
An object of the present invention is to overcome the above-described drawbacks. Another object is to provide a user interface technology in which a user can easily adjust brightness and contrast.
In an aspect of the present invention, the present invention provides an image processing apparatus comprising:
Other features, objects and advantages of the present invention will be apparent from the following description when taken in conjunction with the accompanying drawings, in which like reference characters designate the same or similar parts throughout the figures thereof.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the invention and, together with the description, serve to explain the principles of the invention.
Preferred embodiments of the present invention will now be described in detail according to the accompanying drawings.
<Description of the Apparatus Configuration>
In
It should be noted that the image processing apparatus configuration shown in
<Description of Image Adjustment>
In
In addition, reference numeral 240 denotes a color component selection area, and is composed of four buttons: Total color, R (red), G (green) and B (blue). The user moves a cursor linked to the input device 101 and specifies (clicks) the desired button to select the color component to be changed. It should be noted that the default selection state is “total color”.
Reference numeral 250 denotes a tone curve area that displays a tone curve corresponding to total color, R, G and B (the tone curve being also a conversion curve of a conversion table), reference numeral 260 denotes a brightness slider bar for adjusting the brightness of selected color(s) and reference numeral 270 denotes a contrast slider bar for adjusting the contrast of selected color(s). In the present embodiment, adjustment of the total color, R, G and B is possible by manipulating any one of the tone curve area 250, the brightness slider bar 260, or the contrast slider bar 270.
It should be noted that, in the tone curve area 250 of the present embodiment, histograms of the color components (in the present embodiment, R, G, B) of the image file designated by the user are displayed in such a way as to overlap the tone curve. It should also be noted that the histograms that are displayed are unrelated to the colors designated by the color component selection area, and are displayed so that the luminance of each of the colors R, G, B is always shown on the horizontal axis, and the frequency is shown on the vertical axis. However, alternatively, the embodiment may be configured so as to display only the histogram of the color component designated in the color component selection area 240. The reason why the histograms are displayed is that it becomes an index when adjusting the tone curve of the color components. The histograms are displayed in the tone curve area 250 so that the user can carry out adjustment of the tone curve that is described below without frequently changing his or her viewing position.
A more detailed description will now be given of the tone curve area 250 of the present embodiment.
The tone curve area 250 of the present embodiment is substantially square, with the horizontal axis representing input pixel value (which is also the pixel value before correction) and the vertical axis representing output pixel value (which is also the pixel value after correction), each with a range of 0-255. In other words, each color components R, G, B is expressed in 8-bit units.
In
Next, a description will be given of the relation between the brightness slider bar 260, the contrast slider bar 270 and the tone curve 251.
The brightness slider bar 260 is composed of a knob 260a movable in a horizontal direction (subject to manipulation by the user) and an area 260b that displays the amount of correction depending on the current position of the knob 260a. In an initial state, the knob 260a is located at the center of the slider bar, and thus the correction amount area 260b shows “0”. When the knob 260a is moved to the right, the number displayed in the correction amount area 260b increase. Conversely, when the knob 260a is moved to the left, the number displayed in the correction amount area 260b decreases (that is, becomes negative).
The foregoing option is the same for the contrast slider bar 270. That is, when the position of a knob 270a is changed, the number displayed in a correction amount area 270b also changes accordingly. A specific example thereof is described below.
Before proceeding to the following description, the terms will be defined as follows.
When the knob 260a of the brightness slider bar 260 is moved to the right (in the “+” direction) by the user's operation, the tone curve 251 moves upward as shown in
By contrast,
When the knob 270a of the contrast slider bar 270 is moved to the right (+direction), as shown in
If in the state shown in
The foregoing description relates to instances in which either the brightness slider bar 260 or the contrast slider bar 270 is manipulated. The following description relates to instances in which both slider bars are operated.
For example, in the state shown in
Accordingly, the four parameters of
It should be noted that, as can be easily understood, the state shown in
Moreover,
The foregoing description pertains to changes in the tone curve 251 as the brightness slider bar 260 and the contrast slider bar 270 are manipulated in the present embodiment. Conversion according to the tone curve 251 of the present embodiment can be summarized as follows.
As shown in
It should be noted that, as described above, the shape of the tone curve 251 connecting points A-B can be changed. Thus, by adjusting the brightness slider bar 260 and the contrast slider bar 270, that shape can be expanded/compressed along to a horizontal direction or a vertical direction. A description of that expansion/compression processing is given below.
<Processing Using the Brightness Slider Bar>
A description will now be given of processing when the brightness slider bar is manipulated, referring to
First, in step S301, a new brightness level Br1 is determined according to the movement of the brightness slider. In step S302, the coordinate of the point A of intersection of the line represented by the IN_SDW and the line represented by OUT_MIN shown in
Next, in step S303, the coordinate of a point A1 of intersection between the straight line L and x=0 and the coordinate of a point B1 of intersection between the straight line L and x=255 are obtained. In step S304, a current brightness Br0 is obtained. Since the brightness of the tone curve can be defined by the y coordinate intermediate between points A1 and B1, the “Br0” may be obtained therefrom. In step S305, an amount of change D in the brightness is calculated from the difference between Br1 and Br0. In step S306, the positions of a point A2 and a point B2, to which the Y coordinates of points A1 and B1 are shifted by an amount D, are calculated. In a step S307, the straight line L1 connecting points A2 and B2 is calculated (see
In step S309, the intersection of the straight line L1 and the line represented by IN_SDW is calculated, the y coordinate Min1 thereof is set as a new OUT_MIN so that the line represented by OUT_MIN is moved to that new position.
In step S310, as shown in
In a step S311, if Min1<0, Min1 is set to “0” and that position is made Min2. Then, the x coordinate S1 of the intersection of the Min2 and the straight line L1 is set as a new IN_SDW so that the line represented by IN_SDW is shifted to the position of S1.
In a step S312, the tone curve 251 is expanded/compressed in real time according to the lines of the post-shift IN_HLT, IN_SDW, OUT_MAX and OUT_MIN. Expansion/compression involves expanding or compressing the tone curve 251 horizontally or vertically while maintaining the shape of the curve, as shown, for example, in the shift from the state shown in
<Manipulating the Brightness on the Tone Curve>
The foregoing description concerns changing the brightness by moving the knob 260a of the brightness slider bar 260 to the left or right. Below, a description is given, referring to
In an initial state, each of the four parameters (IN_HLT, IN_SDW, OUT_MAX and OUT_MIN) corresponds to each of the four sides of the outer frame of the tone curve area 250, and is a coordinate axis having the meaning described above.
The user specifies one of the four sides of the tone curve area 250 using the input device 101, and can move the specified axis to a desired position within the tone curve area 250 by dragging operation. It should be noted that, because the parameters are either horizontal or vertical lines, such movement maintains these characteristics unchanged. For example, if the user clicks on the right edge of the tone curve area 250, a handler is displayed that indicates that the line represented by IN_HLT can be moved. By dragging the handler, the line represented by IN_HLT can be moved along to the horizontal direction within the tone curve area 250. Then, if necessary, all four parameter lines cam be moved.
The process Illustrated in
Initially, in step S401, the user shifts one of lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN. At this time, either point A or point B shifts, and the tone curve 251 between points A and B is expanded or compressed as well, and displayed and revised in real time. Furthermore, the CPU 104 recalculates the histogram of each color component and displays the results of those recalculations in real time, together with the post-conversion tone curve 251, in the tone curve area 250.
In step S402, the straight line L is calculated from points A, B shown in
In a step S405, the position of the knob 260a of the brightness slider bar 260 is revised in accordance with the value for the obtained brightness Br.
Thus, as described above, according to the present embodiment, when moving the knob 260a of the brightness slider bar 260 for adjusting the brightness, the results of that adjustment are reflected in the tone curve 251 in real time, so that it is possible to grasp visually in what kind of state is the brightness. In addition, whenever the user moves one of lines represented by IN_HLT, IN_SDW, OUT_MAX and OUT_MIN, the brightness level achieved thereby is reflected in the position of the knob 260a of the brightness slider bar 260, thus enabling the user to grasp simply and directly how his or her action has affected the brightness.
<Processing Using the Contrast Slider Bar>
Next, referring to
The process illustrated in
First, in step S501, a new contrast level Ct1 is determined from the position the knob 270a of the contrast slider bar 270. Next, in step S502, the coordinate of the point A of intersection of the line of IN_SDW and the line of OUT_MIN shown in
a=tan(Ct*π/2/255).
By this equation, a slope a1 of the new line is calculated from Ct1, as a straight line L that passes through point M is calculated. In step S506, the intersection of the straight line L1 and the line of OUT_MAX is obtained and the x coordinate H1 thereof is made a new IN_HLT so that the line of IN_HLT is moved to the x coordinate H1.
In step S507, the intersection of the straight line L1 and the line of OUT_MIN is obtained and the x coordinate S1 thereof is made a new IN_SDW so that the line of IN_SDW is moved to the x coordinate S1.
In step S508, as shown in
In step S509, as shown in
Finally, in step S510, the tone curve 251 is expanded or compressed in real time in accordance with the post-movement lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN. Furthermore, the CPU 104 recalculates the histogram of each color component and displays the results of those recalculations in real time, together with the post-conversion tone curve 251, in the tone curve area 250.
<Manipulating the Contrast on the Tone Curve Area>
Adjusting of the contrast is possible not only with the contrast slider bar 270 described above but also where one lines of IN_HLT, IN_SDW, OUT_MAX or OUT_MIN is shifted. This process is described using
First, in step S601, the user shifts one of lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN. As a result, one of either point A or point B also shifts, and the tone curve 251 also expands or compresses in response thereto and is displayed in its newly revised form. Furthermore, the CPU 104 recalculates the histogram of each color and displays the results of those recalculations in real time together with the post-conversion tone curve 251 in the tone curve area 250.
In step S602, the straight line L is calculated from points A, B on the tone curve 251 shown in
In step S604, a new contrast Ct is calculated from the slope of the line connecting points A, B1, using the following formula, with the coordinates of A1 being (X1, Y1) and the coordinates of B1 being (X2, Y2), then
Ct=a tan((Y2-Y1)/(X2-X1)/(π/2)*255).
In step S605, in accordance with the value for the contrast Ct obtained as described above, the position of the knob 270a of the contrast slider bar 270 is changed and the display is revised.
Thus, as described above, where the tone curve is changed by the contrast slider bar 270, the user can grasp the extent to which the contrast has changed depending on the position of the knob 270a. Furthermore, the movement of one of either the IN_HLT, IN_SDW, OUT_MAX or OUT_MIN is reflected in the position of the knob 270a, the contrast can be set at will, and confusion on the user interface can be reduced.
It should be noted that adjustment of the brightness and contrast is carried out only with respect to the color component selected using the color component selection area 240 shown in
Moreover, if the position of one of lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN is changed, of course, there is possibility that the results thereof affects both brightness and contrast. Therefore, when the process shown in
<Description of the Main Process>
Next, a description will be given of the main process that the CPU 104 of the present embodiment executes according to the image editing application, using the flow chart shown in
Initially, in a step S1, the user selects an image file to be edited. This selection is carried out by inputting a file name with path in the area 201 on the GUI window 200 shown in
Next, processing proceeds to step S3, where the image data of the image file is converted in accordance with the current tone curve 251. The result of conversion is stored into the RAM 106. Since the post-initialization tone curve 251 maintains the equivalence of the input pixel value and the output pixel value, ultimately no conversion is performed on the selected image file. An image resulting from conversion is displayed in the image display region 202 shown in
Next, processing proceeds to step S4, where a histogram of the post-conversion image data is generated and displayed in the tone curve area 250. The histograms displayed in the present embodiment concern the RGB color components, with a histogram of each color displayed.
Red(Pr)←Red(Pr)+1
Green(Pg)←Green(Pg)+1
Blue(Pb)←Blue(Pb)+1
and it is sufficient to obtain for all pixels.
Next, processing proceeds to a step S5, standing by for instruction input from the user. Such instruction input is determined in steps S6, S8 and S9 to be described later.
First, if it is determined that the instruction input is an instruction to change the shape of the tone curve 251, manipulate the brightness slider bar 260 or the contrast slider bar 270, or move one of lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN lines, then processing proceeds from steps S6 to S7, where the changing of the tone curve 251 described above is performed. When the changing of the tone curve 251 is carried out, processing returns to step S3 to perform image conversion according to the post-conversion tone curve 251. As a result, a histogram is once again generated and revised.
By repeating steps S3 through S7 as described above, the user determines a desired tone curve 251.
If it is determined that the operation input in step S5 is activation of the OK button 203, the image converted at that point in time is saved in step S10. In saving the image, the saved image is written over the original image file. Alternatively, however, the file name may be changed. If changing the file name, the converted file saved under the new file name. Where it is determined that the cancel button 204 has been pressed, processing is terminated.
As described above, according to the present embodiment, in a GUI interface for adjusting the tone curve 251, by reflecting the results of adjustment by slider bar in the tone curve 251 in real time, the relation between user operation and the tone curve 251 can be seen clearly at a glance. In addition, if one of lines of IN_HLT, IN_SDW, OUT_MAX and OUT_MIN is changed, the results of such an operation is reflected in the brightness and contrast slider bars, thus enabling operation while also permitting easy perception of the type of operation that has been performed on the brightness and the contrast. Moreover, by adjusting the tone curve, the histograms of the colors also change in real time in response thereto, and therefore it is also possible to evaluate resulting changes to the image data objectively. Furthermore, it becomes possible to provide a superior user interface, in which changes in the tone curve 251 and changes in the color histograms can be ascertained without a change in point of view.
As is clear from the present embodiment, the present invention is adapted to a computer program that executes on an ordinary computer such as a personal computer or the like. Moreover, typically, the computer program is stored on a computer-readable storage medium such as a CD-ROM or the like. That storage medium is then set into a drive of the computer and either copied to the system or installed, and executed, and thus such computer-readable storage medium is of course within the scope of the present invention.
Moreover, the GUI described in the present embodiment is but one example of the present invention, and is not limited to the specific embodiment described above.
According to the present invention as described above, where the slider bar is manipulated the results of that manipulation are reflected in the conversion curve in real time. Furthermore, where the index axes that define the conversion are changed directly, the state of the slider bars are changed based on the results thereof, so that exactly how the results of direct adjustment of the index axes have affected the brightness and contrast can be grasped objectively.
As can be understood by those of ordinary skill in the art, a computer program executing the steps of the method and implementing the functions of the system described above is within the scope of the present invention. Moreover, because such a computer program can be executed by setting a computer-readable storage medium storing such a computer program (such as a memory card, a CD-ROM or the like) into a computer or by copying or installing same to a system of which the computer is a part, the computer-readable storage medium also is within the scope of the present invention.
As many apparently widely different embodiments of the present invention can be made without departing from the spirit and scope thereof, it is to be understood that the invention is not limited to the specific preferred embodiments described above thereof except as defined in the claims.
This application claims priority from Japanese Patent Application No. 2004-020386 filed on Jan. 28, 2004, which is hereby incorporated by reference herein.
Number | Date | Country | Kind |
---|---|---|---|
2004-020386 | Jan 2004 | JP | national |