Home>

Need help. I am trying to highlight the structure of the "Skeleton" sheet using the Kenny method, but the result does not suit.

Import NUMPY AS NP
Import CV2 AS CV
From Matplotlib Import Pyplot AS PLT
PATH= R'C: \ users \ admin \ pycharmprojects \ pythonproject2 \ v.png '
IMG= CV.Imread (Path, 0)
Edges= CV.Canny (IMG, 400, 300)
PLT.SUBPLOT (121), Plt.imshow (IMG, CMAP= 'Gray')
Plt.title ('Original Image'), plt.xticks ([]), plt.yticks ([])
PLT.SUBPLOT (122), plt.imshow (Edges, CMAP= 'Gray')
Plt.title ('Edge Image'), plt.xticks ([]), plt.yticks ([])
Plt.Show ()

There are too many boundaries, and I want to obtain only the main structure, such as:

So you yourself exhibit the thresholds. Have you tried to change them?

strawdog2021-06-03 14:53:59