Skip to content

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' #172

@BhautikDonga

Description

@BhautikDonga

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions