Zhang-Suen thinning algorithm: Difference between revisions

Content added Content deleted
(→‎{{header|J}}: Improve clarity of phrasing)
Line 326:
frameImg=: 0 ,. 0 , >:@$ {. ] NB. adds border of 0's to image
 
nbrsneighbrs=: adverb define NB. applies verb u to neighbourhoods
(1 1 ,: 3 3) u;._3 y
)
Line 347:
 
whiten=: [ * -.@:*. NB. make black pixels white
zhangSuen=: [: toImage [: (whiten [: frameImg @(step2 nbrsneighbrs))@(whiten [: frameImg @(step1 nbrsneighbrs))^:_ isBlackPx
 
zhangSuenX=: verb define NB. alternative Explicit representation of verb above