alphamat.hpp 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. // This file is part of OpenCV project.
  2. // It is subject to the license terms in the LICENSE file found in the top-level directory
  3. // of this distribution and at http://opencv.org/license.html.
  4. /** Information Flow algorithm implementaton for alphamatting */
  5. #ifndef _OPENCV_ALPHAMAT_HPP_
  6. #define _OPENCV_ALPHAMAT_HPP_
  7. /**
  8. * @defgroup alphamat Alpha Matting
  9. * Alpha matting is used to extract a foreground object with soft boundaries from a background image.
  10. *
  11. * This module is dedicated to computing alpha matte of objects in images from a given input image and a greyscale trimap image that contains information about the foreground, background and unknown pixels. The unknown pixels are assumed to be a combination of foreground and background pixels. The algorithm uses a combination of multiple carefully defined pixels affinities to estimate the opacity of the foreground pixels in the unkown region.
  12. *
  13. * The implementation is based on @cite aksoy2017designing.
  14. *
  15. * This module was developed by Muskaan Kularia and Sunita Nayak as a project
  16. * for Google Summer of Code 2019 (GSoC 19).
  17. *
  18. */
  19. namespace cv { namespace alphamat {
  20. //! @addtogroup alphamat
  21. //! @{
  22. /**
  23. * @brief Compute alpha matte of an object in an image
  24. * @param image Input RGB image
  25. * @param tmap Input greyscale trimap image
  26. * @param result Output alpha matte image
  27. *
  28. * The function infoFlow performs alpha matting on a RGB image using a greyscale trimap image, and outputs a greyscale alpha matte image. The output alpha matte can be used to softly extract the foreground object from a background image. Examples can be found in the samples directory.
  29. *
  30. */
  31. CV_EXPORTS_W void infoFlow(InputArray image, InputArray tmap, OutputArray result);
  32. //! @}
  33. }} // namespace
  34. #endif