maximum pixel intensity of image
조회 수: 6 (최근 30일)
이전 댓글 표시
My current project is based on CCD and LASER. i want to calculate maximum intensity of laser strip on ccd.. so please give me a code to find maximum intensity pixel and location of that pixel as row and column..
댓글 수: 0
채택된 답변
Image Analyst
2012년 10월 2일
Try this:
% Generate sample data
imageArray = [ 3 4 5 5 4 4 5 5 3; 5 4 5 5 3 3 3 3 4];
% Find the max value.
maxValue = max(imageArray(:))
% Find all locations where it exists.
[rowsOfMaxes colsOfMaxes] = find(imageArray == maxValue)
That said, this is probably not what you want to do to find the laser spot. You probably want to either do a spatial filter or a threshold, and then binarize and find the centroid of the binary blob. There are some laser tracking programs in the File Exchange: http://www.mathworks.com/matlabcentral/fileexchange/32492-laser-dot-isolation, http://www.mathworks.com/matlabcentral/fileexchange/33666-simple-particle-filter-demo, http://www.mathworks.com/matlabcentral/fileexchange/17960-particle-filter-color-tracker, http://www.mathworks.com/matlabcentral/fileexchange/31463-simple-demo-program-for-color-based-tracking, etc. etc.
댓글 수: 0
추가 답변 (4개)
Lalit Patil
2012년 10월 3일
댓글 수: 5
Nonu 007
2015년 11월 1일
Hello Image Analyst. I am trying that too but I am not getting a single line of cross section in 2D at highest Peak. Here i am attaching a fig. May be from that you can help me.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/179403/image.png)
I want a cross section line like this from the image at max intensity.
Shel
2018년 10월 10일
Hi, I am using max(I(:)) on my image but the error "Index exceeds matrix dimensions. " shows up ... do you know what the problem is?
댓글 수: 1
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!