atul

November 1, 2004, 09:35:12

Dear Sir,

Please help me, how do i compute the mean brightness and subtracting it from each pixel.

I want to stop recording video during light flickering. That is, when then camera focuses directly on a tube light, the camera should not sense it as a valid motion.

please help me with an algorithm to calculate the above. I have to code the logic in Delphi 6.0 but if i get the code in other language, i may try to convert it in delphi and implement the same.

currently my code looks similar to the following:

For y = 0 To ICImagingControl1.ImageHeight - 1 Step 10

For x = 0 To ICImagingControl1.ImageWidth - 1 Step 10

Diff = Diff + Abs(PrevBuf(x, y) - CurBuf(x, y))

Next x

Next y

If Diff > Threshold then HasMoved = True

After this, how do i calculate the mean brightness and subtract it from each pixel.

thanks in advance,

looking forward for a quick reply,

atul.

Please help me, how do i compute the mean brightness and subtracting it from each pixel.

I want to stop recording video during light flickering. That is, when then camera focuses directly on a tube light, the camera should not sense it as a valid motion.

please help me with an algorithm to calculate the above. I have to code the logic in Delphi 6.0 but if i get the code in other language, i may try to convert it in delphi and implement the same.

currently my code looks similar to the following:

For y = 0 To ICImagingControl1.ImageHeight - 1 Step 10

For x = 0 To ICImagingControl1.ImageWidth - 1 Step 10

Diff = Diff + Abs(PrevBuf(x, y) - CurBuf(x, y))

Next x

Next y

If Diff > Threshold then HasMoved = True

After this, how do i calculate the mean brightness and subtract it from each pixel.

thanks in advance,

looking forward for a quick reply,

atul.