Description
i have a problem with live detection, see i use camera package to capture image frame by frame and send those frame to yolo model,
i use camera ResolutionPreset.medium which is is 640x840,
void init() async {
vision = FlutterVision();
cameras = await availableCameras(); // Initialize available cameras
controller = CameraController(cameras[0], ResolutionPreset.medium); //! resolution medium is 640x480
// Initialize camera controller
await controller.initialize();
// Get the preview size after the controller is initialized
setState(() {
isLoaded = true;
isDetecting = false;
yoloResults = [];
cameraPreviewSize = controller.value.previewSize!;
});
await loadYoloModel();
}
when i detect something like chair, and dining table output allways same as ResolutionPreset,
and when i change to high which is 1280x720, output bounding boxes still same with ResolutionPreset,
double left = result["box"][0];
double top = result["box"][1];
double right = result["box"][2];
double bottom = result["box"][3];
final String label = result['tag'];
final String confidence = (result['box'][4] * 100).toStringAsFixed(1);
double objectX = left * factorX;
double objectY = top * factorY;
double objectWidth = (right - left) * factorX;
double objectHeight = (bottom - top) * factorY;`
thanks a lot