// This program gives various examples of the usage of the IPRunLengthC and // IPLinearAverageC filters. #include "amma/NumImage.hh" #include "amma/Image/IPLinearAverage.hh" #include "amma/Image/IPRunLength.hh" #include "amma/DP/ComposeSE.hh" int main() { // create image and initialise it: all 1s except 1 x 7 NumImageC in(7,12); in.Fill(1); in[2][4]=7; NumImageC out; // this line, + the associated header file, are requires to implement the // following "operator>>" style of applying image processing operators using namespace DPComposeSE; // filter with 2x3 mask run-length; default behaviour is: preserve original // image size, pad with black, shift 1/2 pixel up/left for even mask in >> IPRunLengthC(2,3) >> out; cout < f(2,3); out = f.Apply(in); cout <> IPRunLengthC(2,3,Erode) >> out; cout <> IPLinearAverageC(2,3) >> out; cout <> IPLinearAverageC(2,3,Original,PBRescale,ShiftDR) >> out; cout <