How can I enhance the image resolution?

Hi,
I use the "imread" command to read an image from the file. The result is a two-dimensional matrix with M rows and N columns. For example my image has M = 2505 and N = 2713 by default. But I would like to decide the number of sample in which the image will be divided. Is it possible to set the M and N values, which will represent the image?
Many thanks in advance,
Regards,
Elena

1 件のコメント

Patrik Ek
Patrik Ek 2014 年 7 月 28 日
There is some support for resampling in matlab. Eg resample it could be worth if the resolution is important

サインインしてコメントする。

 採用された回答

Joseph Cheng
Joseph Cheng 2014 年 7 月 28 日
編集済み: Joseph Cheng 2014 年 7 月 28 日

3 投票

Your question seems a bit confusing or misguided. You are saying you have 2505 by 2713 image file (lets just say *.bmp, *.jpg, *.tif, etc.)and you are trying to open it as a 5010 by 5426 as an example or magnification for enhancement? Then you would want to try imresize() that is used in the image processing toolbox.
I = imread('circuit.tif');
J = imresize(I,[100 150]);
imshow(I)
figure, imshow(J)
However you'll not get more data out of it for an enhancement of the resolution of the data. You'll have to take the image at a higher resolution. imresize will interpolate the data with different interpolation methods. in the documentation imresize will use the nearest neighbor interpolation to come up with the new image.

9 件のコメント

Image Analyst
Image Analyst 2014 年 7 月 28 日
You have your choice of interpolation methods, e.g. blinear, nearest neighbor, etc.
Joseph Cheng
Joseph Cheng 2014 年 7 月 28 日
thank you, when i was typing up my answer i accidentally left out that the nearest neighbor was the default.
John D'Errico
John D'Errico 2014 年 7 月 28 日
It is only in the movies (or tv shows) that they can take a blurry image, sharpen it a million times, then zoom in to sub-pixel resolution to read a license plate, recognize a face, or see a reflection in the person's eyeglasses. ROFLMAO
Joseph Cheng
Joseph Cheng 2014 年 7 月 28 日
Well the closest thing right now would be the lytro cameras. Are the lytro image files matlab compatible or part of the image processing toolbox? Would be neat to play around with that technology.
Image Analyst
Image Analyst 2014 年 7 月 28 日
Of course being able to get the image of the murderer off the biochemical imprint on the victim's retina is another movie image processing classic.
It sounds like Lytro technology will be in the new LG G3 and Nokia phones. http://www.mobilegeeks.com/ps-vita-tv-us-uk-lytro-android-camera-lg-g3-battery-life/
Joseph Cheng
Joseph Cheng 2014 年 7 月 28 日
編集済み: Joseph Cheng 2014 年 7 月 28 日
Actually i just bought the G3. From what i can gather from just listening to it take a picture in the lytro mode, is that it is stepping through different focuses. Then using something like edge detection, stitch together the different images into a lytro like picture. (ie depending on the ROI you select it shows you the image that has it in focus.)
Image Analyst
Image Analyst 2014 年 7 月 28 日
If it does it that way, that's not the same way as Lytro. Lytro uses microlenses over the pixels at the expense of lower resolution, while the method you're describing has a stack of images taken at different focal distances and it does something like deconvolution to either create one image in focus everywhere, or just picks one of the images from the stack to be "the one" image that you want. Lytro has one image, not a stack, and uses computational photography to create an image that is at focus at the specified distance. It's based on the fact that photons coming in from different focal planes hit the microlenses at different angles.
Joseph Cheng
Joseph Cheng 2014 年 7 月 28 日
Yup exactly, i don't think the G3 implemented it exactly like the Lytro is what i was saying.
Elena
Elena 2014 年 7 月 29 日
The command "imresize" solved my problem! Thank you very much!

サインインしてコメントする。

その他の回答 (1 件)

Ben11
Ben11 2014 年 7 月 28 日
編集済み: Ben11 2014 年 7 月 28 日

0 投票

Yes you can. You can select the range of pixels like this:
A = imread('peppers.png');
size(A) % get the size of your image, in your case its 2505x2713
ans =
384 512 3
B = A(100:300,200:400,:); % select the part of the image you want to display. Note that it does not increase the resolution though.
subplot(2,1,1);imshow(A);subplot(2,1,2);imshow(B)
Giving this:
Is this what you meant?

3 件のコメント

Elena
Elena 2014 年 7 月 28 日
Thanks for your answer, but for my application, I have to analyze the complete image, I cannot consider only a part.
So, I'm looking for some command to set, before that the image is imported, the number of rows and of columns.
Ben11
Ben11 2014 年 7 月 28 日
ok then I don't understand sorry. You want to analyze to complete image, but without actually using all the pixels?
Anindya Banerjee
Anindya Banerjee 2018 年 9 月 18 日
@ben11 can you please tell me how you assigned the numbers to select the parts to be displayed?? ( B = A(100:300,200:400,:) )

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by