Closed ssh4net closed 2 months ago
ImageBuf demosaiced = ImageBufAlgo::demosaic(input, { {"algorithm", "linear"}, {"pattern", "bayer"}, {"layout", "RGGB"} });
output zero for uint8/uint16 ImageBuf
this code will output black image.
ImageBuf input(file.string(), 0, 0, nullptr, &spec, nullptr); ImageBuf demosaiced = ImageBufAlgo::demosaic(input, { {"algorithm", "linear"}, {"pattern", "bayer"}, {"layout", "RGGB"} }); newfile = "demosaic.exr"; demosaiced.write(newfile);
This code that convert uint to float on load will output correctly demosaiced image
ImageBuf input(file.string()); input.read(0, 0, true, TypeDesc::FLOAT, nullptr, nullptr); ImageBuf demosaiced = ImageBufAlgo::demosaic(input, { {"algorithm", "linear"}, {"pattern", "bayer"}, {"layout", "RGGB"} }); newfile = "demosaic.exr"; demosaiced.write(newfile);
tested on latest master.
(Looks like tests are use only floats images?)
I've fixed the bug and got uint8/uint16 images covered in unit tests. See #4419 Thanks for reporting this.
Thanx! Now everything works.
ImageBuf demosaiced = ImageBufAlgo::demosaic(input, { {"algorithm", "linear"}, {"pattern", "bayer"}, {"layout", "RGGB"} });
output zero for uint8/uint16 ImageBuf
this code will output black image.
This code that convert uint to float on load will output correctly demosaiced image
tested on latest master.
(Looks like tests are use only floats images?)