PANDORE Version 6 | GREYC-IMAGE |
pdivneumann computes the divergence by backward finite differences. The result is a grayscale image im_out, where:
im_out(i,j) = (im_in1(i,j)-im_in1(i-1,j)) + (im_in2(i,j)-im2(i,j-1)),
with special care (Neumann) at boundaries:
im_in1(1,j) and -im_in1(n-1,j) im_in2(i,1) and -im_in2(i,n-1)
Returns SUCCESS or FAILURE.
Implements the gradient and divergence operators with Neumann boundary conditions such that one is the adjoint of the other, i.e. <grad x,u> = <-div u,x>. The script checks this identity.
protation 0 180 tangram.pan tangram1.pan pgradneumann tangram.pan gim1_y.pan gim1_x.pan pgradneumann tangram1.pan gim2_y.pan gim2_x.pan # Compute <grad im1, grad im2>. pmult gim1_y.pan gim2_y.pan | psumvalue - s1.pan sumvaly=`pstatus` pmult gim1_x.pan gim2_x.pan | psumvalue - s2.pan sumvalx=`pstatus` innerproduct1=`echo "$sumvaly+$sumvalx" | bc -l` # Compute <-div grad im1,im2>. pdivneumann gim1_y.pan gim1_x.pan | pmultcst -1 - divim1.pan pim2sf tangram1.pan t.pan pmult divim1.pan t.pan | psumvalue - /dev/null innerproduct2=`pstatus` echo $innerproduct1 echo $innerproduct2
Calcul de la divergence par différence finies décentrée à gauche.
Author: Jalal Fadili