Get subpixel resolution images of a high resolution image

19 views (last 30 days)
Shweta
Shweta on 12 Sep 2012
Hi What is the better method to get sub-pixel images /low resolution images from ahigh resolution image? For example:I have a 4000x3000 image I want to get sub-pixel images of this image to be 2000x 1500 ,1000x750 and so on... Thanks Shweta
  2 Comments
Image Analyst
Image Analyst on 13 Sep 2012
Yes, sub pixel resolution has a different meaning than I believe Shweta is using. See section 18.4.3 here: Subpixel Resolution. Usually it refers to getting increased "real-world" spatial resolution from the imagery. The number of pixels in the output image is unrelated to the resolution. I could get subpixel resolution over a small part of the input image,or the whole image, with some arbitrary number of pixels in the output image.

Sign in to comment.

Answers (6)

Image Analyst
Image Analyst on 12 Sep 2012
Use imcrop(), or just regular indexing:
subImage = fullImage(row1:row2, column1:column2);


Steffen B. Petersen
Steffen B. Petersen on 13 Sep 2012
You may try the standard function imresize - but this may not be as fast as you wish for. Alternatively, you may resample the two image dimensions using mesh grid and interp2. I am not quite sure what you mean with the phrase sub-pixel images.

David Lieberman
David Lieberman on 13 Sep 2012
In the examples you gave, the aspect ratio was the same as the original. Do not subsample. The output will likely suffer from aliaing artifacts. The function imresize mentioned above is the best way to go. It correctly low pass filters prior to subsampling, and does it optimally.

Shweta
Shweta on 24 Sep 2012
Hi subpixel resolution is based on averaging. From statistics we know that the standard deviation of the mean is smaller than the standard deviation of a single observation. I want to get subpixel resolution images.Does this clarify? Thanks Shweta
  2 Comments
Eric
Eric on 24 Sep 2012
Image Analyst is right - this answer does not clarify what you're looking for. In my answer below I assumed you don't know what you mean when you say "subpixel resolution" and based my answer on your statements that
1. you're looking for "low resolution images from a high resolution image"
2. you're looking for a solution based on "averaging"
My answer uses spatial averaging to convert a single high resolution image into a number of distinct, low-resolution images.
-Eric

Sign in to comment.


Eric
Eric on 24 Sep 2012
Here's what I would do. Assume img is your image.
kernel = ones(N,N)/N^2;%Try N = 2, 3, or 4
all_imgs = conv2(img, kernel, 'same');
new_img = all_imgs(1:N:end,1:N:end);
This gives you the equivalent of pixel binning - as if you programmed the detector to sum NxN pixels and report that as the image.
There are actually N^2 possible images in this set. Rather than
new_img = all_imgs(1:N:end,1:N:end);
You could use
new_img = all_imgs(2:N:end,1:N:end);
or
new_img = all_imgs(2:N:end,2:N:end);
etc.
Good luck,
Eric

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!