NURBS curve extraction from an image
조회 수: 2 (최근 30일)
이전 댓글 표시
I am trying to extract the edge of an image and convert it to a NURBS curve. But it ended in vain. I am using NURBS toolbox for matlab. I am attaching the code i used below. The image i used is a simple circle image. Please help me out.
Code:
close all; clear all;
im=imread('im\1.bmp');
%imshow(im);
imBW=im2bw(im,.8);
%figure; imshow(imBW);
imE=edge(imBW);
imE=not(imE);
%figure; imshow(imE);
imSIZE=size(imE);
%NURB Curve Formation
imNRB=[];
KNT=[];
n=1;
tmp=[];
cnt=1;
Kcnt=1;
for i=1:imSIZE(1)
for j=1:imSIZE(2)
if imE(i,j) == 0
tmp=[tmp;i j];
if cnt == 2
imNRB(:,:,n)=tmp;
KNT{1,Kcnt}=[0 0 1 1];
n=n+1;
tmp=[];
cnt=0;
Kcnt=Kcnt+1;
end
cnt=cnt+1;
end
end
end
NRB=nrbmak(imNRB,KNT);
clear n;
nrbplot(NRB,[600 -600]);
And i have to attach this note. I am not well versed in NURBS.
Thank you :)
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!