I have an image on mat-lab and i would like to analyze the intensity of the light in the image. I want to do some kind of 3-D plot so i can see it clearly and get from it the average of the intensity and other stuff. Can someone tell me what command should i use and how? my knowledge on mat-lab is very poor. I have tried to do a surf plot but it keeps telling me "Warning: CData must be double or single unless it is used only as a texture data " and i don't know how to change the type or what can i do to overcome this problem.
Asked
Active
Viewed 227 times
1 Answers
1
Convert your image from uint8
to double
type. This way you'll be able to do more operations on Matlab in a more flexible way:
>> doubleImg = im2double( uint8Img );
Alternatively (if you do not have image processing toolbox):
>> doubleImg = double( uint8Img ) / 255.0 ;

Shai
- 111,146
- 38
- 238
- 371
-
My image is uint16, and i don't have image processing toolbox. – Maayan Sep 01 '13 at 11:34
-
@Maayan then `doubleImg = double( uint16Img ) / ( -1 + 2^16 )` should do the trick for you. Shana Tova. – Shai Sep 01 '13 at 11:42
-
I turn it into double but the surf function isn't good in my case. Do you have any idea what function i can use so i will be able to see in a plot the different intensities in my image? – Maayan Sep 01 '13 at 11:51
-
by the way thanks for the help and shana tova! – Maayan Sep 01 '13 at 11:52
-
@Maayan it is unclear what exactly you are looking for. What's wrong with `imagesc` and `impixelinfo`? what exactly is your problem? – Shai Sep 01 '13 at 11:57
-
I didn't know these functions before.I think that they can help me, thank you. – Maayan Sep 04 '13 at 06:03