camera config
This commit is contained in:
parent
e2b0912aa8
commit
80c4fe3cf6
|
|
@ -1,13 +1,15 @@
|
|||
[galaxy_camera]
|
||||
exposure time: 10000
|
||||
horizontal crop offset: 0
|
||||
horizontal crop resolution: 2448
|
||||
vertical crop offset: 724
|
||||
vertical crop resolution: 800
|
||||
rotate 90 clockwise times: 0
|
||||
balance red: 1.0
|
||||
balance green: 1.0
|
||||
balance blue: 1.0
|
||||
horizontal_resolution: 2448
|
||||
vertical_resolution: 2048
|
||||
exposure_time: 10000
|
||||
; horizontal_crop_offset: 0
|
||||
; horizontal_crop_resolution: 2448
|
||||
; vertical_crop_offset: 0
|
||||
; vertical_crop_resolution: 2048
|
||||
; rotate_90_clockwise times: 0
|
||||
; balance_red: 1.0
|
||||
; balance_green: 1.0
|
||||
; balance_blue: 1.0
|
||||
|
||||
[vision_saver]
|
||||
time_format: %Y-%m-%d_%H-%M-%S
|
||||
|
|
|
|||
|
|
@ -30,19 +30,23 @@ class GalaxyCamera(Component):
|
|||
|
||||
def config_changed(self):
|
||||
self._period = int(self.config[self.name].get("frame time ms", 300)) / 1000
|
||||
self.exposure_time = int(self.config[self.name]["exposure time"])
|
||||
self.resolution = {
|
||||
"w": int(self.round_4(self.config[self.name]["horizontal_resolution"])),
|
||||
"h": int(self.round_4(self.config[self.name]["vertical_resolution"])),
|
||||
}
|
||||
self.exposure_time = int(self.config[self.name]["exposure_time"])
|
||||
self.roi = {
|
||||
"x": int(self.round_4(self.config[self.name]["horizontal crop offset"])),
|
||||
"w": int(self.round_4(self.config[self.name]["horizontal crop resolution"])),
|
||||
"y": int(self.round_4(self.config[self.name]["vertical crop offset"])),
|
||||
"h": int(self.round_4(self.config[self.name]["vertical crop resolution"])),
|
||||
"r": int(self.config[self.name]["rotate 90 clockwise times"]),
|
||||
"x": int(self.round_4(self.config[self.name].get("horizontal_crop_offset", 0))),
|
||||
"w": int(self.round_4(self.config[self.name].get("horizontal_crop_resolution", self.resolution["w"]))),
|
||||
"y": int(self.round_4(self.config[self.name].get("vertical_crop_offset", 0))),
|
||||
"h": int(self.round_4(self.config[self.name].get("vertical_crop_resolution", self.resolution["h"]))),
|
||||
"r": int(self.config[self.name].get("rotate_90_clockwise_times", 0)),
|
||||
}
|
||||
self.auto_white_balance = bool(self.config[self.name].get("auto white balance", False))
|
||||
self.balance = {
|
||||
"r": float(self.config[self.name].get("balance red", 1)),
|
||||
"g": float(self.config[self.name].get("balance green", 1)),
|
||||
"b": float(self.config[self.name].get("balance blue", 1)),
|
||||
"r": float(self.config[self.name].get("balance_red", 1)),
|
||||
"g": float(self.config[self.name].get("balance_green", 1)),
|
||||
"b": float(self.config[self.name].get("balance_blue", 1)),
|
||||
}
|
||||
self.lock.lock()
|
||||
self.camera.stream_off()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user