Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7732449
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T06:43:59+00:00 2026-06-01T06:43:59+00:00

I am reading in the matlab documentation that rgb2hsv will return an m-by-n-by-3 image

  • 0

I am reading in the matlab documentation that rgb2hsv will return an m-by-n-by-3 image array, yet when I call it, I get a 1-by-3 vector. Am I misunderstanding something?
Here is an sample code:

image_hsv = rgb2hsv('filepath')

and as output

image_hsv =

        0.7108    0.3696   92.0000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T06:44:00+00:00Added an answer on June 1, 2026 at 6:44 am

    You cannot call rgb2hsv on a filepath – it must be called on a MATLAB image matrix. Try:

    image_rgb = imread('filepath');  % load the image array to MATLAB workspace
    image_hsv = rgb2hsv(image_rgb);  % convert this array to hsv
    

    You can see these matrices with:

    >> whos image*  % display all variables whose name begins with 'image'
      Name             Size                 Bytes  Class     Attributes
    
      image_hsv      480x640x3            7372800  double              
      image_rgb      480x640x3             921600  uint8     
    

    What your original code was doing was converting your filepath string to ascii numbers, taking the first three values of this array as RGB values and converting these to HSV.

    NOTE: This example highlights dangers with MATLAB’s weak typing system, where data types are silently converted from one type to another. Also maybe a lack of correct input checking to the rgb2hsv function.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was reading that in MatLab, if you are going to fill a larger
Reading about the Dispose pattern , I see the documentation repeatedly refer to cleaning
Reading code from other posts, I'm seeing something like this. struct Foo { Foo()
I was reading about MATLAB and I'm so much curious on it. But I
I'm reading a string representing a date, yet it seem to ignore the input
I'm trying to do a mock-up in Matlab on some image data in a
I'm trying to use USGS DEMs in MATLAB but after reading it in with
I am creating a neural network using MATLAB (version specified in title). After reading
Hey so I have a bash command that echos a string based on reading
I'm trying to learn how to use the C API to reading Matlab .mat

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.