Info

この質問は閉じられています。 編集または回答するには再度開いてください。

How can I add a scale in pixels or even millimeters to an image?

1 回表示 (過去 30 日間)
PamunkeBoy
PamunkeBoy 2018 年 6 月 15 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
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 件)

製品


リリース

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by