Matte

Increases the brightness of peripheral pixels.

int matte(cv::InputArray src, cv::OutputArray dst, cv::Point firstPoint, cv::Point secondPoint, float sigma)
Parameters:
  • src – RGB image.
  • dst – Destination image of the same size and the same type as src.
  • firstPoint – The first point for creating ellipse.
  • secondPoint – The second point for creatin ellipse.
  • sigma – The deviation in the Gaussian blur effect.
Returns:

Error code.

The algorithm.

  1. Create new image with white background for mask.
  2. Draw black ellipse inscribed in a rectangle that is defined by two opposite corner points (firstPoint and secondPoint) on the mask image. It’s a meaning part.
  3. Apply gaussian blur to the meaning part to make fade effect.
  4. Convolve mask with the image.
  5. Convert resulting image to the same color format as src.

Example.

sigma = 25.

srcImage dstImage