Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Is anyone know how to find the brightest pixel from the image?

Status
Not open for further replies.

sakurarandom

Junior Member level 3
Joined
Mar 26, 2011
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
1,500
Is anyone know how to find the brightest pixel from the image? I wish to find the coordinate of the laser dot in the image.

I found this information from internet but it doesn't help me at all.

% Assume I is the image you have with RGB values.
% Assume I is a matrix of [row,col, 3] of RGB values.
% First, convert it to HSI space

hsv = rgb2hsv(I);

%get the illuminance channel
v = hsv:),:,3);

%find the max pixel value
max_v = max(max(v));

% find the position of pixels having this value.
[r, c] = find(v == max_v);

% here, r are rows, c are columns.
 


Bassa, Thanks for your help. I am very appreciate it. However, I am using green laser..will it works?
 

Yes it may be work, I think try out one algorithm, and fine-tune for green color.
 

Do you understand its coding? I confuse on this part:

% calculate the midpoints of the area
if leftMost ~= xResolution && rightMost ~= 0
% both leftMost and RightMost have been updated

laserFound = true;
laserX = (leftMost + rightMost)/2;
laserY = (topMost + bottomMost)/2;
% top left: 172,101
% bottom right: 285,185
canvasLaserX = (laserX-172)*320/(285-172);
canvasLaserY = (laserY-101)*240/(185-101);

writefile(floor(canvasLaserX),floor(canvasLaserY)) ;
else
% unable to find laser
laserFound = false;
end


what do that canvaslaser for?
 

Thanks for your information, Bassa. I had email him and waiting his reply still.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top