To get any good advice you'll want to attach code showing where in your code you are using ColorImage. Some basic advice, make sure you are deleting images that you are getting from the camera, and the images you get back from the threshold function.
Each time you get an image from the camera, and perform a threshold (producing a binary image) you'll be left with 1 color image and 1 binary image, if you don't store pointers to these objects and delete them when you are done with them, you will quickly eat up your memory and things will start failing.
This post has some more detailed info:
http://www.chiefdelphi.com/forums/sh...15&postcount=3
If this doesn't help you, please post your code.