Sobel Edge Detection

* do vertical edges (to D)
* k = PIX * 0.25
M <- PIX; SF; LDPIX
K <- M; MUL (0.25);
* a = k + k(NORTH)
* b = k + k(SOUTH)
NEWS <- K
H <- K
A<-H+NORTH
B<-H+SOUTH
* h = a + b
H<-A+B
* C = |h(WEST) - h(EAST)|
NEWS<-H
C<-WEST
H<-C+EAST
D<-H
FLAG<-C+EAST
D<-C+EAST
SF
* do similarly for horizontal edges to A
NEWS<-K
H<-K
A<-H+EAST
B<-H+WEST
H<-A+B
NEWS<-H
C<-NORTH
H<-C+SOUTH
A<-H
FLAG<-C+SOUTH
A<-C+SOUTH
SF
* sum horizontal & verical
B<-D+A
OUT B
Back to SCAMP...