2

Watershed segmentation algorithms cannot work in opencv android. I already used Watershed segmentation algorithms in c++ and java. But in android opencv it gives me error. I don't know why? I know Watershed segmentation algorithms takes 2 parameters of Mat typed object one is 8-bit 3 channel image and other one is 32-bit single channel image. But its gives me wrong parameter error.

Syed Ali hassan
  • 596
  • 4
  • 16

1 Answers1

0

The first step is to double-check each Mat has the type you think it does by using the myMat.depth() and myMat.channels() functions. The function watershed uses two Mat arguments. The first should be an 8-bit, 3-channel image, and the second should be a 32-bit single-channel image.

If they are not the right kind of image, use cvtColor to convert from what you have to what you need.

Mark Miller
  • 706
  • 4
  • 14
  • i'm really in need of help with this question, can you help me, please? https://stackoverflow.com/questions/61216402/how-to-improve-image-segmentation-using-the-watershed – Carlos Diego Apr 28 '20 at 17:12