How can I convert a patch generated from patch() to a Matlab image that I can use using detectFASTFeatures()?
이전 댓글 표시
Want to do some image matching from cells generated using voronoi() or voronoin(). These functions return vertices that can be further converted into image objects for instance:
x = linspace(1,10,20);
s = rng(345, 'twister');
y = 10*rand(1,20);
[v,c] = voronoin([x(:) y(:)]);
h = [];
for i = 1:length(c)
if all(c{i}~=1) % If at least one of the indices is 1,
% then it is an open region and we can't
% patch that.
h(end+1) = patch(v(c{i},1),v(c{i},2),i); % use color i.
end
end
I then have an image handle for the patch object (h). Each h(i) probably can be renderered into a bitmap or matlab image which I then can use to match the polygon into the voronoi diagram using detectFASTFeatures(). However, I cannot find an *obvious * way to do this.
Could someone point me in the right direction?
답변 (1개)
Walter Roberson
2013년 3월 14일
1 개 추천
Instead of patch() you could use poly2mask() with the coordinates you are sending to patch()
카테고리
도움말 센터 및 File Exchange에서 Convert Image Type에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!