2

Basically, I want to plot images using matplotlib such that I want to control them actively.

I have looked at this link, but it does not seem to quite answer the question.

I have written a program which applies Canny's algorithm (an image-processing algorithm which is used for edge-detection) to an image and displays it using matplotlib.

plt.subplot(121),plt.imshow(canny(original_img, kernel_size), cmap = 'gray')
plt.title('Edited Image'), plt.xticks([]), plt.yticks([])
plt.show()

But, the Canny's Algorithm function (canny(image, kernel_size)) takes kernel_size as an integer input which can be varied. Now, when I want to change the value of the variable, I have to run the program again to get the resultant output image with different kernel_size. But it would be much helpful if I am able to change the kernel_value actively through the matplotlib window (like using a slider/arrow keys/integer input).
Is there any way to do this?

CoolCoder
  • 786
  • 7
  • 20

0 Answers0