Info
此问题已关闭。 请重新打开它进行编辑或回答。
How can I add a scale in pixels or even millimeters to an image?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(0 个)
此问题已关闭。
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!