How to write the coordinats from the dpsimplify function into a new data
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Image Analyst
2014년 5월 19일
I don't know what that function is. Perhaps you can use unique() to extract out only the unique rows.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Octave에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!