Open anonym24 opened 6 years ago
even simple UIImage to OCVMat won't work!
let image = UIImage(named: "myImage")
let mat = OCVMat(image: image!)
opencv(1984,0x1b355cb80) malloc: error for object 0x16ed112d8: pointer being freed was not allocated set a breakpoint in malloc_error_break to debug (lldb)
I commented
- (void)dealloc {
if (source) {
free(source);
}
source = NULL;
}
but another issue with https://github.com/Legoless/LegoCV/blob/10dfdd46ff016f0f3bdc3bf99a2c60ed6bcd66ba/LegoCV/LegoCV/Wrapper/Core/Mat/OCVMatDataAllocator.mm#L21
- (cv::Mat *)source {
return source;
}
it returns mat with incorrect size, for example initially it was 400x400px than it becomes 1x1498465
I have the same problem, but I don't know how to solve it
more: https://stackoverflow.com/questions/48540004/converting-cvpixelbuffer-to-mat-opencv
my Swift code:
https://github.com/Legoless/LegoCV/blob/master/LegoCV/LegoCV/Wrapper/Core/Mat/OCVMatDataAllocator.mm