CImg icon indicating copy to clipboard operation
CImg copied to clipboard

CImg reference ... pdf file Section 6.6.4.5

Open pwplus7 opened this issue 5 years ago • 0 comments

CImg reference pdf file Section 6.6.4.5 Example codes

CImg src("image_color.jpg"), dest(src,false); // Image definitions.

typedef unsigned char uchar; // Avoid space in the second parameter of the macro CImg_5x5x1 below.

CImg<> N(5,5); // Define a 5x5 neighborhood as a 5x5 image. cimg_forC(src,k) // Standard loop on color channels cimg_for5x5(src,x,y,0,k,N,float) // 5x5 neighborhood loop. dest(x,y,k) = N.sum()/(5*5); // Averaging pixels to filter the color image. CImgList visu(src,dest); visu.display("Original + Filtered"); // Display both original and filtered image.

What exactly is achieved by "typedef unsigned char uchar" ? How does it "avoid space" or anything else ?

pwplus7 avatar Aug 25 '20 23:08 pwplus7