Feature Request: threshold percent value instead of # of pixels
the current threshold value is represented as a number of pixels that trigger the motion detection. this is a problem if you have multiple cameras running different resolutions (e.g a couple 640x480 and a 1280x1024 megapixel cam) because a higher res cam will contain more pixels within the same area of the image than a lower res cam. it seems to me using a threshold value representing a percentage of the captured image would solve this problem. for example the default value of 1500 pixels would be equivalent to about 0.5% of the image for a 640x480 resolution cam, about 2% of 320x240, and so on. this way a single value could encompass multiple cameras regardless of their resolution.
if i've overlooked something or if there is already a solution to this problem please let me know.
- 28 Feb 2010
This feature will introduce a penalty in performance , because in every capture frame motion will have to calculate total number of pixel of frame and the how many pixel are that percentage.
( width * height ) * percentage / 100
It's not much , but i don't think it will introduce a real gain, you don't really change threashold of each thread of motion every week .
- 14 Mar 2010
Good point TrevL
- it should be a percentage. Believe me, one multiply per frame is not anything to worry about.
- 12 Jul 2011
, could you please explain why this needs to be computed for every frame? I think that all variables (width, height, percentage) do not change during's motion run, so it should be sufficient to compute the number of pixels just once on camera initialization (after determining the resolution). What about adding a new config option (threshold_percentage) and use to calculate threshold if undefined?
I should also note I'am also a very pro-percentage person. Although I don't change the resolution too often, I do have to recalculate the threshold manually every time when I do so, which is annoying. Percentual threshold would make changing resolutions (even just a few "preset" ones) much easier.
- 31 Jan 2012
- 02 Sep 2014