Email: helpdesk@telkomuniversity.ac.id

This Portal for internal use only!

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Categories
  • Microsoft
    • Microsoft Apps
    • Office
    • Operating System
    • VLS
    • Developer Tools
    • Productivity Tools
    • Database
    • AI + Machine Learning
    • Middleware System
    • Learning Services
    • Analytics
    • Networking
    • Compute
    • Security
    • Internet Of Things
  • Adobe
  • Matlab
  • Google
  • Visual Paradigm
  • WordPress
    • Plugin WP
    • Themes WP
  • Opensource
  • Others
More Categories Less Categories
  • Get Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • My Account
    • Download
    • Cart
    • Checkout
    • Login
  • About Us
    • Contact
    • Forum
    • Frequently Questions
    • Privacy Policy
  • Forum
    • News
      • Category
      • News Tag

iconTicket Service Desk

  • My Download
  • Checkout
Application Package Repository Telkom University
All Categories

All Categories

  • IBM
  • Visual Paradigm
  • Adobe
  • Google
  • Matlab
  • Microsoft
    • Microsoft Apps
    • Analytics
    • AI + Machine Learning
    • Compute
    • Database
    • Developer Tools
    • Internet Of Things
    • Learning Services
    • Middleware System
    • Networking
    • Operating System
    • Productivity Tools
    • Security
    • VLS
      • Office
      • Windows
  • Opensource
  • Wordpress
    • Plugin WP
    • Themes WP
  • Others

Search

0 Wishlist

Cart

Menu
  • Home
    • Download Application Package Repository Telkom University
    • Application Package Repository Telkom University
    • Download Official License Telkom University
    • Download Installer Application Pack
    • Product Category
    • Simple Product
    • Grouped Product
    • Variable Product
    • External Product
  • All Pack
    • Microsoft
      • Operating System
      • Productivity Tools
      • Developer Tools
      • Database
      • AI + Machine Learning
      • Middleware System
      • Networking
      • Compute
      • Security
      • Analytics
      • Internet Of Things
      • Learning Services
    • Microsoft Apps
      • VLS
    • Adobe
    • Matlab
    • WordPress
      • Themes WP
      • Plugin WP
    • Google
    • Opensource
    • Others
  • My account
    • Download
    • Get Pack
    • Cart
    • Checkout
  • News
    • Category
    • News Tag
  • Forum
  • About Us
    • Privacy Policy
    • Frequently Questions
    • Contact
Home/Matlab/Finding distance between centers of circles by manually selecting muliple pairs

Finding distance between centers of circles by manually selecting muliple pairs

PuTI / 2025-01-17
Finding distance between centers of circles by manually selecting muliple pairs
Matlab News

I am having trouble finding the correct distances from circle to circle. Is there a way to select manually which circles to measure the distances between? I would need to select multiple pairs and a circle can be in a pair more than once. Then be able to advance the program when finished. Not all circles are necessary to be selected. The circle finding itself works nicely.
I included the entire code. It grabs images from a file to analyze. Thank you.
directory = uigetdir;
files = dir(fullfile(directory, ‘*.bmp’));

for k = 1:length(files)
fileName = files(k).name;
fullFilePath = fullfile(directory, fileName);
fprintf(1, ‘Processing: %sn’, fullFilePath);
rgb = imread(fullFilePath);
rgb = imcrop(rgb,[950 0 400 750]);
rgb = rgb2hsv(rgb);
rgb = rgb(:,:,3);
rgb = imadjust(rgb, [0.1 0.85]);
%rgb = im2gray(rgb);
rgb = adapthisteq(rgb);
%crop

rgb = im2bw(rgb,0.3);
%binary conversion
imshow(rgb)

d = drawline;

pos = d.Position;
diffPos = diff(pos);
diameter = hypot(diffPos(1),diffPos(2))

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’,’Sensitivity’,0.8)

imshow(rgb)
h = viscircles(centers,radii);
[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8);

length(centers)
%
delete(h) % Delete previously drawn circles
h = viscircles(centers,radii);

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8,’Method’,’twostage’);

delete(h)
h = viscircles(centers,radii);

%hBright = viscircles(centersBright, radiiBright,’Color’,’b’);

h = viscircles(centers,radii);

pix = 0.00001030927835;
%calibration for pix to meter

Yp(:) = centers(:,2);
%need to do every other circle, This does distance between every one

distance = abs(diff(Yp))
%distance between center in pix

Ydiff = distance*pix
%distance between center in meters

v = 0.142082
% change this variable ‘v’ for every test run

frequency = Ydiff/v
% units 1/s

diameter = 0.00635;
% units m

Strouhal = (frequency * diameter) / v
%final strouhal number
endI am having trouble finding the correct distances from circle to circle. Is there a way to select manually which circles to measure the distances between? I would need to select multiple pairs and a circle can be in a pair more than once. Then be able to advance the program when finished. Not all circles are necessary to be selected. The circle finding itself works nicely.
I included the entire code. It grabs images from a file to analyze. Thank you.
directory = uigetdir;
files = dir(fullfile(directory, ‘*.bmp’));

for k = 1:length(files)
fileName = files(k).name;
fullFilePath = fullfile(directory, fileName);
fprintf(1, ‘Processing: %sn’, fullFilePath);
rgb = imread(fullFilePath);
rgb = imcrop(rgb,[950 0 400 750]);
rgb = rgb2hsv(rgb);
rgb = rgb(:,:,3);
rgb = imadjust(rgb, [0.1 0.85]);
%rgb = im2gray(rgb);
rgb = adapthisteq(rgb);
%crop

rgb = im2bw(rgb,0.3);
%binary conversion
imshow(rgb)

d = drawline;

pos = d.Position;
diffPos = diff(pos);
diameter = hypot(diffPos(1),diffPos(2))

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’,’Sensitivity’,0.8)

imshow(rgb)
h = viscircles(centers,radii);
[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8);

length(centers)
%
delete(h) % Delete previously drawn circles
h = viscircles(centers,radii);

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8,’Method’,’twostage’);

delete(h)
h = viscircles(centers,radii);

%hBright = viscircles(centersBright, radiiBright,’Color’,’b’);

h = viscircles(centers,radii);

pix = 0.00001030927835;
%calibration for pix to meter

Yp(:) = centers(:,2);
%need to do every other circle, This does distance between every one

distance = abs(diff(Yp))
%distance between center in pix

Ydiff = distance*pix
%distance between center in meters

v = 0.142082
% change this variable ‘v’ for every test run

frequency = Ydiff/v
% units 1/s

diameter = 0.00635;
% units m

Strouhal = (frequency * diameter) / v
%final strouhal number
end I am having trouble finding the correct distances from circle to circle. Is there a way to select manually which circles to measure the distances between? I would need to select multiple pairs and a circle can be in a pair more than once. Then be able to advance the program when finished. Not all circles are necessary to be selected. The circle finding itself works nicely.
I included the entire code. It grabs images from a file to analyze. Thank you.
directory = uigetdir;
files = dir(fullfile(directory, ‘*.bmp’));

for k = 1:length(files)
fileName = files(k).name;
fullFilePath = fullfile(directory, fileName);
fprintf(1, ‘Processing: %sn’, fullFilePath);
rgb = imread(fullFilePath);
rgb = imcrop(rgb,[950 0 400 750]);
rgb = rgb2hsv(rgb);
rgb = rgb(:,:,3);
rgb = imadjust(rgb, [0.1 0.85]);
%rgb = im2gray(rgb);
rgb = adapthisteq(rgb);
%crop

rgb = im2bw(rgb,0.3);
%binary conversion
imshow(rgb)

d = drawline;

pos = d.Position;
diffPos = diff(pos);
diameter = hypot(diffPos(1),diffPos(2))

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’,’Sensitivity’,0.8)

imshow(rgb)
h = viscircles(centers,radii);
[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8);

length(centers)
%
delete(h) % Delete previously drawn circles
h = viscircles(centers,radii);

[centers,radii] = imfindcircles(rgb,[10 400],’ObjectPolarity’,’dark’, …
‘Sensitivity’,0.8,’Method’,’twostage’);

delete(h)
h = viscircles(centers,radii);

%hBright = viscircles(centersBright, radiiBright,’Color’,’b’);

h = viscircles(centers,radii);

pix = 0.00001030927835;
%calibration for pix to meter

Yp(:) = centers(:,2);
%need to do every other circle, This does distance between every one

distance = abs(diff(Yp))
%distance between center in pix

Ydiff = distance*pix
%distance between center in meters

v = 0.142082
% change this variable ‘v’ for every test run

frequency = Ydiff/v
% units 1/s

diameter = 0.00635;
% units m

Strouhal = (frequency * diameter) / v
%final strouhal number
end image analysis MATLAB Answers — New Questions

​

Tags: matlab

Share this!

Related posts

How to debug C# .NET assembly called from MATLAB?
2025-05-15

How to debug C# .NET assembly called from MATLAB?

How do I set the size of a tile from tiledlayout?
2025-05-15

How do I set the size of a tile from tiledlayout?

Communicate with worker through client
2025-05-15

Communicate with worker through client

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Search

Categories

  • Matlab
  • Microsoft
  • News
  • Other
Application Package Repository Telkom University

Tags

matlab microsoft opensources
Application Package Download License

Application Package Download License

Adobe
Google for Education
IBM
Matlab
Microsoft
Wordpress
Visual Paradigm
Opensource

Sign Up For Newsletters

Be the First to Know. Sign up for newsletter today

Application Package Repository Telkom University

Portal Application Package Repository Telkom University, for internal use only, empower civitas academica in study and research.

Information

  • Telkom University
  • About Us
  • Contact
  • Forum Discussion
  • FAQ
  • Helpdesk Ticket

Contact Us

  • Ask: Any question please read FAQ
  • Mail: helpdesk@telkomuniversity.ac.id
  • Call: +62 823-1994-9941
  • WA: +62 823-1994-9943
  • Site: Gedung Panambulai. Jl. Telekomunikasi

Copyright © Telkom University. All Rights Reserved. ch

  • FAQ
  • Privacy Policy
  • Term

This Application Package for internal Telkom University only (students and employee). Chiers... Dismiss