Closed TimoReusch closed 2 months ago
Can't reproduce, please provide a minimal example.
@rainyl I put together a minimal example you can clone and try to run here: https://github.com/TimoReusch/flutter_opencv_merge
Got it, will try to fix some time, thx~
Reproduced, but it's not the problem of opencv_dart, the following code worked fine:
List<cv.Mat> planeMats = planesData.map((planeData) {
// replace this line
// final Uint8List bytes = planeData['bytes'];
// with
final bytes = List.generate(height * width * 1, (i) => i);
cv.Mat mat = cv.Mat.fromList(height, width, cv.MatType.CV_8UC1, bytes);
return mat;
}).toList();
Thus, I am sure it's because the incorrect use of planeData['bytes']
, I haven't used the camera plugin, so do not know what planeData['bytes']
exactly are, if they are encoded image data, please use cv.imdecode
to decode, if they are raw pixel values, please ensure the length of planeData['bytes']
is exactly channels*rows*cols
, where channels
matchs the Mat you created.
I suppose the planeData['bytes']
contains RGB values of an image, then you can't use cv.MatType.CV_8UC1
but cv.MatType.CV_8UC3
should be used, and opencv expects BGR rather than RGB, so look into your code please.
If no further problems, I am going to close this issue.
Feel free to reopen it or open new issues if you still have any problems.
I'm using the following implementation inside of an isolate:
This results in the following error:
Looks like a segmentation fault to me.