The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: how to find unique RGB color present in image
Replies: 8   Last Post: Sep 27, 2012 12:06 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 554
Registered: 12/11/04
Re: how to find unique RGB color present in image
Posted: Sep 27, 2012 12:06 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

"Liam" wrote in message <k41tdn$l5q$>...
> "ujjwal " <> wrote in message <jj6sr3$iv9$>...
> > i want to know how many unique RGB color are present in image
> > and what are there RGB value and how to store them .

just had the same problem myself, and found this solution to be best:

rgbIm = imread(image_path); % Get RGB image
I_v=reshape(rgbIm ,size(rgbIm,1) * size(rgbIm ,2),3); % reshape it
num_unique_rgb_vals = size(unique(I_v,'rows'),1); % Find number of unique RGB values

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.