Clear Filters
Clear Filters

combing dem and edge detected image

4 views (last 30 days)
sedigheh pagheh
sedigheh pagheh on 3 May 2022
Answered: Aishwarya on 11 Oct 2023
Hi everybody,
I want to combine a dem file (or slope) with an edge detected image? I want to identify some areas in edge detected image using dem or slope.
I think if I could combine them and add the elevation as a new band so that every pixel could have a elevation this problem could be solved but as I am new in matlab I do not know how can I do that.

Answers (1)

Aishwarya
Aishwarya on 11 Oct 2023
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:
Hope this helps!
Regards,
Aishwarya

Products


Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!