Info
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
How can I add a scale in pixels or even millimeters to an image?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191292/image.bmp)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/191293/image.jpeg)
0 comentarios
Respuestas (0)
La pregunta está cerrada.
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!