NURBS curve extraction from an image
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!