How to map two different gray pattern in two images?

1 回表示 (過去 30 日間)
Anu Gupta
Anu Gupta 2020 年 2 月 13 日
コメント済み: KSSV 2020 年 2 月 13 日
I have two images temp1.jpg and temp2.jpg. Both images have some large gray collor pattern. I want to make boundary around each pattern and map pattern in temp1 with patten in temp2
  1 件のコメント
Anu Gupta
Anu Gupta 2020 年 2 月 13 日
I know how to use bwconncomp to find out different connected patterns in a image. But dont know how to make boundary around it and map it with other same kind of image.

サインインしてコメントする。

回答 (1 件)

KSSV
KSSV 2020 年 2 月 13 日
You can make boundary as below:
I = imread('temp1.jpg') ;
[nx,ny,nz] = size(I) ;
[X,Y] = meshgrid(1:ny,1:nx) ;
id = I~=255 ;
x = X(id) ; y = Y(id) ;
idx = boundary(x,y) ;
imshow(I)
hold on
plot(x(idx),y(idx),'r')
  2 件のコメント
Anu Gupta
Anu Gupta 2020 年 2 月 13 日
Thank you KSSV for your reply.
I used the code you shared but it includes all the patterns inside the boundary. Also, the pattern is not closed around the shape. However, I want a closed shape around Large pattern only. Also, I want to note the position of these patterns in each image.
KSSV
KSSV 2020 年 2 月 13 日
You have positions in your hand already.....(x,y) are the positions.

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by