Expected behaviour
to show the image .
Actual behaviour
give this error:
cv2.error: OpenCV(4.0.0) C:\projects\opencv-python\opencv\modules\highgui\src\window_w32.cpp:1230: error: (-215:Assertion failed) dst.data == (uchar*)dst_ptr in function 'cvShowImage'
Steps to reproduce
-
example code:
import cv2
import numpy as np
cap = cv2.VideoCapture(0)
while True:
_, frame = cap.read()
laplacian = cv2.Laplacian(frame, cv2.CV_64F)
sobelx = cv2.Sobel(frame, cv2.CV_64F, 1, 0, ksize=5)
sobely = cv2.Sobel(frame, cv2.CV_64F, 0, 1, ksize=5)
cv2.imshow('Original', frame)
cv2.imshow('Laplacian', laplacian)
cv2.imshow('Sobelx', sobelx)
cv2.imshow('Sobely', sobely)
k = cv2.waitKey(5) & 0xFF
if (k==27):
break
cv2.destroyAllWindows()
cap.release()
-
operating system: Windows 10
-
architecture (e.g. x86): x86
-
opencv-python version: 4.0.0.21