How to Overlap two maps extracted from two methods?

조회 수: 4 (최근 30일)
Amjad Iqbal
Amjad Iqbal 2022년 4월 21일
댓글: Amjad Iqbal 2022년 4월 22일
Dear MATLAB Experts,
I have a query to overlap two maps extracted from two methods. I have attached .mat file and maps obtained (map1.jpg, map2.jpg), and a reference image where two maps are overlapping.
I need to overlap them with different colors, as given in reference map given below.
Look forward to receive your guidence. Many thanks in advance.

채택된 답변

DGM
DGM 2022년 4월 22일
Depending on what your background image is and how you are going to locate the images atop each other, this may be a start:
load map1.mat
load map2.mat
% reduce the images to a simple binary mask
mask1 = 1-min(imadjust(extraction_fdc1,[0 0.95]),[],3);
mask2 = 1-min(imadjust(extraction_xy,[0 0.95]),[],3);
% create corresponding color fields
color1 = repmat(permute([0.5 0.2 1],[1 3 2]),size(mask1));
color2 = repmat(permute([1 0.2 0.5],[1 3 2]),size(mask2));
% say we have some sort of background image (a map or something)
BG = imread('cameraman.tif');
% display the background image, specifying the image location
imshow(BG,'xdata',[-100 100],'ydata',[-100 100])
hold on
% display the color overlays, specifying the image locations
% apply the masks as alpha
hi = imshow(color1,'xdata',[-100 100],'ydata',[-100 100]);
hi.AlphaData = mask1;
hi = imshow(color2,'xdata',[-100 100],'ydata',[-100 100]);
hi.AlphaData = mask2;
  댓글 수: 1
Amjad Iqbal
Amjad Iqbal 2022년 4월 22일
Perfect @DGM Many thanks for kind guidence. It works accordingly. Much Appreciated.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Convert Image Type에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by