Display a matrix as an image with boundaries(borders) between different components

조회 수: 14 (최근 30일)
HG
HG 2021년 6월 3일
댓글: HG 2021년 6월 7일
I have a matrix like the first image that changes with each step.
To display this matrix as an image, the imagesc or other commands only displays as a color image, but I want the boundaries(borders) to be displayed automatically as well, because this matrix changes at every step, and if the borders are not detected automatically, it will be useless.
1- Please help me how I can display this matrix with its boundaaries (borders) automatically like the following images with and without color ?

답변 (1개)

KSSV
KSSV 2021년 6월 3일
  댓글 수: 3
HG
HG 2021년 6월 7일
S=[1 1 1 1 5 5 5 5 5 5;
1 1 1 1 1 5 5 5 5 5;
1 1 1 1 1 5 5 5 5 5;
1 1 1 1 5 5 5 5 2 2;
1 1 1 1 5 5 5 2 2 2;
1 1 1 4 4 5 2 2 2 2;
4 4 4 4 4 4 2 2 2 2;
4 4 4 4 4 2 2 2 2 2;
4 4 4 4 4 2 2 2 2 2;
4 4 4 4 4 2 2 2 2 2];

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

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by