16MPixel Bilder + Arbeiten an Statistik

This commit is contained in:
chk
2026-05-31 17:39:25 +02:00
parent ca98774657
commit 761919bb93
212 changed files with 159773 additions and 81014 deletions

View File

@@ -5,7 +5,7 @@ import shutil
from pathlib import Path
import argparse
def update_robot_json(robot_json_file, camera_position, camera_target, default_position):
def update_robot_json(robot_json_file, camera_position, camera_target, default_position, width, height, fstop):
"""Aktualisiert die cameraPosition und defaultPosition in der robot.json-Datei."""
try:
with open(robot_json_file, 'r') as f:
@@ -13,6 +13,9 @@ def update_robot_json(robot_json_file, camera_position, camera_target, default_p
data['renderingInfo']['cameraPosition'] = camera_position
data['renderingInfo']['cameraTarget'] = camera_target
data['renderingInfo']['width'] = width
data['renderingInfo']['height'] = height
data['renderingInfo']['dofFStop'] = fstop
data['defaultPosition'] = default_position
with open(robot_json_file, 'w') as f:
@@ -100,24 +103,43 @@ def main():
"f": [200, -200, 180],
"g": [200, -200, 180],
}
# Robot-Pose-Dictionary
robot_poses = {
"4": {"x": 70, "y": 50,"z": -70,"a": 120,"b": 50,"c": 30,"e": 20},
"5": {"x": 180,"y": 86,"z": -120,"a": -60,"b": 22,"c": 91,"e": 10},
"6": {"x": 80, "y": 20, "z": 80, "a": -120, "b": 23, "c": 9, "e": 3},
"7": {"x": 30, "y": -2, "z": 95, "a": 20, "b": 23, "c": 9, "e": 9},
"8": {"x": 50, "y": -2, "z": 95, "a": 20, "b": 60, "c": 9, "e": 3},
"9": {"x": 60, "y": -2, "z": 95, "a": 200, "b": 60, "c": 9, "e": 8},
"10": {"x": 120, "y": 60, "z": -110, "a": 20, "b": 30, "c": 180, "e": 4},
"11": {"x": 50, "y": 4, "z": 176, "a": 20, "b": 60, "c": 9, "e": 5},
"12": {"x": 50, "y": 0, "z": 178, "a": 210, "b": 80, "c": 90, "e": 6},
#"4": {"x": 70, "y": 50,"z": -70,"a": 120,"b": 50,"c": 30,"e": 20},
#"5": {"x": 180,"y": 86,"z": -120,"a": -60,"b": 22,"c": 91,"e": 10},
#"6": {"x": 80, "y": 20, "z": 80, "a": -120, "b": 23, "c": 9, "e": 3},
#"7": {"x": 30, "y": -2, "z": 95, "a": 20, "b": 23, "c": 9, "e": 9},
#"8": {"x": 50, "y": -2, "z": 95, "a": 20, "b": 60, "c": 9, "e": 3},
#"9": {"x": 60, "y": -2, "z": 95, "a": 200, "b": 60, "c": 9, "e": 8},
#"9a": {"x": 60, "y": -2, "z": 95, "a": 200, "b": 60, "c": 9, "e": 8},
"9b": {"x": 60, "y": -2, "z": 95, "a": 200, "b": 60, "c": 9, "e": 8},
#"10": {"x": 120, "y": 60, "z": -110, "a": 20, "b": 30, "c": 180, "e": 4},
#"11": {"x": 50, "y": 4, "z": 176, "a": 20, "b": 60, "c": 9, "e": 5},
#"12": {"x": 50, "y": 0, "z": 178, "a": 210, "b": 80, "c": 90, "e": 6},
}
renderingInfos = {
"4": {"width":1280, "height":720, "dofFStop":11},
"5": {"width":1280, "height":720, "dofFStop":11},
"6": {"width":1280, "height":720, "dofFStop":11},
"7": {"width":1280, "height":720, "dofFStop":11},
"8": {"width":1280, "height":720, "dofFStop":11},
"9": {"width":1280, "height":720, "dofFStop":11},
"9a": {"width":1440, "height":1080, "dofFStop":11},
"9b": {"width":4896, "height":3264, "dofFStop":5.6},
"10": {"width":1280, "height":720, "dofFStop":11},
"11": {"width":1280, "height":720, "dofFStop":11},
"12": {"width":1280, "height":720, "dofFStop":11},
}
for pose_name, default_position in robot_poses.items():
new_folder = Path(args.output_set) / f"Scene{pose_name}"
os.makedirs(new_folder, exist_ok=True)
renderingInfo = renderingInfos[pose_name]
print(renderingInfo)
pose_file = new_folder / "pose.json"
pose_data = {"name": pose_name,"position": default_position, "camera_positions": camera_positions}
@@ -129,7 +151,7 @@ def main():
camera_target = camera_targets[frame_name]
# 1. JSON aktualisieren
if not update_robot_json(args.robot_json, camera_position, camera_target, default_position):
if not update_robot_json(args.robot_json, camera_position, camera_target, default_position, renderingInfo["width"], renderingInfo["height"], renderingInfo["dofFStop"]):
continue # Gehe zum nächsten Schleifendurchlauf
# 2. Blender-Skript ausführen