Cv2.imshow () kernel crash

I run OpenCV through Jupyter Notebooks and whenever I try to run cv2.imshow (), the kernel crashes, an error message or a useful hint is just plain

The Kernel appears to have died. It will restart automatically.

Here is the code I'm running ...

import cv2 
input = cv2.imread('images/input.jpg')
cv2.imshow('Hello World', input)
cv2.waitKey(0)
cv2.destroyAllWindows()

The code works (albeit in different ways) when I run below ...

%matplotlib inline
from matplotlib import pyplot as plt
import cv2
image = cv2.imread('images/input.jpg')
plt.imshow(image)
plt.show()

FYI I am using a completely unaltered copy of BitFusion on AWS.

https://aws.amazon.com/marketplace/pp/B01EYKBEQ0?ref=cns_srchrow

Any idea what could go wrong?

+9
source share
2 answers

I cannot explain the behavior of your code right now, but you can use the code below to achieve the above behavior.

%matplotlib inline
from matplotlib import pyplot as plt
import cv2
image = cv2.imread('images/input.jpg')
plt.imshow(image)
plt.show()
0

cv2.imshow AWS, X11, cv2.imshow . ssh-ing -Y:

ssh -Y username@hostname

, -C:

ssh -Y -C username@hostname

, ssh AWS, , .

0

Source: https://habr.com/ru/post/1677021/


All Articles