Reputation: 11
CMakeLists.txt
cmake_minimum_required(VERSION 3.10.0)
cmake_policy(SET CMP0091 NEW)
project(Pixer VERSION 0.1.0 LANGUAGES C CXX)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(WITH_QT OFF)
set(OpenCV_SHARED OFF)
find_package(OpenCV 4.11.0 REQUIRED)
add_executable(Pixer main.cpp)
target_include_directories(Pixer PUBLIC ${OpenCV_INCLUDE_DIRS})
target_link_libraries(Pixer ${OpenCV_LIBS})
CMakePresets.json
"configurePresets": [
{
"name": "Ninja Debug Config",
"displayName": "Ninja Debug Config GCC mingw32(ucrt64)",
"description": "Using compilers: C = C:\\msys64\\ucrt64\\bin\\gcc.exe, CXX = C:\\msys64\\ucrt64\\bin\\g++.exe",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build/NinjaDebug",
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/install/NinjaDebug",
"CMAKE_C_COMPILER": "C:/msys64/ucrt64/bin/gcc.exe",
"CMAKE_CXX_COMPILER": "C:/msys64/ucrt64/bin/g++.exe",
"CMAKE_BUILD_TYPE": "Debug"
}
}
main.cpp
#include <iostream>
#include <string>
#include <sstream>
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include <opencv2/imgproc.hpp>
void trackerCallback(int pos, void *userdata);
void mouseCallback(int event, int x, int y, int flag, void *userdata);
int blur = 10;
int main()
{
cv::Mat color = cv::imread("./image.jpg");
cv::Mat grey = cv::imread("./image.jpg", cv::IMREAD_GRAYSCALE);
if (!color.data || !grey.data)
return 0;
cv::namedWindow("Window", cv::WINDOW_GUI_EXPANDED);
cv::createTrackbar("Tracker", "Window", &blur, 30, trackerCallback, &color);
cv::setMouseCallback("Window", mouseCallback, &color);
trackerCallback(blur, &color);
cv::waitKey(0);
cv::destroyWindow("Window");
return 0;
}
void trackerCallback(int pos, void *userdata)
{
if (pos <= 0)
return;
cv::Mat newImage;
cv::Mat *image = (cv::Mat *)userdata;
cv::blur(*image, newImage, cv::Size(pos, pos));
cv::imshow("Window", newImage);
}
void mouseCallback(int event, int x, int y, int flag, void *userdata)
{
if (event != cv::EVENT_LBUTTONDOWN)
return;
cv::Mat *image = (cv::Mat *)userdata;
cv::circle(*image, cv::Point(x, y), 10, cv::Scalar(255, 0, 0), 3);
trackerCallback(blur, userdata);
}
Expected behavior: No issue when running the program
Actual behavior: Multiple missing procedure entry points in QT6Test.dll, libopencv_highgui-411.dll, libOpenEXR-3_3.dll, Qt6OpenGLWidgets.dll when trying to run the program
Windows Version Microsoft Windows [Version 10.0.22635.4805]
Upvotes: 1
Views: 38