Hi Sedigheh,
I understand you want to combine elevation data from DEM file and edge detected image so that elevation data is available at each pixel of image. One approach could be to add elevation as another dimension to the image.
Below I have provided an example implementation for the same.
% Read the DEM file and the edge detected image
[A,R, cmap] = readgeoraster('boston.dem');
img = imread("edge_detection.jpg");
% Elevation at each point
elevation_data = A;
% Resize image to match size of elevation_data
img_resized = imresize(img, size(elevation_data));
% Concatenate image and elevation data along new dimension
image_with_elevation = cat(3, img, elevation_data);
Please refer to the following link for more information:
- MATLAB documentation of “readgeoraster’ function: https://www.mathworks.com/help/map/ref/readgeoraster.html#d126e146620
Hope this helps!
Regards,
Aishwarya