Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

images in Matlab

images in Matlab

images in Matlab

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.

RE: images in Matlab

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

RE: images in Matlab

Thanks Steve

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


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close