Effacer les filtres
Effacer les filtres

Marking a footprint with a peak pressure box

3 vues (au cours des 30 derniers jours)
Denni Purcell
Denni Purcell le 4 Avr 2016
I am using a Matlab code to produce footprint and stance data. I would like to be able to mark the point of peak pressure using a small black box. This needs to be implemented throughout the code so that this image:
and other outputs Can have this box:

Réponses (1)

Image Analyst
Image Analyst le 5 Avr 2016
To find the bounding box
[rows, columns] = find(pressureImage > 0);
topRow = min(rows);
bottomRow = max(rows);
leftColumn = min(columns);
rightColumn = max(columns);
% Make box coordinates.
xBox = [leftColumn , rightColumn , rightColumn , leftColumn , leftColumn];
yBox = [topRow , topRow , bottomRow , bottomRow , topRow ]
% Draw the box with green lines.
plot(xBox, yBox, 'g-', 'LineWidth', 2);
This is intended to work on the gray scale image, and the 0 is whatever pressure shows up as white in your pseudocolored image.
To find the row(s) and columns(s) of the max pressure:
% Determine the max pressure value:
maxPressure = max(pressureImage(:));
% Find what rows and columns in the image have that value:
[rowOfMax, colOfMax] = find(pressureImage == maxPressure);
% Plot a black square around it:
plot(colOfMax, rowOfMax, 'ks', 'MarkerSize', 8, 'LineWidth', 2);

Community Treasure Hunt

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

Start Hunting!

Translated by