convert grayscale image to false color / pseudocolor

asked 2016-04-13 22:46:23 -0600

stephan gravatar image


I want to convert the depth-images from a kinect (640x480px, 256 grayscales) to 256 colors (i.E. from red to blue). I tried to use the ColorMap, but it does not work. Maybe I do it wrong.

Have someone a idea?

This is the code:

from SimpleCV import Kinect, Display, Image, Color, ColorMap

kin = Kinect()
win = Display()

#cm = ColorMap(startcolor = Color.RED, endcolor = Color.BLUE, startmap = 0, endmap = 1)

while not win.isDone():

    depth = kin.getDepth()    

    #convert depth to depth_color with ColorMap or on an other way. How?
edit retag flag offensive close merge delete