Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
Mathematics
General TopicsResearchOperations ResearchStatisticsMathematical LogicNumerical AnalysisUndergraduate MathAlgebra HelpRecreational Math
Math Software
MapleMathematicaMATLABScilabSASSPSS

Math Forum / Math Software / MATLAB / July 2008



Tip: Looking for answers? Try searching our database.

raster images and imshow(), image() problems

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
D Lee - 18 Jul 2008 06:40 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.