Info
Cette question est clôturée. Rouvrir pour modifier ou répondre.
How can I add a scale in pixels or even millimeters to an image?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I received tremendous help on a code to find the centroid of dots on a rubber band. However, I am no trying to focus on adding a scale to my image. Preferably, is there a way I could add a scale of the pixels on the photo ( one with centroids) and then convert pixels to millimeters? This will help us see the stretch of the dots over time. Thank you!
%% Centroid
clear,clc
% Get the image im=imread('fourdots_V.bmp'); im=max(im,[],3);
% Segment blobs bw=imclose(im<6,strel('disk',5)); % Cenroids of individual blobs RP=regionprops(bw,'Centroid'); N=numel(RP); C=zeros(N,2); for i=1:N, C(i,:)=RP(i).Centroid; end
% Centroid of all blobs C_net=regionprops(double(bw),'Centroid'); C_net=C_net.Centroid; figure imshow(bw) hold on plot(C(:,1),C(:,2),'or','MarkerSize',10,'LineWidth',2) plot(C_net(:,1),C_net(:,2),'*g','MarkerSize',10,'LineWidth',2)


0 commentaires
Réponses (0)
Cette question est clôturée.
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!