Population
Image processing library in C++
Practitioner with functional programming

Program = Data + Algorithm

In Image Processing, the pipeline process is a combination of algorithms. For instance, a practitioner can say “I apply the median filter following by the Otsu’s threshold, then I merge the previous seeds and so one”. Therefore the verb (the action) is important. The modern paradigm is object-oriented programming. Verb seems to be old school for C language and not for C++. But, Population library mix object- and verb-oriented programming redesigning an old assertion “Program = Data + Algorithm” in a fashion way (see my book for further explanations). Data, as pop::MatN, pop::VecN, are object-oriented programming with class organisation. Algorithm organised in module classes as pop::Processing, pop::Analysis are verb-oriented programming.

So the code seems like that:

Mat2UI8 m;//construct an object -> Data
img.load("../image/iex.png");//load the image, facility of the class Mat2UI8 -> Data
img.display("Initial image",false);//display the image, facility of the class Mat2UI8 -> Data
img = PDE::nonLinearAnisotropicDiffusionDericheFast(img);//filtering -> Algorithm
double value;
Mat2UI8 threshold = Processing::thresholdOtsuMethod(img,value);//thresholding -> Algorithm
threshold.save("iexthreshold.pgm");
Mat2RGBUI8 color = Visualization::labelForeground(threshold,img);//colored result -> Algorithm
color.display("Segmented image",true);//display the image, facility of the class Mat2RGBUI8 -> Data