I've been trying to build depthai-core from the v3.0.0-rc.1 tag. But it says that it cannot find OpenCV. I used vcpkg to download opencv separately. I then set the following flag -D"OpenCVDIR=/vcpkginstalled/x64-windows/share/opencv4" which is where OpenCVConfig.cmake lives. Nevertheless, depthai-core was still not build with opencv compatibility. Furthermore, when building, errors occurred due to depthai building in Debug config while OpenCV was in a release config. I am using Windows.
I can't build v3
For example this is one of many errors that I get when I try to build. I believe it is saying that there is a mismatch between my OpenCV cmake file being for Release, but Depth AI is building for Debug.
fmt.lib(format.cc.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Bootloader.obj [C:\Users\Shai Renne\Documents\Visual-Studio-2015\Projects\depthai-core\build\depthai-core.vcxproj]
fmt.lib(format.cc.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in Bootloader.obj [C:\Users\Shai Renne\Documents\Visual-Studio-2015\Projects\depthai-core\build\depthai-core.vcxproj]
If I run "cmake --build build --config Release", the project builds. But no depthai-opencv lib or dll files are created nor is DEPTHAI_HAVE_OPENCV_SUPPORT defined.
This is in spite of the fact that when I rancmake -S . -B build -D"BUILD_SHARED_LIBS=ON" -D"OpenCV_DIR=.\opencv\build"
(I copied an opencv build into the depthai directory) the console output confirms that opencv could be found with the following messages:
DEPTHAI_OPENCV_SUPPORT: ON
-- OpenCV ARCH: x64
-- OpenCV RUNTIME: vc16
-- OpenCV STATIC: OFF
-- Found OpenCV 4.11.0 in ./opencv/build/x64/vc16/lib
-- You might need to add .\opencv\build\x64\vc16\bin to your PATH to be able to run your applications.
-- OpenCV and required libraries (opencv_core;opencv_imgproc;opencv_videoio;opencv_highgui) found. OpenCV Support enabled
Hi @Shai!
Sorry for the issues - I've updated the docs on v3_develop
a bit that now show that by default, we don't have the depthai::opencv
target and the depthai::core
but the target is merged into depthai::core
.
I see you've managed to build the library, so the only thing remaining should be to change your target to depthai::core
and you should have the opencv functinoality directly in the depthai::core target.
We'll be adding proper support on Windows shortly.
Where are these v3_develop docs that you are referring to? I was using the ReadMe on GitHub for documentation.
@Shai I meant I update the README.md with the instructions on how to build the library and to change depthai::opencv
to depthai::core
as this is the only target we build by default now.
Ok, I was able to run the examples that are build with the source code. However, when I create a project and link to all the same include directories and .lib files, I get the following error:
'dai::node::MonoCamera::NAME': Use Camera node instead
which is occurring in DeviceNode.hpp line 67. I am using the exact source code for depth_preview.cpp taken directly from "\depthai-core\examples\cpp\StereoDepth".
That deprecetiation warning should have been silenced, but even if it's not, is it actually stopping the compilation?
It should only issue out a warning. Can you paste the whole output?
- Edited
This is what is output while building
1> <path-to-depthai-core-repository>\depthai-core\include\depthai\pipeline\DeviceNode.hpp(67,16): error C4996: 'dai::node::MonoCamera': Use Camera node instead
1>(compiling source file 'src/detection_network.cpp')
1> <path-to-depthai-core-repository>\depthai-core\include\depthai\pipeline\DeviceNode.hpp(67,16):
1> the template instantiation context (the oldest one first) is
1> <path-to-depthai-core-repository>\depthai-core\include\depthai\pipeline\node\MonoCamera.hpp(17,69):
1> see reference to class template instantiation 'dai::DeviceNodeCRTP<dai::DeviceNode,dai::node::MonoCamera,dai::MonoCameraProperties>' being compiled
1> <path-to-depthai-core-repository>\depthai-core\include\depthai\pipeline\DeviceNode.hpp(66,17):
1> while compiling class template member function 'const char *dai::DeviceNodeCRTP<dai::DeviceNode,dai::node::MonoCamera,dai::MonoCameraProperties>::getName(void) const'
1><path-to-depthai-core-repository>\depthai-core\include\depthai\pipeline\DeviceNode.hpp(67,25): error C4996: 'dai::node::MonoCamera::NAME': Use Camera node instead
I have been able to get around it by commenting out #include "node/ColorCamera.hpp"
and #include "node/MonoCamera.hpp"
from pipeline/nodes.hpp.
- Edited
I have been able to connect to the camera and run a few examples.
I've noticed that RVC4 devices no longer have the ObjectTracker node. What has replaced this?
One thing to note is that I may not have set the camera up correctly. I said it was an OAK 4D Pro when setting it up, but it is actually an OAK 4D. However, I don't know how to get it back into its setup state. Is this possible?
That's great, we'll take a look on the integration to visual studio directly internally.
We haven't yet developed the ObjectTracker node on RVC4, is this something you would need for your usecase?
Yes, we need it.
I have been trying to use the SpatialDetectionNetwork in the meantime. However, I am struggling to download the NN model that I want to use openvinotoolkit/open_model_zootree/master/models/intel/face-detection-retail-0004). We used the blobconverter during development on an OAK-D S2, but now it says that the NN blob was built for RCV2. I've tried just putting the following line into the spatial_detection python example: modelDescription = dai.NNModelDescription("face-detection-retail-0004")
. But this gives the error: "No public model found with that slug".
Hi @Shai ,
we have a new model ZOO coming out with RVC4 compatible models. For face detection we would suggest you use either YuNet or SCRFD Face detection model. But both of them are not YOLO based and thus not compatible with SpatialDetectionNetwork node. We do have parsing for these models implemented in depthai-nodes (you can check more about inference here and some examples here) but this is written in Python so if you want to use C++ you would have to rewrite the code in that case. If you want to then get actual spatial detections you would need to perform this computation on the host.
Alternative to all of that would be that you either train or find an already pretrained face detection model that is based on YOLO architecture and thus compatible with DepthAIv3 SpatialDetectionNetwork out of the box. In that case we recommend you use Hub to convert the model to a DLC file that is compatible with RVC4 devices (documentation here).
Hope this helps,
Klemen
Is there a version of depthai-nodes for C++ so that I could translate the examples from Python to C++?
At the moment no. It is on our roadmap to have most used nodes from depthai-nodes natively integrated into DepthAI but this is not yet the case currently.
Can I get an idea of the timeline for these developments? Specifically, the ObjectTracker node and the new model ZOO with RCV4 compatible models?