필터 지우기
필터 지우기

combing dem and edge detected image

조회 수: 4 (최근 30일)
sedigheh pagheh
sedigheh pagheh 2022년 5월 3일
답변: Aishwarya 2023년 10월 11일
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.

답변 (1개)

Aishwarya
Aishwarya 2023년 10월 11일
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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by