Class lsst::afw::math::BackgroundMI¶
-
class
BackgroundMI
: public lsst::afw::math::Background¶ A class to evaluate image background levels
Break an image up into nx*ny sub-images and use a statistical to estimate the background levels in each square. Then use a user-specified or algorithm to estimate background at a given pixel coordinate.
Methods are available to return the background at a point (inefficiently), or an entire background image. BackgroundControl contains a public StatisticsControl member to allow user control of how the backgrounds are computed.
math::BackgroundControl bctrl(7, 7); // number of sub-image squares in {x,y}-dimensions bctrl.sctrl.setNumSigmaClip(5.0); // use 5-sigma clipping for the sub-image means std::shared_ptr<math::Background> backobj = math::makeBackground(img, bctrl); // get a whole background image Image<PixelT> back = backobj->getImage<PixelT>(math::Interpolate::NATURAL_SPLINE);
// get the background at a pixel at i_x,i_y double someValue = backobj.getPixel(math::Interpolate::LINEAR, i_x, i_y);