I have a binary image (white and black), the where Region of Interest (ROI) is black. The shape of ROI is irregular and the location of ROI can be anywhere in the frame.
I want to have a smooth gradation at the edge of the ROI (black -> dark grey -> grey -> light grey -> white).
I research the links below, however those cannot solve my problem:
- How to blur some portion of Image in Android?
- OpenCV - How to achieve a gradual image blur effect?
- Combining 2 images with transparent mask in opencv
- Gradient mask blending in opencv python
Example of ROI - original image, the REAL Shape is irregular and Location is anywhere:
Expected result - in the edge of ROI the is gradation part changing from stright line to dash line: black -> dark grey -> grey -> light grey -> white: