Get subpixel resolution images of a high resolution image
12 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
Steffen B. Petersen
2012 年 9 月 13 日
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.
Image Analyst
2012 年 9 月 13 日
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.
回答 (6 件)
Image Analyst
2012 年 9 月 12 日
Use imcrop(), or just regular indexing:
subImage = fullImage(row1:row2, column1:column2);
0 件のコメント
Steffen B. Petersen
2012 年 9 月 13 日
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.
0 件のコメント
David Lieberman
2012 年 9 月 13 日
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.
0 件のコメント
Shweta
2012 年 9 月 24 日
2 件のコメント
Image Analyst
2012 年 9 月 24 日
No it doesn't. All it clarifies is that you aren't really familiar with subpixel resolution. What I and all the others believe you're asking for is simple 2D interpolation - getting more samples in between your existing pixels. This only increases resolution according to the computer user's definition of resolution, which is essentially the number of rows and columns in the image matrix. It does not increase actual true spatial resolution according to an optical scientist (like me) definition. You are no better able to resolve very small details in your scene just because you interpolate more pixels. There are things you can do to get better resolution, like use very small actuators to nudge your CCD sensor fractions of a pixel, or some spatial filters.
Eric
2012 年 9 月 24 日
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
Eric
2012 年 9 月 24 日
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Lighting, Transparency, and Shading についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!