Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

images in Matlab

Status
Not open for further replies.

MNS747

Aerospace
Jan 19, 2007
82
Hi I am new to Matlab and what i am trying to do is to import an image(jpg) and trying to plot contours on it. when i imported the image, its size says
640 320 3
which i dont understand what '3'means.
Also when i am trying to plot contours using
'contourf' it comes up with several types of errors.
Error says
1) function 'contourc' is not defined for values of class 'uint8'.
2) some times it says the image has to be two dimensional.

i want to ask what does this two dimensional means as far as i think the image is a 2D image. For my own sonfirmation I made a 4X5 matrix and plotted it with 'contourf' and it worked fine but when i am doing the same for an image it doesnt work and comes up with errors mentioned above.As I have mentioned i am new to this, is it possible for any one of you to explain what mistake i am doing.
i would appreciate if i get any answers to this.
Regards
 
Replies continue below

Recommended for you

The 3 is probably red, green, blue.

To use contourc, cast your data, e.g. double(data). My ML version doesn't like float(data), but it is quite old.


- Steve
 
Thanks Steve

That was a great help. Yes 3 is the depth of colours.
I will now try contourc.

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor