Anonymous user
Canny edge detector: Difference between revisions
→{{header|J}}
Line 678:
convolve =: 4 : 'x apply (($x) partition y)'
partition=: 2 1 3 0 |: {:@[ ]\ 2 1 0 |: {.@[ ]\ ]
apply=: [: +/ [: +/ *
max3x3 =: 3 : '(0<1{1{y) * (>./>./y)'
addborder =: (0&,@|:@|.)^:4
normalize =: ]%+/@,
Line 693 ⟶ 687:
connect =: 3 : 'attach^:_ unique y'
NB. on low memory devices, cropping or resampling of high-resolution images may be required
crop =: 4 : 0
'h w h0 w0' =: x
Line 699 ⟶ 693:
)
resample =: 4 : '|: (1{-x)(+/%#)\ |: (0{-x)(+/%#)\ y'
NB. on
inflate1 =: 4 : 0
'h w' =: $y
|