Detection of Pressure Points Over a MATRIX.

2 views (last 30 days)
HELLO Guys, Please Help me in this problem statement of Detecting the number of Peaks formed over the Matrix of Data. Consider the Matrix of Data extracted from the Array of sensors fitted on the rectangular sheet. Matrix
A=[101 123 133; 222 232 214; 890 899 890; 890 898 821;233 201 200; 122 234 143; 101 123 133; 455 544 434; 788 989 801; 122 123 111;100 111 100]
If we visualize the matrix we can observe Two points where the Pressure is being applied. Like this i want to answer where i can detect the Number of pressure points that are formed over the Matrix of Data. A Three point Pressure data Matrix
B=[222 232 214; 890 888 890; 322 333 312; 900 909 898; 511 542 512; 213 222 199; 545 555 533;111 111 123; 111 122 123; 121 132 122 ;122 123 122]
Considering a threshold value of 400 for Peak Detection.

Answers (4)

Erik S.
Erik S. on 8 Feb 2015
Hi,
Maybe you can use the following function from File Exchange http://www.mathworks.com/matlabcentral/fileexchange/11755-peak-finding-and-measurement You should be able to pass it the ampthreshold as you set to 400.

Eeshan Bashir
Eeshan Bashir on 8 Feb 2015
Edited: Eeshan Bashir on 8 Feb 2015
I am trying to use this toolbox but iam not able to reach to some conclusion. please support with your inputs
  1 Comment
Erik S.
Erik S. on 8 Feb 2015
Can you clarify if you need to find the peaks in matrix A & B at the same time or can you first check matrix and and than matrix B?

Sign in to comment.


Erik S.
Erik S. on 8 Feb 2015
Hi again!
This function is much simpler to use
for example use the line
[Location,Value]=peakfinder(A(:,1),[],400,1)
Good luck

Image Analyst
Image Analyst on 8 Feb 2015
Eeshan, if your definition of a pressure point is any signal over 400, then you don't want findpeaks (in the signal Processing Toolbox) or any other peak finding utility. You want simple thresholding. To get a logical vector of where the signal in column 3 is above 400, you just do this:
logicalPeaks = A(:,3) > 400;
If you want actual indexes, put a find() around it:
peaksIndexes = find(A(:,3) > 400);
If you want to find the number , as you mentioned, or the centroid of extended peaks, then it's best if you have the Image Processing Toolbox:
B=[222 232 214; 890 888 890; 322 333 312; 900 909 898; 511 542 512; 213 222 199; 545 555 533;111 111 123; 111 122 123; 121 132 122 ;122 123 122]
logicalPeaks = B(:,3) > 400
% Find number of peaks.
[labeledSignal, numberOfPeaks] = bwlabel(logicalPeaks);
fprintf('Found %d peaks\n', numberOfPeaks);
% Find centroids of all the peaks.
measurements = regionprops(labeledSignal, 'Centroid');
allCentroids = [measurements.Centroid];
allCentroids = allCentroids(2:2:end)
otherwise you'll have to use diff(logicalPeaks) and then look for +1 but be sure to take into account that the first element may be above 400. Let me know if you need help figuring out those lines of code.

Products

Community Treasure Hunt

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

Start Hunting!