Welcome to our Community
Wanting to join the rest of our members? Feel free to sign up today.
Sign up

Regarding frame processing for input into Anafiai's Olympe depth estimation model

Thanatos

New member
Joined
Nov 13, 2025
Messages
1
Reaction score
0
Currently, the code is as follows:



while ascended_height < target_height:
t0 = time.time()
try:

cap = cv2.VideoCapture(RTSP_URL, cv2.CAP_FFMPEG)
cap.set(cv2.CAP_PROP_BUFFERSIZE, 1)
for _ in range(3):
cap.read()
ok, frame = cap.read()
cap.release()

if not ok:
print("[WARN] Frame grab failed during ascent")
time.sleep(0.1)
continue

timestamp = time.strftime("%Y%m%d_%H%M%S")
filename = f"capture_{timestamp}.jpg"
cv2.imwrite(filename, frame)
print(f"[SAVE] {filename}")
depth_m, fpx = infer_depth_meters(model, transform, frame)
if depth_m is None:
print("[ERROR] Depth estimation failed during ascent")
time.sleep(0.1)
continue

d_min = robust_min_depth(depth_m)
print(f"[ASCENT] d_min={d_min:.2f} m, ascended={ascended_height:.2f}m/{target_height}m")

Using this code, the camera captures and processes frames for depth estimation.
However, during experiments, communication issues often cause frequent errors, and frames fail to be transmitted.


Is there a way to lighten or optimize this frame processing to make it more reliable?
 

New Posts

Members online

Forum statistics

Threads
5,496
Messages
45,601
Members
9,026
Latest member
javier51679