Info
Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.
how to load multiple files, find the centre of gravity of each of those polygons and finally get their average centre of gravity
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
clc
clear
close all
cd('C:\Users\ADMIN\Desktop\Sudev\Objective 2')
load('11-28-16roi.mat');
load('11-50-38roi.mat');
load('13-33-01roi.mat');
load('14-08-12roi.mat');
load('14-10-59roi.mat');
load('14-12-13roi.mat');
load('14-45-13roi.mat');
load('14-47-46roi.mat');
load('15-04-24roi.mat');
load('15-33-10roi.mat');
load('15-33-18roi.mat');
load('15-44-33roi.mat');
load('15-45-47roi.mat');
load('15-49-45roi.mat');
load('15-50-34roi.mat');
load('16-28-44roi.mat');
% x_poly=x_poly1
% y_poly=y_poly1;
% save 15-44-33roi x_poly y_poly
% figure(1); clf;
% subplot(1,2,1);
% imshow(paveikslas,[])
% paveikslas(1:200,1:200,:) = 0;
figure(1); clf;
% subplot(1,2,1);
% imshow(paveikslas,[])
% hold on
% plot(x_poly, y_poly,'r','LineWidth',2)
% title('Overlap of ROI on Bscan')
subplot(1,2,2);
plot(x_poly); hold on;
plot(y_poly,'-r');
title('Coordinates of ROI')
figure(2)
plot(x_poly, y_poly,'r','LineWidth',2)
axis equal
title('ROI to be calculated for Center and Axis')
hold on
[xc,yc] = polygoncentroid(x_poly,y_poly);
plot(xc, yc,'*b','LineWidth',4)
%save ROI2 x_poly y_poly paveikslas%.mat x_poly(1:401) x_poly(1:401) paveikslas
This is my code so far.... I would like an efficient method to go abou the whole thing using loops if possible
0 Kommentare
Antworten (0)
Diese Frage ist geschlossen.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!