View Full Version : selecting a pixel from an image and extracting info
04-05-2002, 12:59 AM
how can i select a pixel from an image in openGL, thru mouse clik and then extract information abt the pixel, like its brightness,color etc...
Use glReadPixels to read the pixel value from a given position.
04-08-2002, 12:17 AM
so,when we use glReadpixels..how do we retrieve the info when we need it later ?? willya pls clarify ?? thanx
Not sure I get what you mean. You want to get the pixel value and save it for later use?
04-08-2002, 06:58 AM
You can use glReadPixels to return the RGBA values from the colour buffer. How you infer brightness, etc is up to you. If I'm correct about the documentation each colour component is shifted and packed with the other values so that they fit in one value. Value could be 16 bit, 32 bit etc. I think you have to specify it.
04-17-2002, 02:56 AM
well,once i get a pixel's color information, i need to find all its neighbouring pixels with a similar color value (ie) more or less of the same color.
so,how can i do this...can anyone suggest me a way pls...
this has to go like a chain reaction,in the sense that all neighbouring pixels of similar color values are to be found one level after another.
04-17-2002, 03:14 AM
You want a grass fire algorithm, I am assuming this is for some kind of segmentation? Just recursively checks its 8 connected neighbours or whatever filter you are using..
04-17-2002, 09:59 PM
sorry, Im not exactly sure what a grass fire algorithm does,but then my problem requires me to check for similarity in color between the pixel chosen and its eight immediate neighbour pixels.once few of the eight pixels are found similar,the program should proceed to checking the eight neighbours of each of these similar pixels.It goes on recursively checking the whole image.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.