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

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 ]
Calumnist

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$1@newscl01ah.mathworks.com>...
> "ujjwal " <ujjwalkotdiya@gmail.com> wrote in message <jj6sr3$iv9$1@newscl01ah.mathworks.com>...
> > 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-2017. All Rights Reserved.