MCPcopy Create free account
hub / github.com/ARM-software/AVH / __resizeFrame

Method __resizeFrame

interface/vstream/python/vsi_video_server.py:421–441  ·  view source on GitHub ↗

Resize the input frame to the target width and height. Args: frame: The input frame (as NumPy array) to be resized. target_width: The target width in pixels. target_height: The target height in pixels. Returns: frame: The resi

(self, frame, target_width, target_height)

Source from the content-addressed store, hash-verified

419 return cropped
420
421 def __resizeFrame(self, frame, target_width, target_height):
422 """
423 Resize the input frame to the target width and height.
424
425 Args:
426 frame: The input frame (as NumPy array) to be resized.
427 target_width: The target width in pixels.
428 target_height: The target height in pixels.
429 Returns:
430 frame: The resized frame.
431 """
432 logger.debug(f"__resizeFrame: original_size=({frame.shape[1]}, {frame.shape[0]}), target_size=({target_width}, {target_height})")
433
434 try:
435 frame = cv2.resize(frame, (target_width, target_height))
436 except Exception as e:
437 logger.error(f"Error in resizeFrame(): {e}")
438
439 logger.debug(f"__resizeFrame: resized_size=({frame.shape[1]}, {frame.shape[0]})")
440
441 return frame
442
443 def __convertToBGR(self, frame):
444 """

Callers 1

_readFrameMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected