title: OpenCV cv2.imshow() function keep running in Jupyter Notebook using python 3
body: <p>I just start to learn OpenCV in Python and mainly use jupyter notebook. The sample I learnt comes from course <a href="https://pythonprogramming.net/loading-images-python-opencv-tutorial/" rel="nofollow noreferrer">https://pythonprogramming.net/loading-images-python-opencv-tutorial/</a></p>
  
  <p>I load an image using cv2.imread() and want to show it up using cv2.imshow(). The image was shown successfully but the program keeps running and can't be interrupted.</p>
  
  <p>May I know why?</p>
  
  <p>Please check following codes:</p>
  
  <pre><code>import cv2
  import numpy as np
  import matplotlib.pyplot as plt
  %matplotlib inline
  
  img=cv2.imread('sample1.jpg',cv2.IMREAD_GRAYSCALE)
  
  cv2.imshow('image',img)
  cv2.waitKey(0)
  cv2.destroyAllWindows() # This part of code keeps running.
  </code></pre>