reducing the size of image

i have a code for corner detection
i = imread('door.jpg');
%Make image greyscale
if length(size(i)) == 3
im = double(i(:,:,2));
else
im = double(i);
end
cs = fast_corner_detect_9(im, 30);
size(im)
im1=imresize(im,.5);
cs1 = fast_corner_detect_9(im1, 30);
image(im/6)
axis image
colormap(gray)
hold on
axis off
plot(cs(:,1), cs(:,2), 'r.'),title('Corner Detection')
figure,imshow(uint8(im)),title('Original Image ')
the size of image is 272x185
i have reseized the image using
imresize(im,.5)
but the reseized image is not displaying,plz help to display both images

Answers (2)

Jan
Jan on 8 Feb 2012
I guess, that the conversion by uint8 let all information disappear. Please try this:
imshow(uint8(im * 255))
or
imshow(im)

1 Comment

Jan i think u did not understand my question
for my code
plot(cs(:,1), cs(:,2), 'r.'),title('Corner Detection')
for reseized image,the image is not displaying

Sign in to comment.

Instead of
image(im/6)
Try this:
imshow(im1, []);
The problem was that your resized image was called im1 and you never passed that to imshow().

4 Comments

i = imread('door.jpg');
%Make image greyscale
if length(size(i)) == 3
im = double(i(:,:,2));
else
im = double(i);
end
cs = fast_corner_detect_9(im, 30);
size(im)
im1=imresize(im,.5);
cs1 = fast_corner_detect_9(im1, 30);
image(im1/6)
axis image
colormap(gray)
hold on
axis off
plot(cs(:,1), cs(:,2), 'r.'),title('Corner Detection')
plot(cs1(:,1), cs1(:,2), 'r.'),title('Corner Detection1')
figure,imshow(uint8(im)),title('Original Image ')
this ismy code ,i have passed im,im1,but both the imageas are not displayed
and Image analyst and i alaso want to draw a bounding box for this output image ,plz help
Did you post your image to tinypic.com so people can try your code? I do not have fast_corner_detect_9() either.
http://www.mathworks.com/matlabcentral/fileexchange/13006-fast-corner-detector

Sign in to comment.

Asked:

on 8 Feb 2012

Edited:

on 5 Oct 2013

Community Treasure Hunt

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

Start Hunting!