git clone https://github.com/MqCreaple/xDIMScreen-locator
cd xDIMScreen-locator
git submodule update --init --recursive
Since this project uses the opencv
package, you need to first install OpenCV on your computer. Please follow the documentation on opencv-rust: https://github.com/twistedfall/opencv-rust/blob/master/INSTALL.md.
If you are using Windows, you need to set OPENCV_LINK_LIBS
, OPENCV_LINK_PATHS
, and OPENCV_INCLUDE_PATHS
in your environmental variables. Please check according to the documentation of opencv-rust. You can do this by creating a file at .cargo/config.toml
:
[env]
OPENCV_LINK_LIBS = "opencv_world4120"
OPENCV_LINK_PATHS = "D:\\opencv\\build\\x64\\vc16\\lib"
OPENCV_INCLUDE_PATHS = "D:\\opencv\\build\\include"
After adding everything to the environmental variables, make sure to build the crate again.
cargo build
If you encounter any problem related to OpenCV, please refer to the troubleshooting page at opencv-rust.
cd ext/apriltag
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DBUILD_PYTHON_WRAPPER=OFF -DBUILD_EXAMPLES=OFF -DBUILD_TESTING=OFF ..
cmake --build . --config Release
After building the library, you need to add ext/apriltag/build/
or ext/apriltag/build/Release/
(depending on the compiler you used) to your operating system's PATH
variable and then restart your computer, or the program might not find the correct dll to link.
After finishing all steps above, you can directly run the locator by:
cargo run --bin xDIMScreen_locator --release
This will automatically build the project in release mode and start running after the build finishes. If you are building it for the first time, it might take 10 to 30 minutes.