Skip to content

Commit 822f7b8

Browse files
committed
removed opencv from macos
1 parent 52ff0d8 commit 822f7b8

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

relightlab/CMakeLists.txt

+6-1
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ if (APPLE)
1818
set(CMAKE_OSX_DEPLOYMENT_TARGET "11.0" CACHE STRING "Minimum OS X deployment version" FORCE)
1919
SET(CMAKE_INSTALL_RPATH $ORIGIN/../Frameworks)
2020
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
21+
else()
22+
set(OPENCV_RELIGHT_LIBS opencv_core opencv_imgcodecs opencv_imgproc opencv_video)
23+
# add_compile_definitions(WITH_OPENCV)
2124
endif()
2225

2326

2427

28+
29+
2530
set (RELIGHT_HEADERS
2631
processqueue.h
2732
../src/align.h
@@ -188,7 +193,7 @@ target_link_libraries(
188193
${JPEG_LIBRARIES}
189194
TIFF::TIFF
190195
OpenMP::OpenMP_CXX
191-
opencv_core opencv_imgcodecs opencv_imgproc opencv_video
196+
${OPENCV_RELIGHT_LIBS}
192197
${RELIGHT_QT}::Core
193198
${RELIGHT_QT}::Gui
194199
${RELIGHT_QT}::Widgets

relightlab/verifydialog.cpp

+11-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include <QLabel>
1212
#include <QDialogButtonBox>
1313

14+
#ifdef WITH_OPENCV
1415
#include <opencv2/opencv.hpp>
16+
#endif
1517

1618
#include "assert.h"
1719
#include <iostream>
@@ -28,10 +30,14 @@ VerifyDialog::VerifyDialog(std::vector<QImage> &_thumbs, std::vector<QPointF> &_
2830
layout->addLayout(operations_layout);
2931
QPushButton *reset = new QPushButton("Reset");
3032
operations_layout->addWidget(reset);
33+
connect(reset, SIGNAL(clicked()), this, SLOT(resetAligns()));
34+
35+
#ifdef WITH_OPENCV
3136
QPushButton *ecc = new QPushButton("Align");
3237
operations_layout->addWidget(ecc);
33-
connect(reset, SIGNAL(clicked()), this, SLOT(resetAligns()));
38+
3439
connect(ecc, SIGNAL(clicked()), this, SLOT(alignSamples()));
40+
#endif
3541
}
3642
QScrollArea *area = new QScrollArea(this);
3743
layout->addWidget(area);
@@ -65,14 +71,16 @@ void VerifyDialog::resetAligns() {
6571
p = QPointF(0, 0);
6672
update();
6773
}
68-
74+
#ifdef WITH_OPENCV
6975
cv::Mat qimg2mat(QImage img) {
7076
QImage gray = img.convertToFormat(QImage::Format_Grayscale8);
7177
return cv::Mat(gray.height(), gray.width(), CV_8UC1,
7278
const_cast<uchar*>(gray.bits()), gray.bytesPerLine()).clone();
7379
}
80+
#endif
7481

7582
void VerifyDialog::alignSamples() {
83+
#ifdef WITH_OPENCV
7684
if (positions.empty()) return;
7785

7886
cv::Mat ref = qimg2mat(thumbs[0]);
@@ -90,6 +98,7 @@ void VerifyDialog::alignSamples() {
9098
}
9199
}
92100
update();
101+
#endif
93102
}
94103

95104
void VerifyDialog::update() {

0 commit comments

Comments
 (0)