I'm trying to get minima in image with Magick++ API version 7:
img.type(Magick::GrayscaleType);
auto stats = img.statistics();
std::cout << argv[0] << ":" << stats.channel(Magick::PixelChannel::GrayPixelChannel ).minima() << std::endl;
img.write("test" + Glib::ustring(argv[0]) + ".bmp");
For several images I get the same minima
value and a wrong value > 1.0.
Running identify -verbose
on written image gives me correct value.
How can I solve this?
EDIT 1
If I do
img.read("test" + Glib::ustring(argv[0]) + ".bmp");
stats = img.statistics();
std::cout << argv[0] << ":" << stats.channel(Magick::PixelChannel::GrayPixelChannel ).minima() << std::endl;
I get the correct value for minima (and it is not in range 0 - 1.0 in ImageMagick 7).
img here is the result of
img.composite(mask, 0, 0, Magick::OverCompositeOp);
where mask is
Magick::Image newmask(Magick::Geometry(width,height),Magick::Color("white"));
newmask.strokeColor("black");
newmask.fillColor("black");
newmask.draw( Magick::DrawableCircle(xc,yc, xc,yc+rc-10) );
newmask.transparent(Magick::Color("black"));
newmask.depth(8);
mask = newmask;