Reputation: 1120
Basically,
The frame keep going continuously. Then, how can I read/get back the value of total white pixel from previous frame and current frame continuously?
Thanks.
Upvotes: 0
Views: 353
Reputation: 1776
you need to hold a member with the prev value.
assuming readPixel()
function reads the total white value, curr
is the current value, and prev
is the previous value. this is example pseudo-code:
prev = curr = readPixel; //avoid division by zero
for(;;)
{
curr = readPixel();
value = curr / prev;
prev = curr;
}
Upvotes: 1