Home > Software engineering >  Binary_fill_holes () function to fill the void
Binary_fill_holes () function to fill the void

Time:11-16

In the image segmentation process produces a lot of unnecessary empty point, want to put these empty point fill into the base, therefore use binary_fill_holes () function, but after filling the whole image into background, consult bosses, what is the problem, the following code I
Img=cv2. Imread (OS) path) join (path, img))
Img=ndimage. Binary_fill_holes (np) asarray (img). Astype (int)
Cv2. Imwrite ('/home/fill/' + '% supachai panitchpakdi ng % dn, img)
The original image is greyscale

The results from the figure is:

My ideal results is to put the hole filling is good, ask bosses how to solve?

CodePudding user response:

Met the same problem, mainly int and float the output of the scope of the representation of an RGB problem, you can refer to the following post
https://stackoverflow.com/questions/42044259/getting-black-plots-with-plt-imshow-after-multiplying-image-array-by-a-scalar/42045225#42045225

But I've got the case scope of the effect also is not very good, the reason is not clear, the solution is to greyscale image into 2 d ndarray of TRUE/FALSE, filling and then output
  • Related