Hello jakaskerl,
Thank you for your response.
I'm looking to use this for traffic analysis, where the camera is mounted on a pole that may experience slight movements due to wind.
On my PC, I've been using the following function to stabilize the frame:
'''
def stabilize_frame(self, frame: np.ndarray) -> np.ndarray: """Stabilize a video frame by matching the feature positions""" frame_features, status, _ = cv.calcOpticalFlowPyrLK( self.calibration_frame, frame, self.track_features, None ) transformation, _ = cv.estimateAffine2D( frame_features[status == 1], self.track_features[status == 1] ) return cv.warpAffine(frame, transformation, np.flip(frame.shape[0:2]))
'''
However, the functions cv.calcOpticalFlowPyLK
and cv.estimateAffine2D
consume too much CPU on the device. Is there something similar in DepthAI that I could utilize? Perhaps using a marking on the street as a reference point would be a viable alternative. Thank you.