I saved the image and Python file in the same place
ython 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170124] on linux Type "copyright", "credits" or "license()" for more information.
import numpy as np import cv2
img_file = “./test.jpg" img = cv2.imread(img_file)
cv2.imshow(‘IMG', img) cv2.waitKey(0) cv2.destroyAllWindows()
SyntaxError: multiple statements found while compiling a single statement
There's this error
opencv raspberry-pi
It seems that the environment where you enter the Python code does not accept the code at once. Copy and paste the code into a place like pycharm and try using it.
Similar questions include this question from stackoverflow.
© 2024 OneMinuteCode. All rights reserved.