I already verified my Python and openCV library definitely work. let just say a simple cv2.imshow() works normally when used with IDLE. but when I tried to use another IDE like Visual Studio and Pyscripter using the same code, the IDE cannot show the image and turns error. but when i tried to print(cv2.version), it works just ok. which means my IDE able to use the openCV library just fine. my pyscripter also gives the same output as VS. I already disabled any anti virus. why only IDLE works?
import cv2
print(cv2.__version__)
img = cv2.imread('cat.jpg')
cv2.imshow('img', img)`
python (64 bit): 3.7.5 opencv(pip): 4.1.1 Visual Studio: 2019 16.3.8
update: i found this error:
cv2.error: OpenCV(4.1.1) C:\projects\opencv-python\opencv\modules\highgui\src\window.cpp:352: error: (-215:Assertion failed) size.width>0 && size.height>0 in function 'cv::imshow'
so i added c++ module in my VS and i add this line to the code:
cv2.waitKey(0)
cv2.destroyAllWindows()
it works but a bit lag compared to IDLE, can anyone explain me why?