# It seems there is a potential unresolved import issue with cv2. # Please ensure OpenCV is installed, typically via "pip install opencv-python" for most environments. import cv2 def to_ir(frame_bgr): gray = cv2.cvtColor(frame_bgr, cv2.COLOR_BGR2GRAY) gray = cv2.equalizeHist(gray) ir = cv2.applyColorMap(gray, cv2.COLORMAP_INFERNO) return ir