modification of pgblur to handle black frames

Hi,

I want to propose a small modification to the pgblur script, right after assigning the command line parameters to variables:

set inp = "$3"
set Lzero = `pextrem $inp:q | tail -1 | rcalc -e '$1=if((.265*$3+.67*$4+.065*$5)-1e-5,0,1)'`
if ( $Lzero ) then
exec cat $inp:q
exit 0
endif

This outputs the original image if all pixel values are zero (well, below my arbitrarily chosen threshold) rather than producing an error. The motivation is that I want to filter frames resulting from CBDM. One could, of course, keep this test outside the script, but this eliminates one error condition.

Cheers,
Lars.

Hi Lars,

This shouldn't be an error condition. An all-zero image should pass through the pgblur command unchanged. Your way would take less time, but the results should be the same.

Confused,
-Greg

···

From: "Lars O. Grobe" <[email protected]>
Date: May 4, 2018 9:49:09 AM PDT

Hi,

I want to propose a small modification to the pgblur script, right after assigning the command line parameters to variables:

set inp = "$3"
set Lzero = `pextrem $inp:q | tail -1 | rcalc -e '$1=if((.265*$3+.67*$4+.065*$5)-1e-5,0,1)'`
if ( $Lzero ) then
        exec cat $inp:q
        exit 0
endif

This outputs the original image if all pixel values are zero (well, below my arbitrarily chosen threshold) rather than producing an error. The motivation is that I want to filter frames resulting from CBDM. One could, of course, keep this test outside the script, but this eliminates one error condition.

Cheers,
Lars.