Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab doubt about imread function

Status
Not open for further replies.

abhigopal

Member level 3
Joined
Dec 21, 2004
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
624
Hi,

I used the imread function to read an image matrix of size 256 X 256. The image matrix was easily displayed. But when I wanted to perform some operations to this image, it gave me an error saying that the data type was a uint8 - unsigned 8 bit integer. So i converted everything to double and it worked ok. Now, the resulting matrix after all my operations performed is of double type. When i use imview to view the image, I am getting a plain white image. If i convert it back to unsigned integer, then i am getting all values of my matrix as 255 and hence no image.
What do I do?? Are there some other functions that can be used??
Thanks
Abhi
 

matlab doubt!!!

Sounds like a scaling or offset problem. Examine the arrays after each step to find where things are going wrong. If you are still stuck, show us a small example code that demonstrates the problem.
 

matlab doubt!!!

Ok, Echo47
My input image is lenna.gif which is a 2565 X 256 matrix. At first, I did not realise tht it would cause problems. This is in the formed of Unsigned 8 bit integer (Uint8). Later, I added tht second line and it seemed to work fine.
I do some operations and end up with another matrix of the same order. Actually, I have to retrieve the image from this matrix. This matrix is understandably of the form double. I cant retireve and image with this by using imview('matrixname');

This is my problem

Thanks

Code

in1=imread('lenna.gif');
indou=double(in1);
 

matlab doubt!!!

My MATLAB says imview is obsolete and gives no documentation, but IIRC its grayscale values for double must be 0.0 through 1.0, so try this:

in1=imread('lenna.gif');
indou=double(in1);
imview(indou/255);

or convert indou back to uint8 before calling imview.

Please don't process Lenna too much. She's just fine the way she is. ;)
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top