X-Git-Url: https://svn.cri.ensmp.fr/git/Faustine.git/blobdiff_plain/a3490abb2f472827f39b061c55029949ebb3eba5..152d05a95ca7cdb29bc24bcee3c7ebb70e90aab7:/architecture/morpho.lib?ds=inline diff --git a/architecture/morpho.lib b/architecture/morpho.lib index 35e65b6..7d86d47 100644 --- a/architecture/morpho.lib +++ b/architecture/morpho.lib @@ -20,19 +20,30 @@ eroding(n) = strel_shift_erosion, _, strel_shift_erosion : #, _ : # : spray_by_t //dilation(size, iter) = seq(i, iter, dilating(size)); //erosion(size, iter) = seq(i, iter, eroding(size)); -dilation_square(x, y) = _ : vectorize(y) : serialize : dilating(x) : vectorize(y) : matrix_transpose(y, x) : serialize : dilating(y) : vectorize(x) : matrix_transpose(x, y) : serialize; +dilation_square(x, y) = serialize : dilating(x) : vectorize(y) : matrix_transpose(y, x) : serialize : dilating(y) : vectorize(x) : matrix_transpose(x, y); -erosion_square(x, y) = _ : vectorize(y) : serialize : eroding(x) : vectorize(y) : matrix_transpose(y, x) : serialize : eroding(y) : vectorize(x) : matrix_transpose(x, y) : serialize; +erosion_square(x, y) = serialize : eroding(x) : vectorize(y) : matrix_transpose(y, x) : serialize : eroding(y) : vectorize(x) : matrix_transpose(x, y); -dilations(x, y, iter) = seq(i, iter, dilation_square(x,y)); -erosions(x, y, iter) = seq(i, iter, erosion_square(x,y)); +cross = _, _ <: !, _, _, !; -open(x, y, iter) = erosions(x, y, iter) : dilations(x, y, iter); -close(x, y, iter) = dilations(x, y, iter) : erosions(x, y, iter); +//dilations(x, y, iter) = seq(i, iter, dilation_square(x,y)); +//erosions(x, y, iter) = seq(i, iter, erosion_square(x,y)); -//process = dilations(112, 3); -//process = erosions(119, 10); -//process = open(119, 123, 10); -//process = close(119, 123, 1); +dilations(x, y, iter) = _ : vectorize(y) : (iter, ((cross : ((0, 1 : prefix), _, _ : select2) : dilation_square(x, y))~_), (iter - 1)) : rdtable : serialize; +erosions(x, y, iter) = _ : vectorize(y) : (iter, ((cross : ((0, 1 : prefix), _, _ : select2) : erosion_square(x, y))~_), (iter - 1)) : rdtable : serialize; + +opening(x, y, iter) = erosions(x, y, iter) : dilations(x, y, iter); +closing(x, y, iter) = dilations(x, y, iter) : erosions(x, y, iter); + +threshold(x, n) = _, (n : vectorize(x)) : >; +and = *; + +licenceplate(x, y, seuil) = _ <: (opening(x, y, 1), closing(x, y, 1) : threshold(x, seuil), threshold(x, seuil) : and : opening(x, y, 1) : dilations(x, y, 1)), _ : and; + +//process = dilations(8, 8, 3); +//process = erosions(8, 8, 3); +//process = open(8, 8, 2); +//process = close(8, 8, 5); +//process = licenceplate(8, 8, 128);