MCPcopy Create free account
hub / github.com/GreycLab/CImg / get_level0

Function get_level0

examples/mcf_levelsets2d.cpp:52–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50// Retrieve the curve corresponding to the zero level set of the distance function.
51template<typename T>
52CImg<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

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected