downsampling an image without changing image content

5 ビュー (過去 30 日間)
nadia
nadia 2016 年 6 月 13 日
コメント済み: Image Analyst 2016 年 7 月 9 日
Hi, I want to down-sample an image and produce 2 images from it like stereo. suppose I have an image with size 1000X1000 and I want to produce 2 images with size 1000X500, each image should have the content of original image (right and left image) and it should not resize from only one direction. for example if an circle exist in original image after this downsampling the circle should be see in results(not oval).please help me. Is there any solution?thanks in advance.
  3 件のコメント
Image Analyst
Image Analyst 2016 年 6 月 15 日
It's not possible.
John D'Errico
John D'Errico 2016 年 6 月 15 日
編集済み: John D'Errico 2016 年 6 月 15 日
As long as pixels stay square, it is not gonna happen. Does Hogwarts Academy teach an image processing class? They may be able to do it.

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

回答 (1 件)

Chad Greene
Chad Greene 2016 年 6 月 16 日
If you have the Image Processing toolbox, check out imresize. Here's an example:
M = imread('cameraman.tif');
The cameraman image is 256x256, see:
size(M)
ans =
256 256
You can make two of the half-size images like this:
M2 = [imresize(M,0.5), imresize(M,0.5)];
size(M2)
ans =
128 256
See:
image(M2)
  6 件のコメント
nadia
nadia 2016 年 7 月 9 日
what's this? you copy the image twice?I want to have cammeraman with size 128X256 not two cammeramman together. I think wrong about your answer?
Image Analyst
Image Analyst 2016 年 7 月 9 日
Like John and I said, it's not possible. You can't have everything you want. You can have some of the things, but not all.
For example you can't make a 1000x1000 image into a 1000x500 image without losing "content from the original image" (unless you do something strange like convert from 8 bit to 16 bit and stack the "missing" information into the upper byte). Changing the size changes the content. Subsampling will lose information. Upsampling will make up information.
And you can't reduce the width by half, but not the height, without changing the aspect ratio.

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

カテゴリ

Help Center および File ExchangeImage Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by