Hello, im trying to create a 3 dimensional matrix to store
10 640x480 raster images. One set of these images i need
to apply thresholding to.
I first store the images into matrices the following way
ObjectImage(:,:,1) = imread('ImageA1.ras');
ObjectImage is 480,640 in row/column (mxn) size, ImageA1
is a raster image of resolution 640x480, and is purely
binary (255 or 0).
If i call imshow(ObjectImage(:,:,1)) OR image(ObjectImage
(:,:,1)), the picture is correctly displayed
Next, i do the same thing again for a different set of
raster images (same dimension as the above case) however
they are not purely binary
ObjectImage(:,:,1) = imread('ImageB1.ras');
If i call imshow(ObjectImage(:,:,1)) the picture is shown
incorrectly, alot of it is missing. If i call image
(ObjectImage(:,:,1)), the picture is correctly displayed.
Another problem is that i need to threshold each image
for i=1:10
level = graythresh(ObjectImage(:,:,i));
BW = im2bw (ObjectImage(:,:,i),level);
ObjectImage(:,:,i) = BW(:,:);
end;
Thresholding works normally if i dont store the images in
the matrix (ie: graythreshold('filename.ras'), however
when i do this and try to view the new images they are
completely black. What am i doing wrong here?
D Lee - 18 Jul 2008 19:04 GMT
update:
instead of thresholding the image after storing it in the
matrix, i reverse the process: threshold then convert to
matrix form.
Using the imshow() command now works on the former
grayscale image.
"D Lee" <op546ert@hotmail.com> wrote in message <g5pac3$94
$1@fred.mathworks.com>...
> Hello, im trying to create a 3 dimensional matrix to store
> 10 640x480 raster images. One set of these images i need
[quoted text clipped - 32 lines]
> when i do this and try to view the new images they are
> completely black. What am i doing wrong here?