Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

OpenCV-Python does not work with matplotlib.pyplot #404

Closed
@lewjiayi

Description

@lewjiayi
System information (version)
  • OpenCV => 4.4.0.44
  • Operating System / Platform => Ubuntu 18.04.5
  • Compiler => Visual Studio Code
Detailed description

When I import matplotlib.pyplot and uses cv2.imshow the window will just close on any key I press except for spacebar and Esc. The following code will not run but it returns no error, it simply stop running. It started after I upgrade my opencv from 4.2 to 4.4. I had tried to import matplotlib only and other matplotlib modules and they does not cause any problem.

Matplotlib version 3.3.2

Steps to reproduce
importcv2importmatplotlib.pyplotcap=cv2.VideoCapture("video/7.mp4")whileTrue:(ret,frame)=cap.read()ifnotret:breakcv2.imshow("Processed Output",frame)ifcv2.waitKey(1)&0xFF==ord('q'):breakcv2.destroyAllWindows()cap.release()print("End")

When the video ends byitself, End will be printed. When I press any key excpet spacebar and Esc while video playing, End will not be printed. I had tried with other code replacingprint("End") and they will not work as well. So I pretty sure it crashes.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    answers.opencv.org, Stack Overflow, etc and have not found solution
  • I updated to latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp