0

Instead of Segmentation task, I am experimenting with PASCAL VOC data data to use it to train a `U^2 Net for Salient Object detection and ModeNet as Matting task.

Idea is to generate a B&W mask image from the coloured mask given (I'll take care of multi class and multi object thing). I can easily do it with 2 lines of code as:

img = np.array(Image.open('image1.png'))
img[img != 0] = 255

But the real difference between Matting / SOD and Segmentation is that the boundaries for the given data are very rough unlike the boundaries of SOD and Matting. Is there a way to smooth the boundaries automatically for all the 3K images?

Here are the images, mask and converted B&W mask.

enter image description here enter image description here enter image description here

Deshwal
  • 3,436
  • 4
  • 35
  • 94
  • How about performing Gaussian smoothing? – Jeru Luke Apr 30 '22 at 19:49
  • [Gaussian blur](https://opencv24-python-tutorials.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_filtering/py_filtering.html#gaussian-filtering) – nathancy May 01 '22 at 00:13
  • You could try to smooth the contours: https://stackoverflow.com/questions/11925777/opencv-how-to-use-arrays-of-points-for-smoothing-and-sampling-contours – Micka May 01 '22 at 06:03

0 Answers0