Apparence-io / CamerAwesome

📸 Embedding a camera experience within your own app shouldn't be that hard. A flutter plugin to integrate awesome Android / iOS camera experience.
https://ApparenceKit.dev
MIT License
959 stars 247 forks source link

how do i convert camera frame to opencv Mat in c++ using dart ffi #223

Closed aavinashj closed 1 year ago

aavinashj commented 1 year ago

I need to run custom analysis and Im using Datr ffi, Im able to convert the frames in the official camera package by converting yuv planes to Mat but the same does not work for this package

chaoyifei commented 5 months ago

@aavinashj how do you solve this pr, I want to use tflite,and need to convert the frames in the official camera package by converting yuv planes, but return Incorrect result

tflite

https://pub.dev/packages/tflite

var recognitions = await Tflite.detectObjectOnFrame(
  bytesList: img.planes.map((plane) {return plane.bytes;}).toList(),// required
  model: "SSDMobileNet",  
  imageHeight: img.height,
  imageWidth: img.width,
  imageMean: 127.5,   // defaults to 127.5
  imageStd: 127.5,    // defaults to 127.5
  rotation: 90,       // defaults to 90, Android only
  numResults: 2,      // defaults to 5
  threshold: 0.1,     // defaults to 0.1
  asynch: true        // defaults to true
);

camerAwesome

imageAnalysisConfig: AnalysisConfig(
          androidOptions: const AndroidAnalysisOptions.yuv420(
            width: 150,
          ),

Is there any difference between these two camera stream? camera_plugin works well

@apalala-dev