1. A method of profiling a surface, comprising: projecting slit pattern light toward a target object in at least two directions in sequence to obtain pattern images reflected on the target object; obtaining heights by using the pattern images according to the directions; obtaining vector fields showing a direction of maximum variation of height; obtaining confidence indexes of the heights corresponding to the at least two directions; obtaining integrated vector fields by using the confidence indexes and the vector fields; and calculating height of each position of the target object by using the integrated vector fields.