1 #include <mln/core/dpoint2d.hh>
2 #include <mln/norm/l2.hh>
10 get_local_nrg (const image2d
<rgb8
>& i
, const point2d
& p
)
12 using norm::l2_distance
;
13 typedef metal::vec
<3u, float> vec_t
;
14 vec_t l
= i (p
+ left
).to_equiv ();
15 vec_t r
= i (p
+ right
).to_equiv ();
16 vec_t u
= i (p
+ up
).to_equiv ();
17 vec_t d
= i (p
+ down
).to_equiv ();
18 return l2_distance (l
, r
) + l2_distance (u
, d
);
21 image2d
<float> get_nrg (const image2d
<rgb8
>& img
)
23 image2d
<float> nrg (img
.domain ());
24 image2d
<rgb8
>::fwd_piter
p (img
.domain ());
27 nrg (p
) = get_local_nrg (img
, p
);