| 50 | // Retrieve the curve corresponding to the zero level set of the distance function. |
| 51 | template<typename T> |
| 52 | CImg<unsigned char> get_level0(const CImg<T>& img) { |
| 53 | CImg<unsigned char> dest(img); |
| 54 | CImg_2x2(I,T); Inn = 0; |
| 55 | cimg_for2x2(img,x,y,0,0,I,T) if (Icc*Inc<0 || Icc*Icn<0) dest(x,y) = 255; else dest(x,y) = Icc<0?100:0; |
| 56 | return dest; |
| 57 | } |
| 58 | |
| 59 | /*-------------------- |
| 60 |