1. A method comprising: projecting a pattern image on an object by a projector, the pattern image comprising one or more pattern elements; capturing an image of the object with the pattern image projected onto the object; extracting intensity values corresponding to at least two color components of each pixel of the captured image; generating a probability map for each color component using the corresponding extracted intensity values, the probability map for a color component representing a probability that a pixel of the captured image is representing a part of a pattern element; determining a joint probability distribution using the probability maps for the color components, the joint probability distribution representing a probability that a pixel of the captured image is representing part of any pattern element; locating specific pattern elements in the captured image using the joint probability distribution; and determining three dimensional coordinates representing points on surface of the object based, at least in part, on the location of the specific pattern elements.