| | |
quantisation of image colours
![]() |
•
•
Join Date: Nov 2008
Posts: 4
Reputation:
Solved Threads: 0
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
hope someone can help.
regardes
ash
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.
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
•
•
Join Date: Nov 2008
Posts: 4
Reputation:
Solved Threads: 0
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
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.
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.
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
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.
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.
~~~~~~~~~~~~~~~~~~
Looking for an exciting graduate degree? Robotics and Intelligent Autonomous Systems (RIAS) at SDSM&T See the program brochure here.
![]() |
Other Threads in the C++ Forum
- Previous Thread: Graph help please
- Next Thread: Old Borland C++ compiler
| Thread Tools | Search this Thread |
ada api apic++ array backup based binary bitmap c++ c/c++ char class classes code coding compile console conversion count declarations delete deploy desktop developer directshow dll download dynamic dynamiccharacterarray email encryption error file fileread forms frequency fstream function functions game givemetehcodez graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker list loop looping loops map math matrix memory multiple news node output parameter pointer problem program programming project python random read reallocatingmemory recursion reference rpg set string strings symbian temperature template test text text-file tree url variable vector video visual web win32 windows winsock wordfrequency wxwidgets






