How can I convert a patch generated from patch() to a Matlab image that I can use using detectFASTFeatures()?
Mostrar comentarios más antiguos
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?
Respuestas (1)
Walter Roberson
el 14 de Mzo. de 2013
1 voto
Instead of patch() you could use poly2mask() with the coordinates you are sending to patch()
Categorías
Más información sobre Convert Image Type en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!