1. A method, comprising: generating a pattern of symbols to project, said pattern including an array of symbols having a number of symbol columns and a number of symbol rows; obtaining an image from a camera; decoding said image, generating a decoded pattern of symbols comprising an array having said number of symbol columns and number of symbol rows, the decoding including: defining an array of classification windows of said image, wherein said array of classification windows has said number of symbol columns and number of symbol rows; determining a displacement of each classification window based on a cost function; and generating said decoded pattern by determining a respective symbol for each classification window; and generating a depth map as a function of said pattern of symbols to project and said decoded pattern.