我试图使用Java和Raspi相机模块在Raspi上拍照,我使用下面的代码,但是我在raspi上遇到了一些错误。 如果我在Windows上运行该代码它可以正常工作。 我试过终端命令 cd Kamera javac -classpath。:classes:/ home / pi / Kamera / libs /' ' -d。 Kamera.java sudo java -classpath。:classes:/ home / pi / Kamera / libs /' ' KAMERA
我上传了一张有关错误img about error
的照片import httplib, urllib, base64
# Image to analyse (body of the request)
body = '{\'URL\': \'https://<path to image>.jpg\'}'
# API request for Emotion Detection
headers = {
'Content-type': 'application/json',
}
params = urllib.urlencode({
'subscription-key': '', # Enter EMOTION API key
#'faceRectangles': '',
})
try:
conn = httplib.HTTPSConnection('api.projectoxford.ai')
conn.request("POST", "/emotion/v1.0/recognize?%s" % params, body , headers)
response = conn.getresponse()
print("Send request")
data = response.read()
print(data)
conn.close()
except Exception as e:
print("[Errno {0}] {1}".format(e.errno, e.strerror))