Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from pathlib import Path
- import cv2
- 以下の関数を呼び出してくると画像が開けない
- #from classfy02 import input_data
- def main():
- parent_path = Path(__file__).parent
- path = str(
- (parent_path / 'cross.png').resolve()
- )
- img = cv2.imread(path)
- cv2.namedWindow('screen', cv2.WINDOW_NORMAL)
- cv2.setWindowProperty('screen', cv2.WND_PROP_FULLSCREEN,
- cv2.WINDOW_FULLSCREEN)
- cv2.imshow('screen', img)
- cv2.waitKey(1000)
- if __name__ == '__main__':
- main()
- OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /Users/travis/build/skvark/opencv-
- python/opencv/modules/highgui/src/window.cpp, line 325
- Traceback (most recent call last):
- File "path.py", line 15, in <module>
- cv2.imshow('screen', img)
- cv2.error: /Users/travis/build/skvark/opencv-
- python/opencv/modules/highgui/src/window.cpp:325: error: (-215) size.width>0 && size.height>0 in function imshow
Add Comment
Please, Sign In to add comment