Skip to content

Commit cfdb70b

Browse files
committed
progress getting rid of opencv
1 parent 815deac commit cfdb70b

33 files changed

+43
-290
lines changed

.lgtm.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ extraction:
1010
- "cmake"
1111
- "libwxgtk3.0-dev"
1212
- "libwxgtk3.0-gtk3-dev"
13-
- "libopencv-dev"
1413
- "libeigen3-dev"
1514
- "libgtest-dev"
1615
- "libftdi1-dev"
@@ -23,7 +22,6 @@ extraction:
2322
- "libavformat-dev"
2423
- "libswscale-dev"
2524
- "libassimp-dev"
26-
- "libjpeg-dev"
2725
- "libsuitesparse-dev"
2826
- "libpcap-dev"
2927
- "liboctomap-dev"

apps/features-matching/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ add_executable(${PROJECT_NAME}
1818
${MRPT_VERSION_RC_FILE}
1919
)
2020

21-
# Add the required libraries for linking:
22-
target_link_libraries(${PROJECT_NAME} imp_opencv)
23-
2421
# Dependencies on MRPT libraries:
2522
# Just mention the top-level dependency, the rest will be detected automatically,
2623
# and all the needed #include<> dirs added (see the script DeclareAppDependencies.cmake for further details)

apps/mrpt-performance/perf-feature_matching.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,8 @@ void register_tests_feature_matching()
267267
"feature_matching [640x480]: Harris + CC", feature_matching_test_Harris_CC, 640, 480);
268268
lstTests.emplace_back(
269269
"feature_matching [640x480]: Harris + SAD", feature_matching_test_Harris_SAD, 640, 480);
270-
#if 0 // crash in opencv 3.1?
271-
lstTests.push_back( TestData("feature_matching [640x480]: SIFT", feature_matching_test_SIFT, 640, 480 ) );
272-
#endif
270+
lstTests.push_back(
271+
TestData("feature_matching [640x480]: SIFT", feature_matching_test_SIFT, 640, 480));
273272
lstTests.emplace_back("feature_matching [640x480]: SURF", feature_matching_test_SURF, 640, 480);
274273
lstTests.emplace_back(
275274
"feature_matching [640x480]: FAST + CC", feature_matching_test_FAST_CC, 640, 480);

apps/mrpt-performance/perf-images.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ double image_test_2(int w, int h)
159159
{
160160
CImage img(w, h, mrpt::img::CH_RGB), img2;
161161

162-
#if MRPT_HAS_OPENCV
163-
// int oldVal = cvUseOptimized(1);
164-
#endif
165-
166162
for (int i = 0; i < 5000; i++)
167163
img.line(
168164
getRandomGenerator().drawUniform(0, w - 1), getRandomGenerator().drawUniform(0, h - 1),
@@ -178,9 +174,6 @@ double image_test_2(int w, int h)
178174

179175
double R = tictac.Tac() / N;
180176

181-
#if MRPT_HAS_OPENCV
182-
// cvUseOptimized(oldVal);
183-
#endif
184177
return R;
185178
}
186179

apps/track-video-features/CMakeLists.txt

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ add_executable(${PROJECT_NAME}
1818
${MRPT_VERSION_RC_FILE}
1919
)
2020

21-
# Add the required libraries for linking:
22-
target_link_libraries(${PROJECT_NAME} imp_opencv)
23-
2421
# Dependencies on MRPT libraries:
2522
# Just mention the top-level dependency, the rest will be detected automatically,
2623
# and all the needed #include<> dirs added (see the script DeclareAppDependencies.cmake for further details)

appveyor.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ build_script:
3535
- dir
3636

3737
install:
38-
# ====== Install OpenCV
39-
- choco upgrade chocolatey
40-
- choco install opencv -y
41-
- tree c:\tools\opencv\build /F
42-
- set OPENCVDIR=C:\tools\opencv\build\
43-
# This variable is parsed by MRPT/cmakemodules/script_opencv.cmake:
44-
- set OPENCV_DLLS_TO_INSTALL_DIRS=%OPENCVDIR%bin;%OPENCVDIR%x64\vc16\bin
45-
- set PATH=%PATH%;%OPENCVDIR%\bin;%OPENCVDIR%\x64\vc16\bin
4638
# ====== Install wxWidgets
4739
- cd c:\
4840
- ps: Start-FileDownload 'https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.3/wxMSW-3.1.3_vc14x_x64_Dev.7z'
@@ -69,7 +61,7 @@ before_build:
6961
# AppVeyor has a 90 minutes limit: disable some parts.
7062
- cmake -S. -Bbuild -G "Visual Studio 16 2019" \
7163
-DMRPT_EIGEN_USE_EMBEDDED_VERSION=ON -DMRPT_BUILD_ASSIMP=OFF \
72-
-DOpenCV_DIR=%OPENCVDIR% -DwxWidgets_ROOT_DIR=%WXWIDGETSDIR% -DwxWidgets_LIB_DIR=%WXWIDGETSLIBDIR% \
64+
-DwxWidgets_ROOT_DIR=%WXWIDGETSDIR% -DwxWidgets_LIB_DIR=%WXWIDGETSLIBDIR% \
7365
-DBUILD_APP_DifOdometry-Camera=OFF -DBUILD_APP_DifOdometry-Datasets=OFF \
7466
-DBUILD_APP_benchmarking-image-features=OFF \
7567
-DBUILD_APP_carmen2rawlog=OFF \

cmakemodules/DeclareMRPTLib.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,6 @@ macro(internal_define_mrpt_lib name headers_only )
368368
else()
369369
# Use cotire module for GCC/CLANG:
370370
list(APPEND COTIRE_PREFIX_HEADER_IGNORE_PATH
371-
"${OpenCV_INCLUDE_DIR}"
372371
"${MRPT_LIBS_ROOT}/${name}/src"
373372
"/usr/" # avoid problems with Cotire trying to include internal GCC headers, not suitable for direct use.
374373
)

cmakemodules/script_show_final_summary.cmake

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,6 @@ SHOW_CONFIG_LINE_SYSTEM("jsoncpp (JSON format serialization) " CMAKE_MRPT_HAS_JS
133133
SHOW_CONFIG_LINE_SYSTEM("libjpeg (jpeg) " CMAKE_MRPT_HAS_JPEG)
134134
SHOW_CONFIG_LINE ("mexplus " CMAKE_MRPT_HAS_MATLAB)
135135
SHOW_CONFIG_LINE_SYSTEM("Octomap " CMAKE_MRPT_HAS_OCTOMAP "[Version: ${OCTOMAP_VERSION}]")
136-
SHOW_CONFIG_LINE_SYSTEM("OpenCV (Image manipulation) " CMAKE_MRPT_HAS_OPENCV "[Version: ${MRPT_OPENCV_VERSION}]")
137136
SHOW_CONFIG_LINE_SYSTEM("OpenGL " CMAKE_MRPT_HAS_OPENGL_GLUT)
138137
SHOW_CONFIG_LINE_SYSTEM("OpenGL EGL " CMAKE_MRPT_HAS_EGL "[Version: ${EGL_VERSION}]")
139138
SHOW_CONFIG_LINE_SYSTEM("OpenGL GLES " CMAKE_MRPT_HAS_GLES "[Version: ${GLESV2_VERSION}]")
@@ -189,13 +188,3 @@ SHOW_CONFIG_LINE_SYSTEM("xSENS MT " CMAKE_MRPT_HAS_xS
189188
SHOW_CONFIG_LINE_SYSTEM("Intersense sensors " CMAKE_MRPT_HAS_INTERSENSE)
190189
message(STATUS "")
191190

192-
# Final warnings:
193-
if (NOT CMAKE_MRPT_HAS_OPENCV AND NOT DISABLE_OPENCV)
194-
message(STATUS "")
195-
message(STATUS "***********************************************************************")
196-
message(STATUS "* WARNING: It's STRONGLY recommended to build MRPT with OpenCV support.")
197-
message(STATUS "* To do so, set OpenCV_DIR to its CMake build dir. If you want to go ")
198-
message(STATUS "* on without OpenCV, proceed to build instead. ")
199-
message(STATUS "***********************************************************************")
200-
message(STATUS "")
201-
endif()

doc/source/Doxyfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2094,7 +2094,6 @@ PREDEFINED = MRPT_HAS_SSE2 \
20942094
MRPT_HAS_SSE4 \
20952095
MRPT_HAS_MATLAB=1 \
20962096
MRPT_HAS_WXWIDGETS=1 \
2097-
MRPT_HAS_OPENCV=1 \
20982097
MRPT_HAS_NANOGUI=1
20992098

21002099
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this

doc/source/compiling.rst

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,8 @@ Minimum compiler requisites:
3333
3434
# All Ubuntu versions:
3535
sudo apt install build-essential pkg-config cmake \
36-
libopencv-dev libeigen3-dev zlib1g-dev \
37-
libsuitesparse-dev libjpeg-dev
38-
36+
libeigen3-dev zlib1g-dev
37+
3938
# plus, only for Ubuntu < 22.10:
4039
sudo apt install libwxgtk3.0-gtk3-dev
4140
@@ -127,12 +126,6 @@ Minimum compiler requisites:
127126
nmake -f makefile.vc BUILD=release SHARED=1 RUNTIME_LIBS=dynamic DEBUG_INFO=0 VENDOR=mrpt USE_OPENGL=1 TARGET_CPU=amd64
128127
nmake -f makefile.vc BUILD=debug SHARED=1 RUNTIME_LIBS=dynamic DEBUG_INFO=1 VENDOR=mrpt USE_OPENGL=1 TARGET_CPU=amd64
129128
130-
**OpenCV (Optional, but strongly recommended)**
131-
132-
Download the `latest OpenCV release <https://github.com/opencv/opencv/releases/latest>`_
133-
either as source code and compile it, or (easier) install the provided
134-
``opencv-x.y.z-vcZZ.exe`` installer.
135-
136129
**FFmpeg for Win32 (Optional)**
137130

138131
These libraries are optional, you will need them only if you plan to read

doc/source/doxygen-docs/dependencies.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,6 @@ https://www.mrpt.org/Matrices_vectors_arrays_and_Linear_Algebra_MRPT_and_Eigen_c
1515

1616
## 2. Optional but strongly recommended
1717

18-
### `opencv`
19-
20-
This is used for almost everything related to computer vision in MRPT.
21-
Even MRPT-specific computer vision functions or classes cannot work without
22-
OpenCV since the basic structure for holding images is OpenCV's `cv::Mat`.
23-
24-
If not present, the following classes will raise an exception upon usage:
25-
- mrpt::img::CImage. Note that creating mrpt::img::CImage objects in the "external storage mode" will not raise an exception unless you really access the image contents.
26-
- Everything needing access to an image (loading, saving, processing, etc.).
27-
28-
2918
### `wxwidgets`
3019

3120
If this library is not present in the system, the following will raise an exception upon usage:

doc/source/doxygen-docs/lib_mrpt_img.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Find below some examples of use.
1919

2020
## Image handling
2121

22-
The class mrpt::img::CImage represents a wrapper around OpenCV images, plus
23-
extra functionality such as on-the-fly loading of images stored in disk upon
24-
first usage. The `cv::Mat` object is always available so
25-
OpenCV's functions can be still used to operate on MRPT images.
22+
The class mrpt::img::CImage is a custom, portable image container, including
23+
basic functionality like image loading, saving, and manipulation.
2624

25+
In MRPT 3.0.0 it was ported away from OpenCV so we do not depend
26+
on opencv at all for building or running.
2727

2828
# Library contents

modules/mrpt_apps-cli/src/RawlogGrabberApp_unittest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#include <cstdlib>
1919
#include <thread>
2020

21-
#if MRPT_HAS_FFMPEG && MRPT_HAS_OPENCV
21+
#if MRPT_HAS_FFMPEG
2222
TEST(RawlogGrabberApp, CGenericCamera_AVI)
2323
#else
2424
TEST(RawlogGrabberApp, DISABLED_CGenericCamera_AVI)

modules/mrpt_apps-gui/src/CGridMapAligner_unittest.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,7 @@
1515
#include <mrpt/system/filesystem.h>
1616
#include <test_mrpt_common.h>
1717

18-
#if MRPT_HAS_OPENCV
1918
TEST(CGridMapAligner, alignGridMaps)
20-
#else
21-
TEST(CGridMapAligner, DISABLED_alignGridMaps)
22-
#endif
2319
{
2420
const std::string ini_fil =
2521
mrpt::UNITTEST_BASEDIR() +

modules/mrpt_apps-gui/src/ICP_SLAM_App_unittest.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ void generic_icp_slam_test(
4848
"MappingApplication", "logOutput_dir", mrpt::system::getTempFileName() + "_dir"s);
4949
app.params.write("MappingApplication", "SHOW_PROGRESS_3D_REAL_TIME", false);
5050

51-
#if !MRPT_HAS_OPENCV
52-
app.params.write("MappingApplication", "SAVE_3D_SCENE", false);
53-
app.params.write("MappingApplication", "LOG_FREQUENCY", 0);
54-
#endif
55-
5651
cfg_changer(app.params);
5752
app.run();
5853

modules/mrpt_apps-gui/src/MonteCarloLocalization_App_unittest.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ void generic_pf_test(
5757
app.fill_out_estimated_path = true;
5858
app.allow_quit_on_esc_key = false;
5959

60-
#if !MRPT_HAS_OPENCV
61-
app.params.write(MCL::sect, "3DSceneFrequency", -1);
62-
app.params.write(MCL::sect, "LOG_FREQUENCY", 0);
63-
#endif
64-
6560
cfg_changer(app.params);
6661
app.run();
6762

modules/mrpt_apps-gui/src/RBPF_SLAM_App_unittest.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,6 @@ void generic_rbpf_slam_test(
4848
"MappingApplication", "logOutput_dir", mrpt::system::getTempFileName() + "_dir"s);
4949
app.params.write("MappingApplication", "SHOW_PROGRESS_IN_WINDOW", false);
5050

51-
#if !MRPT_HAS_OPENCV
52-
app.params.write("MappingApplication", "SAVE_3D_SCENE", false);
53-
app.params.write("MappingApplication", "LOG_FREQUENCY", 0);
54-
#endif
55-
5651
cfg_changer(app.params);
5752
app.run();
5853

modules/mrpt_gui/src/CAboutBoxBase.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ std::string CAboutBoxBase::information(
7777
#else
7878
str += "-ANSI build";
7979
#endif // wxUSE_UNICODE
80-
81-
str += "\nOpenCV version: ";
82-
#if MRPT_HAS_OPENCV
83-
str += MRPT_OPENCV_VERSION;
84-
str += "\n";
85-
#else
86-
str += "None";
87-
str += "\n";
88-
#endif
8980
}
9081

9182
return str;

modules/mrpt_gui/src/CDisplayWindowGUI.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@
1414
#include <mrpt/gui/config.h>
1515
#include <mrpt/gui/default_mrpt_glfw_icon.h>
1616

17-
#if MRPT_HAS_OPENCV
18-
#include <mrpt/3rdparty/do_opencv_includes.h>
19-
#endif
20-
2117
using namespace mrpt::gui;
2218

2319
#if MRPT_HAS_NANOGUI
@@ -107,7 +103,6 @@ void CDisplayWindowGUI::setWindowTitle(const std::string& str) { Screen::setCapt
107103

108104
void CDisplayWindowGUI::setIcon(const mrpt::img::CImage& img)
109105
{
110-
#if MRPT_HAS_OPENCV
111106
const cv::Mat& cvIn = img.asCvMatRef();
112107

113108
// We need the image to be in RGBA format:
@@ -139,8 +134,6 @@ void CDisplayWindowGUI::setIcon(const mrpt::img::CImage& img)
139134
#if GLFW_VERSION_MAJOR > 3 || (GLFW_VERSION_MAJOR == 3 && GLFW_VERSION_MINOR >= 2)
140135
glfwSetWindowIcon(screen()->glfwWindow(), 1, &images);
141136
#endif
142-
143-
#endif
144137
}
145138

146139
void CDisplayWindowGUI::setIconFromData(

modules/mrpt_gui/src/WxUtils.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ using namespace std;
2424

2525
wxImage* mrpt::gui::MRPTImage2wxImage(const mrpt::img::CImage& img)
2626
{
27-
#if MRPT_HAS_OPENCV
2827
using namespace std::string_literals;
2928

3029
mrpt::img::CImage new_image(img, mrpt::img::SHALLOW_COPY);
@@ -63,21 +62,14 @@ wxImage* mrpt::gui::MRPTImage2wxImage(const mrpt::img::CImage& img)
6362

6463
// create and return the object
6564
return new wxImage(w, h, data, false /* false=transfer mem ownership */);
66-
#else
67-
THROW_EXCEPTION("MRPT compiled without OpenCV");
68-
#endif
6965
}
7066

7167
wxBitmap* mrpt::gui::MRPTImage2wxBitmap(const mrpt::img::CImage& img)
7268
{
73-
#if MRPT_HAS_OPENCV
7469
auto* i = MRPTImage2wxImage(img);
7570
auto ret = new wxBitmap(*i);
7671
delete i;
7772
return ret;
78-
#else
79-
THROW_EXCEPTION("MRPT compiled without OpenCV");
80-
#endif
8173
}
8274

8375
//------------------------------------------------------------------------

modules/mrpt_hwdrivers/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,6 @@ if(TARGET mrpt_xsens)
8282
target_link_libraries(hwdrivers PRIVATE mrpt_xsens)
8383
endif()
8484

85-
if(CMAKE_MRPT_HAS_OPENCV)
86-
target_link_libraries(hwdrivers PRIVATE imp_opencv)
87-
endif()
88-
8985
if(CMAKE_MRPT_HAS_LIBPCAP)
9086
target_link_libraries(hwdrivers PRIVATE ${PCAP_LIBRARY})
9187

modules/mrpt_img/config.h.in

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,6 @@
1212

1313
// clang-format off
1414

15-
/** Has MRPT libjpeg? And whether it's in the system (Linux) or built-in (Windows, some rare cases in Linux). */
16-
#define MRPT_HAS_JPEG ${CMAKE_MRPT_HAS_JPEG}
17-
#define MRPT_HAS_JPEG_SYSTEM ${CMAKE_MRPT_HAS_JPEG_SYSTEM}
18-
19-
/** Includes the OpenCV library, required for image manipulation. */
20-
#define MRPT_HAS_OPENCV ${CMAKE_MRPT_HAS_OPENCV}
21-
22-
// Version as text:
23-
#define MRPT_OPENCV_VERSION "${MRPT_OPENCV_VERSION}"
24-
25-
// Version as hexadecimal number: eg. 1.0.0 -> 0x100
26-
#define MRPT_OPENCV_VERSION_NUM ${MRPT_OPENCV_VERSION_HEX}
27-
2815
/** Enable Katakana, Hiragana & Kanji character sets in mrpt::img::CCanvas.
2916
* Disable this to save executable sizes if these fonts will be not used. */
3017
#define MRPT_HAS_ASIAN_FONTS ${CMAKE_MRPT_HAS_ASIAN_FONTS}

0 commit comments

Comments
 (0)