Code covered by the BSD License  

Highlights from
Increase Image Resolution

2.0

2.0 | 2 ratings Rate this file 76 Downloads (last 30 days) File Size: 1.96 KB File ID: #21410
image thumbnail

Increase Image Resolution

by Francisco de Castro

 

11 Sep 2008 (Updated 13 Sep 2010)

Increases the resolution of an image by interpolation

| Watch this File

File Information
Description

IIR Increases the resolution of an image by interpolation
B= IIR(inputfile,f) returns the image stored in file 'inputfile' with resolution increased by factor f in both dimensions. 'filename' must be a valid graphic file (jpg, gif, tiff, etc.). It can be grayscale or color.

Parameter 'f' is the size increase ratio, so to increase by 50%
use f= 1.5, to double size (in each dimension) use f= 2.

Additional parameters:
 B= IIR(A,f,'Display','off') eliminates display of both images, the original and the modified. Deafult 'on'

B= IIR(A,f,'Method',method) Allows to choose between five methods of interpolation: linear, spline, pchip, cubic or v5cubic. 'method' must be a string character. Default 'linear'

Example:
B= iir('myimage.jpg',2,'Method','cubic');

The screenshot shows the effect of increasing resolution by 3. Original size: 600x402. After: 2400x1608.
(I took the photo myself. No copyright problems).

MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (11)
07 Sep 2010 sheena k.

can this be implement on grayscale images?
currently im doing for grayscale images

07 Sep 2010 Francisco de Castro

The function works equally in grayscale as well as in color images.
Author

14 Sep 2010 Malcolm McLean

THis could be incorporated into my sequence logo program to scale the fonts (see my recent contribution). But for that I'd need it to work on arrays - presumably not a big change to the function.

15 Sep 2010 Cris Luengo

You cannot change the resolution of an image by interpolation. You'll change the sampling density, but not the resolution. Please get your terminology straight!

15 Sep 2010 Francisco de Castro

Malcolm:
When the image is read (with imread) it actually stores it as a 2 or 3 dimensional array, and the interpolation is done on that array. You may try to change the instruction where the image is read to make it suitable for your arrays, the rest of the code "should" work, although if the array representing the font is B&W (0 & 1) I'm not sure about the results.

15 Sep 2010 Francisco de Castro

Resolution (definition)
Webster: b : a measure of the [...] fineness with which a device [...] can produce or record an image, usually expressed as the total number or density of pixels in the image <a resolution of 1200 dots per inch>
Oxford English Dictionary: the process or capability of rendering distinguishable the component parts of an object or image; a measure of this, expressed [...] as the number of pixels that form an image.

Thus, given that the function changes the number of pixels in the image, according to Webster and OED, it changes its resolution.

On the other hand, the sampling density or sampling rate is the number of recorded samples (PiXels) per unit distance *when converting from an analog signal to digital*.

15 Sep 2010 Malcolm McLean

Cris: that's sort of true. You can't create information out of nowhere. However if I have a curve specified by several points, and the curve represents the true underlying data, I can improve the representation of the data by taking more points.

If you look at Fransisco's images, he's clearly improved the definition of the teeth. Unless he's cheating, the image quality has been improved.

15 Sep 2010 Francisco de Castro

Malcolm: Of course I'm not cheating (but I'm a bit offended, actually). Besides, it's not only the teeth, the whole image improves in definition (let's stay away from semantic subtleties). It can be appreciated best in all borders between light and dark areas (i.e. eye sockets). Anybody can try for himself: download the example image, crop the left part and use the function on it.

11 Oct 2010 Magnus

Hello,
This is a very nice function, but I need to increase resolution by different amounts in the x and y directions. For example I would like to be able to convert a 4:3 image to a 16:9 image. Is that possible with IIR?

11 Oct 2010 Francisco de Castro

Magnus: The short answer: no, IIR cannot do that. I don't have plans right now to introduce that, but you are welcome to try.

21 Aug 2011 dai zhengguo

The best way to increase the resolution of the image is a ill-posed problem. Please refer to the reconstruction methods for super-resolution image from single image only.

Please login to add a comment or rating.
Updates
12 Sep 2008

Better title

13 Sep 2010

IIR now reads the graphics file directly.
More interpolation methods added
Improved display of grayscale images

Tag Activity for this File
Tag Applied By Date/Time
enhancement Francisco de Castro 22 Oct 2008 10:18:54
image Francisco de Castro 22 Oct 2008 10:18:54
resolution Francisco de Castro 22 Oct 2008 10:18:54
pixel Francisco de Castro 22 Oct 2008 10:18:54
size Francisco de Castro 22 Oct 2008 10:18:54
dpi Francisco de Castro 22 Oct 2008 10:18:54
pp Francisco de Castro 22 Oct 2008 10:18:54
image processing Francisco de Castro 22 Oct 2008 10:18:54

Contact us at files@mathworks.com