フィルターのクリア

Marking a footprint with a peak pressure box

3 ビュー (過去 30 日間)
Denni Purcell
Denni Purcell 2016 年 4 月 4 日
回答済み: Image Analyst 2016 年 4 月 5 日
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:

回答 (1 件)

Image Analyst
Image Analyst 2016 年 4 月 5 日
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