|
@@ -100,8 +100,8 @@ class SolarMonitor:
|
|
|
self.camera.iso = 800
|
|
self.camera.iso = 800
|
|
|
|
|
|
|
|
def capture(self):
|
|
def capture(self):
|
|
|
- file = "/home/pi/solar-monitor/camera/" + str(datetime.now()) + ".jpg"
|
|
|
|
|
- self.camera.capture(file)
|
|
|
|
|
|
|
+ file = "images/" + str(datetime.now()) + ".jpg"
|
|
|
|
|
+ self.camera.capture(file, format="jpeg", quality=25)
|
|
|
print("Captured.")
|
|
print("Captured.")
|
|
|
img = cv2.imread(file)
|
|
img = cv2.imread(file)
|
|
|
img = self.crop(img)
|
|
img = self.crop(img)
|
|
@@ -147,7 +147,7 @@ class SolarMonitor:
|
|
|
print(results)
|
|
print(results)
|
|
|
if results:
|
|
if results:
|
|
|
self.writeData(results)
|
|
self.writeData(results)
|
|
|
- cv2.imwrite(file + '_r.jpg', img)
|
|
|
|
|
|
|
+ cv2.imwrite(file + '_r.jpg', img, [cv2.IMWRITE_JPEG_QUALITY, 25])
|
|
|
# os.unlink(file)
|
|
# os.unlink(file)
|
|
|
time.sleep(2)
|
|
time.sleep(2)
|
|
|
|
|
|