This is a question about using Python in Raspberry Pi to retrieve images from the example opencv

Asked 2 years ago, Updated 2 years ago, 67 views

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

2022-09-22 19:04

1 Answers

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.


2022-09-22 19:04

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.