Single channelled images in CImg -
i use cimg image processing work. work on gray scale jpg, bmp, tiff images presently. problem facing cimg function follows:
cimg stores pixel values in following way. r1r2r3r4............g1g2g3g4.........b1b2b3b4.........
even grey scale images, 3 different channels created separately. makes work complicated. copying values 1 image another, need copy components of pixels. need iterate across channels make algorithm slow.
since work grey scale images not matter me whether single channelled or multichannelled.is there way convert 3 channelled image single channelled in cimg. please let me know asap.
thank in advance
use cimg::channel(int c)
function:
cimg<float> img("input.jpg"); //3 channel img.channel(0); //now single channel img.save("output.jpg"); //will save 3 channel image again
Comments
Post a Comment