sendRgbFrame method
Sends the RealSense's RGB frame and optionally detects ArUco tags.
Implementation
void sendRgbFrame(Pointer<Uint8> rawRGB) {
if (rawRGB == nullptr) return;
final rgbMatrix = rawRGB.toOpenCVMat(camera.rgbResolution);
//detectAndAnnotateFrames(rgbMatrix); // detect ArUco tags
// Compress the RGB frame into a JPG
final rgbJpg = rgbMatrix.encodeJpg(quality: details.quality);
if (rgbJpg == null) {
sendLog(LogLevel.debug, "Could not encode RGB frame");
} else {
final newDetails = details.deepCopy()..name = CameraName.ROVER_FRONT;
sendFrame(rgbJpg, detailsOverride: newDetails);
}
rgbMatrix.dispose();
}