quantisation of image colours

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Nov 2008
Posts: 4
Reputation: ashbrenner is an unknown quantity at this point 
Solved Threads: 0
ashbrenner ashbrenner is offline Offline
Newbie Poster

quantisation of image colours

 
0
  #1
Nov 11th, 2008
hi i have an image which i can get RGB values, i have to quantitize it , a new to this i think i know the principle but need a few pointers as to how to go about "mapping" the image to a range of colours. basically i am doing a grey scale whic works but on colours not black thru to white it is greying only slightly. so i need to reduce the colour values.
hope someone can help.

regardes

ash
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1,673
Reputation: vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold 
Solved Threads: 193
vmanes's Avatar
vmanes vmanes is offline Offline
Posting Virtuoso

Re: quantisation of image colours

 
0
  #2
Nov 11th, 2008
I think you need to state your problem a little more clearly for us. Are you trying to reduce the number of colors in a color image, or are you trying to convert a color image to greyscale? Or something else?
"We Americans got so tired of being thought of as dumb by the rest of the world that we went to the polls last November and removed all doubt."
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: ashbrenner is an unknown quantity at this point 
Solved Threads: 0
ashbrenner ashbrenner is offline Offline
Newbie Poster

Re: quantisation of image colours

 
0
  #3
Nov 11th, 2008
hi sorry about late reply, am trying to reduce the colours. i have whittled it down to performing something called a median cut. but unsure as to how to start . ie i need to first section the whole image and then break down the image into clusters of fewer colours. i think i know the principle but unsure of how to section etc..hope this helps explain. basically it works but colours are to many. thnx
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: ashbrenner is an unknown quantity at this point 
Solved Threads: 0
ashbrenner ashbrenner is offline Offline
Newbie Poster

Re: quantisation of image colours

 
0
  #4
Nov 12th, 2008
the source image is a fixed palet of eight squares of different colours red, yellow, green orange etc, the code works fine on the black thru to grey and white , but not on the colours.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1,673
Reputation: vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold 
Solved Threads: 193
vmanes's Avatar
vmanes vmanes is offline Offline
Posting Virtuoso

Re: quantisation of image colours

 
1
  #5
Nov 12th, 2008
This is not a trivial algorithm to implement. I'm familiar with it in general terms, and you can find some sample implementations to give you an idea of where to go.

The idea is not to segment the image, but to segment the color values found in it. Then replace the colors at each pixel with the palette color that it maps to in the color segmentations.
"We Americans got so tired of being thought of as dumb by the rest of the world that we went to the polls last November and removed all doubt."
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
Reply With Quote Quick reply to this message  
Join Date: Nov 2008
Posts: 4
Reputation: ashbrenner is an unknown quantity at this point 
Solved Threads: 0
ashbrenner ashbrenner is offline Offline
Newbie Poster

Re: quantisation of image colours

 
0
  #6
Nov 12th, 2008
ok..do you mean something like the following.

if RGB values fall into a certain value range.
then make them a pre-defined values.

ie red is R=255, G=0, B=0. so if a pixel in the image has same values +or - a tolerance such as 20, then make that pixel same as red.
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 1,673
Reputation: vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold vmanes is a splendid one to behold 
Solved Threads: 193
vmanes's Avatar
vmanes vmanes is offline Offline
Posting Virtuoso

Re: quantisation of image colours

 
0
  #7
Nov 12th, 2008
Kind of sort of. The final step would be something like that, but it's a long way to get there.

Here's my understanding of the basis of Median Cut. First find what colors exist in the image, essentially a 3D histogram. Find the plane that divides the unique color triplets in half, making two boxes with equal number of colors. Divide each of those boxes at the plane (not necessarily the same in each box) that cuts the number of colors in each of the now 4 boxes to equal numbers. Keep dividing till you have the number of boxes representing the desired number of colors in the target palette. Find the median color in each box - these will be your palette colors. Then map each color in the image to that median color in the box in which the image color exists.
"We Americans got so tired of being thought of as dumb by the rest of the world that we went to the polls last November and removed all doubt."
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC