Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

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

2 Ansichten (letzte 30 Tage)
PamunkeBoy
PamunkeBoy am 15 Jun. 2018
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
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)

Antworten (0)

Diese Frage ist geschlossen.

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by