average of pixels
use confidence to the final result too
cleanup
wrong params check