i'm using the fifo delta image diagnostic system to help figure out why i was getting alarms on some areas that were essentially black.
looking at the delta images, i'm finding a large number of very consistent blocks of color with pixel values of 20. in general, they seem to show up in areas where the reference image is very bright or very dark. looking more closely at the ref image, it seems like it's perhaps just a matter of round off errors. the max value in the reference image is 240 -- and this is one area where i'm getting these high deltas. the ref image also has a weird plateau of values at 15 that represent most of the dark areas, then some areas do drop to 0. these plateaus are where i'm finding the abnormal deltas. probably obvious, but 240 is 11110000 binary and 15 is 00001111.
it would be interesting to put a simple gradient thru the process and see what happens. i'm guessing you'll find pools of values at different points depending on the blend percentage.
my blend % is 6.
is this just a known problem with the fast bit shifting blending mode?
unusually high delta values
Re: unusually high delta values
turning off the fast blend seems to solve the weird plateaus, but it's interesting how much more jpeg noise lands in deltas now.
Re: unusually high delta values
yeah, looking at the fastblend code, basically depending on the blend percentage, you are basically throwing out your lowest significant bits.
at 6%, it's tossing out the lowest 4 bits of your the image. this is why i'm not getting anything higher than 240 in the image. the pools of values of 15 are coming from the inherent compression artifacts in the source data, i believe. using the standard blend mode a histogram shows a pretty distinct spike at 15 or 16. so basically, the system is converting to a 4 bit image and only reason the reference image isn't also 4 bits is because of noise and/or motion.
i think a potential solution that shouldn't too expensive is to simply keep a running error tally on the shifted values and add them to the next source pixel as a cheap semi-stochastic approach.
at 6%, it's tossing out the lowest 4 bits of your the image. this is why i'm not getting anything higher than 240 in the image. the pools of values of 15 are coming from the inherent compression artifacts in the source data, i believe. using the standard blend mode a histogram shows a pretty distinct spike at 15 or 16. so basically, the system is converting to a 4 bit image and only reason the reference image isn't also 4 bits is because of noise and/or motion.
i think a potential solution that shouldn't too expensive is to simply keep a running error tally on the shifted values and add them to the next source pixel as a cheap semi-stochastic approach.
Re: unusually high delta values
so my ref images don't have the odd plateauing anymore -- i turned off fast blend and cpu extensions. but i'm still having issues.
but i still see a ton of areas in the deltas in the 15-20 range. this is a white wall in the shade. pixel values vary from about 158, 175, 180 to 162, 180, 185 in the reference image. i just checked the live image and this area is about 20 points higher so the delta is accurate. the issue still seems to be the ref image blending. something is making it dropping a significant amount of brightness...
are there other diagnostic images to be seen?
but i still see a ton of areas in the deltas in the 15-20 range. this is a white wall in the shade. pixel values vary from about 158, 175, 180 to 162, 180, 185 in the reference image. i just checked the live image and this area is about 20 points higher so the delta is accurate. the issue still seems to be the ref image blending. something is making it dropping a significant amount of brightness...
are there other diagnostic images to be seen?
Re: unusually high delta values
so with the standard blend method...
my ref image value is 112. my live image values are 120.
blend percent 6.25%
112 * .9375 = 105
120 * .0625 = 7.5
105 + 7.5 = 112 --- no change to the ref image... i'd have to get up to 128 in order to increase the 112 by 1.
so i could have a solid 125 blending for hours and still the ref image would have a value of 112.
this seems like a pretty fundamental issue with motion detection. depending on your blend % and the levels coming in, your delta values might be off by 10-20 points. i suspect with a lower blend %, the issue would be incredibly magnified.
i'm running a docker right now, but maybe i should try to figure out how to get zm compiling...
my ref image value is 112. my live image values are 120.
blend percent 6.25%
112 * .9375 = 105
120 * .0625 = 7.5
105 + 7.5 = 112 --- no change to the ref image... i'd have to get up to 128 in order to increase the 112 by 1.
so i could have a solid 125 blending for hours and still the ref image would have a value of 112.
this seems like a pretty fundamental issue with motion detection. depending on your blend % and the levels coming in, your delta values might be off by 10-20 points. i suspect with a lower blend %, the issue would be incredibly magnified.
i'm running a docker right now, but maybe i should try to figure out how to get zm compiling...
Re: unusually high delta values
Love your analysis.
We probably need @mastertheknife on this.
I've never really gotten into this code.
We probably need @mastertheknife on this.
I've never really gotten into this code.
Re: unusually high delta values
i'm trying to get zm compiling, but haven't had much luck. i've got some thoughts i'd like to try out.