OpenCV UIImageToMat not working in xcode

I wrote some OpenCV code on xcode, but when I compiled, 2 methods got the linker refused: UIImageToMatandMatToUIImage

I used opencv2.framework (from opencv website, version 3.1 for iOS) and it worked fine, then I used cocoapods and integrated opencv 3.1.1 in my project and all the code worked the same, except for these 2 functions that gave me linker. I don’t understand why they do not work, when I delete #include "opencv2/imgcodecs/ios.h", it says that the functions do not exist (instead of the linker failure).

Does anyone know how to fix this? Thanks you

+4
source share
1 answer

I was able to fix it.

OpenCV 3.1.1 Cocoapods #include "opencv2/imgcodecs/ios.h", (- , ), , : https://github.com/opencv/opencv/blob/master/modules/imgcodecs/include/opencv2/imgcodecs/ios.h

, , , , : https://github.com/opencv/opencv/blob/master/modules/imgcodecs/src/ios_conversions.mm

, , UIImageToMat MatToUIImage OpenCV 3.1.1 ( 3.2).

+5

Source: https://habr.com/ru/post/1676446/


All Articles