(1) Field of the Invention
This invention relates generally to image processing and relates more particularly to methods to zoom digital images.
(2) Description of the Prior Art
Either still images or time-varying image sequences are the input to digital imaging systems. A digital zoom capability uses algorithms and zooms in on the digital image in the camera. This can greatly improve the zoom capability of the camera and is less expensive than high-sophisticated zoom lenses, but also loses some image quality. The quality depends upon the algorithms used for zooming.
The challenge of the designers of digital zooming systems is to achieve fast performing methods for zooming providing good quality images and which are easy to be implemented.
There are various patents known dealing with said problems:
U.S. Patent (U.S. Pat. No. 6,101,235 to Zavaljevski et al.) describes methods and apparatus for altering the spatial characteristics of a digital image collected in a CT system using a real-time magnification algorithm. In accordance with one embodiment of the algorithm, once the digital image is collected, an enlarged image is generated by interpolating and filtering the original digital image data. In one aspect, two pass linear interpolation and one-dimensional filtering is utilized to generate the enlarged image. The first pass performs interpolation in the x direction and the second pass performs interpolation in the y direction. The interpolations in the x and y directions are performed in two steps. Initially, linear interpolation is applied to the original digital image to generate interpolated data. A one dimensional convolution filter is then applied to the interpolated data. Utilizing this process, a high quality enlarged image may be generated for any integer zoom factor. In another aspect of the present invention, a two-step procedure of interpolation and two-dimensional filtering is utilized. The first step performs bilinear interpolation of the digital image to generate interpolated data. The interpolated data is then filtered by a two-dimensional convolution filter.
U.S. Patent (U.S. Pat. No. 5,602,870 to Hailey et al.) discloses a spatial interpolation unit used to alter a digital image by performing a zoom operation thereon. Described is a spatial interpolation unit, which comprises a discrete set of filters for which at least some of the cut-off frequencies are logarithmically spaced.
U.S. Patent (U.S. Pat. No. 5,307,167 to Park et al.) describes a digital zoom system utilizing image buffers and employing an approximated bilinear interpolation method. The zoom system includes an analog-to-digital (A/D) converter for converting an analog image signal to a digital image signal, an image buffer for storing the digital image signal generated for said A/D converter, a horizontal operation circuit for interpolating the digital image signal taken along with a horizontal direction, one or more horizontal image buffers for storing the digital image signal for 1-horizontal lines magnified in a horizontal direction, a vertical operation circuit for interpolating said horizontally magnified image signal in a vertical direction, a timing controller for controlling the image buffer, said horizontal and vertical operation circuits, and a digital-to-analog (D/A) converter for converting the digital image signal finally magnified in the horizontal and vertical direction back to analog image signal.
A principal object of the present invention is to achieve a fast and efficient way to zoom a digital image.
In accordance with the object of this invention a method to zoom a region of interest from a digital image has been achieved. Said method comprises the following steps: (1) define size and location of region of interest as part of source image, (2) calculate scale of conversion in x- and y-direction, (3) calculate number of rows of pixels of destination image according to scale of conversion desired in y-direction, (4) calculate number of pixels contained in a row of pixels of destination image according to scale of conversion desired in x-direction, (5) calculate color values of each pixel along the rows of pixels of the destination image by interpolation from nearest row of pixels of source image, and (6) display zoomed region of interest in destination image.
In accordance with the object of this invention another method to zoom a region of interest from a digital image has been achieved. Said method comprises the following steps: (1) define size and location of region of interest as part of source image, (2) calculate scale of conversion in x- and y-direction, (3) calculate number of columns of pixels of destination image according to scale of conversion desired in x-direction, (4) calculate number of pixels contained in a column of pixels of destination image according to scale of conversion desired in y-direction, (5) calculate color values of columns of pixels of destination image by interpolation from nearest column of pixels of source image, and (6) display zoomed region of interest in destination image.
In accordance with the object of this invention another method to zoom a region of interest from a digital image has been achieved. Said method comprises the following steps, first: (1) define size and location of region of interest as part of source image, (2) calculate scale of conversion in x- and y-direction, (3) calculate number of rows of pixels of destination image according to scale of conversion desired in y-direction, and (4) calculate number of pixels contained in a row of pixels of destination image according to scale of conversion desired in x-direction. Furthermore the method invented comprises the steps: (5) calculate x, y virtual starting point of destination pixel for each frame, (6) calculate virtual location of first destination pixel for new row in x-direction and interpolate new color values of color space of said first destination pixel from nearest source pixels located at nearest row of source pixels in y-direction, (7) calculate virtual position of next destination pixel in x-direction according to scale factor and interpolate new color values of color space used of said next pixel from nearest source pixels located at nearest row of source pixels in y-direction, (8) go to next step (8) if last destination pixel in x-direction has been reached otherwise go to step (6), (9) go to step (11) if last row of destination pixels has been reached otherwise go to next step (9), (10) calculate virtual location of next row in y-direction according to scale factor in y-direction and go to step (5), and (11) display zoomed region of interest in destination image.
In accordance with the object of this invention another method to zoom a region of interest from a digital image has been achieved. Said method comprises the following steps, first: (1) define size and location of region of interest as part of source image, (2) calculate scale of conversion in x- and y-direction, (3) calculate number of columns of pixels of destination image according to scale of conversion desired in x-direction, (4) calculate number of pixels contained in a column of pixels of destination image according to scale of conversion desired in y-direction, and (5) calculate x, y virtual starting point of destination pixel for each frame. Furthermore the method invented comprises the steps: (6) calculate virtual location of first destination pixel for new column in y-direction and interpolate new color values of color space of said first destination pixel from nearest source pixels located at nearest column of source pixels in x-direction, (7) calculate virtual position of next destination pixel in y-direction according to scale factor and interpolate new color values of color space used of said next pixel from nearest source pixels located at nearest column of source pixels in x-direction, (8) go to next step (8) if last destination pixel in y-direction has been reached otherwise go to step (6), (9) go to step (11) if last column of destination pixels has been reached otherwise go to next step (9), (10) calculate virtual location of next column in x-direction according to scale factor in x-direction and go to step (5), and (11) display zoomed region of interest in destination image.
In the accompanying drawings forming a material part of this description, there is shown:
The preferred embodiments disclose a novel method to zoom digital images. Said method is based on the methods to convert the resolution of digital images disclosed with U.S. patent application Ser. No. ______ docket number DS03-025, U.S. Ser. No. ______ filed ______ and assigned to the same assignee as the present invention. In order to be able to use said methods to convert the resolution for zooming the region of interest of the source image has to be defined prior to a change of resolution and the offsets have to be defined in a special way. The methods of the present invention apply to video images as well as to still images of a digital camera.
Other shapes than rectangles for the region of interest and for the destination image, e.g. circles, are possible as well. Using rectangles is the simplest way to achieve zooming.
The methods invented apply to video images as well to still images of a digital camera.
The flowchart of
Said methods describe a very fast and simple way to decrease or to increase the resolution of digital images and still maintain an acceptable quality of the images. In case of a decimation of the resolution of a digital image the method invented comprises a combination of using simultaneously two different procedures, first, a decimation filter, or interpolation, along one coordinate to calculate the color values of the destination pixels and, second, omitting some rows of source pixels along the other coordinate of an image according to the scale of conversion. In case of an increase of the resolution of a digital image the method invented comprises a similar combination of procedures, first, an interpolation of source pixels to calculate the color values of the increased number of destination pixels, second, an extrapolation of the color values of the destination pixels being very close to the edges of the destination image, and, third, a replication of rows of the destination image to gain additional rows of destination pixels according to the scale of enlargement.
Step 22 of the flowchart of
wherein XLE is the length of the region of interest, and XF is the fixed length of the destination image (as shown in
In case YUV color space is used luminance would be handled the same way as chrominance. Any polynomial of nth order could be used for interpolation, although order 0 (taking the color value of the nearest pixel) and order 1 (linear interpolation of the color values of the nearest two pixels) are the simplest polynomials to be used. In a preferred embodiment an interpolation of order 1 is used with the exception of pixels of the destination image having a virtual position between the first, or most left-sided, pixel of the nearest row of the source image and the left side edge of the image or correspondingly between the last, or most right-sided, pixel of the nearest row of the source image and the right-side edge of the image. For these “peripheral” pixels an interpolation of the order 0 is used, this means the first, or correspondingly, the last pixel of the nearest row of the source image is replicated.
In case of enlargement, neighboring pixels outside the region of interest can be used alternatively in order to enable an interpolation of order 1 for the peripheral pixels of the region of interest, thus achieving a better quality at the border of the destination image.
In the following step 306 the “virtual” position of the next destination pixel in x-direction of the current y-line according to the scale factor is calculated as described above, and the correspondent color values of all colors of the color space used are calculated by an interpolation of the correspondent color values of the nearest source pixels.
The next step 307 checks if the last pixel location in the current y-line of the destination imaged has been reached. In case the last pixel location has not been reached the process flow goes back to step 306 and the next “virtual” location is calculated and the correspondent color values are interpolated. In case the last destination location in x-direction has been reached the process flow goes to step 308. Step 308 checks if the last row in y-direction has been reached. In case the last row in y-direction has been reached the resolution of the source image has been successfully converted and the process flow goes to the last step 310. In case the last row in y-direction has not yet reached, the process flow goes to step 309 wherein the “virtual” position of the next row in y-direction of the destination image is calculated and then the process flow goes back to step 305 wherein the location of the first pixel of the new y-row of the destination image and the correspondent color values of said pixel line are calculated. Step 310 describes the display of the zoomed region of interest in the destination image.
It is obvious to those skilled in art that rows and columns could be interchanged as well. This means that the interpolation, described above could be performed also in y-direction from the nearest column of the source image.
While the invention has been particularly shown and described with reference to the preferred embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made without departing from the spirit and scope of the invention.
Number | Date | Country | Kind |
---|---|---|---|
04392014.9 | Mar 2004 | EP | regional |
This application is related to U.S. patent application Ser. No. ______ docket number DS03-025, U.S. Ser. No. ______ filed ______ and assigned to the same assignee as the present invention.