It depends on the symbology of the image. If it is a raster image where colour represents altitude, this should be relatively straight forward. However, if it is a topographic map with contour lines, it will require much more work and probably the assistance of GIS software.
Following up with what Mr. Barrett said, if the image you are working with is say for example a gray-scale DICOM, then when Matlab loads the image it is stored in a matrix, where each element of the matrix represents the gray-scale color for a pixel. You could treat this matrix like a surface if the image color does in fact represent altitude. To visualize, load an image to a matrix, then plot using surf(imagematrix);