1. Build Settings => Search Paths/Header Search Paths => 添加头文件所在目录
e.g. Header Search Paths: /usr/local/include/opencv4/
2. Build Phases => Link Binary with Libraries => 添加相应库文件
e.g. Link Binary With Libraries: libopencv_core.dylib; libopencv_imgcodecs.dylib; libopencv_highgui.dylib