How to write the coordinats from the dpsimplify function into a new data
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hi everyone I've got boundaries of an object. Now i'd like to simplify them with the dpsimlify(p,tol) funkction. This works great so far, i can plot it and it looks good. However when I want to write the coordinats of the simplified data into a datastring it doesn't work how I want it to work. I've got this so far:
for i = 1: length(B)
p = B{i};
tol = 3;
[ps,ix] = dpsimplify(p,tol);
plot(p(:,2),p(:,1),'k')
hold on
plot(ps(:,2),ps(:,1),'r','LineWidth',2);
legend('original polyline','simplified')
boundary(i).id = i;
boundary(i).X = ps(:,2);
boundary(i).Y = ps(:,1);
end;
When i do it like this, I get 2024 elements in the boundary data. but the length of B is just 68. Some of the elements of B are doubled in the boundary data . I hope you understand my problem and know how to fix it.
Cheers Sams
0 Commenti
Risposte (1)
Image Analyst
il 19 Mag 2014
I don't know what that function is. Perhaps you can use unique() to extract out only the unique rows.
0 Commenti
Vedere anche
Categorie
Scopri di più su Octave in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!