C#: Fast and Smart algorithm to Compare two byte array (image) -
i'm running process on webcam image. i'd wake process if there major changes.
- something moving in image
- lights turn on
- ...
so i'm looking fast efficient algorithm in c# compare 2 byte[] (kinect image) of same size.
- i need kind of "diff size" threashold
- i found motion detection algorithm it's "too much"
- i found xor algorithm might simple ? great if ignore small change sunlight, vibration, etc, ...
mark pixels different previous image (based on threshold i.e. if pixel has been changed - ignore noise) 'changed'
filter out noise pixels - i.e. if pixel marked changed neighbors not - consider noise , unmark changed
calculate how many pixels changed on image , compare threshold (you need calibrate manually)
make sure operating on greyscale images (not rgb). i.e. convert yuv image space , comparison on y.
this simplest , fastest algorithm - need tune these 2 thresholds.
Comments
Post a Comment