-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpicturetest.py
More file actions
38 lines (26 loc) · 727 Bytes
/
picturetest.py
File metadata and controls
38 lines (26 loc) · 727 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from picamera2 import Picamera2
from time import sleep
camera = Picamera2()
#camera.start()
#sleep(2)
###
#5/4/'25 - Attempting to improve resolution (originally 640 x 480 pixels)
capture_config = camera.create_still_configuration({"size":(3280,2464)})
camera.configure(capture_config)
full_res = camera.sensor_resolution
#print("Sensor resolution:", full_res)
# It is 3280, 2464
zoom_width = full_res[0] // 7
zoom_height = full_res[1] // 7
#x = (full_res[0] - zoom_width) // 3
#y = (full_res[1] - zoom_height)// 3
#x = full_res[0] // 1
#y = full_res[1] // 1
x=1650
y=950
camera.set_controls({"ScalerCrop": (x, y, zoom_width, zoom_height)})
camera.start()
sleep(2)
###
camera.capture_file("test.jpg")
camera.stop()