Save object's boundary as coordinate arrays.

조회 수: 2 (최근 30일)
yaswanth pushpak
yaswanth pushpak 2017년 5월 26일
댓글: yaswanth pushpak 2017년 5월 28일
I have traced an image boundary and I need to save it as coordinate arrays. Actually I'm working on thermal image where I first extracted only the red component of the RGB image and then to black and white image then I have done morphological closing on it and obtained object's boundary.Actually I'm confused abt how to get boundary then I found it here and I have to save it in coordinate arrays.Thanks for your help in advance. My code looks like this
a = imread('D:\New folder (5)\New folder (5)\VID-20170522-WA0021 (5-23-2017 3-45-10 PM)\yash.jpg');
a_red=a;
a_green=a;
a_blue=a;
a_red(:,:,2)=0;
a_red(:,:,3)=0;
BW = im2bw(a_red, 0.2);
se=strel('disk',10);
closeBW=imclose(BW,se);
[B,L] = bwboundaries(closeBW,'noholes');
c=label2rgb(L, @jet, [.5 .5 .5]);
imshow(c);
hold on
for k = 1:length(B)
boundary = B{k};
plot(boundary(:,2), boundary(:,1), 'w', 'LineWidth', 2)
end
  댓글 수: 3
yaswanth pushpak
yaswanth pushpak 2017년 5월 28일
yaswanth pushpak
yaswanth pushpak 2017년 5월 28일
I've attached the thermal image and I need to detect the face.Thanks for ur help in advance.

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

답변 (1개)

MathReallyWorks
MathReallyWorks 2017년 5월 26일
Hello yaswanth,
As you have not shared how you have traced object boundary, it is a bit difficult to answer you question efficiently.
Anyways, I can tell you a simple approach to do this task.
Convert your image to grayscale and pass it to a high pass filter. This will remove all points except the boundary of object.
Then use
C=corner(I); %I is modified image
It will store all the corner points in an array C.
  댓글 수: 1
yaswanth pushpak
yaswanth pushpak 2017년 5월 26일
Actually I'm working on thermal image where I first extracted only the red component of the RGB image and then to black and white image then I have done morphological closing on it and obtained object's boundary.Actually I'm confused abt how to get boundary then I found it here and I have to save it in coordinate arrays.Thanks for your help in advance

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

Community Treasure Hunt

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

Start Hunting!

Translated by