Skip to content

Commit

Permalink
Updates for OpenCV 4.0.0
Browse files Browse the repository at this point in the history
* syntax changes for opencv 4.0.0 api
* update to android NDKr19 toolchain for CI
  • Loading branch information
headupinclouds committed Apr 22, 2019
1 parent f7ad179 commit c4643c7
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 24 deletions.
16 changes: 8 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,17 +89,17 @@ matrix:
INSTALL=--install
TYPE=polly
- os: osx
osx_image: xcode8.3
env: >
TOOLCHAIN=osx-10-12-sanitize-address-hid-sections
CONFIG=Release
INSTALL=--install
TYPE=polly
# - os: osx
# osx_image: xcode8.3
# env: >
# TOOLCHAIN=osx-10-12-sanitize-address-hid-sections
# CONFIG=Release
# INSTALL=--install
# TYPE=polly

- os: osx
env: >
TOOLCHAIN=android-ndk-r17-api-19-armeabi-v7a-neon-clang-libcxx
TOOLCHAIN=android-ndk-r18b-api-24-arm64-v8a-clang-libcxx11
CONFIG=MinSizeRel
INSTALL=--strip
TYPE=polly
Expand Down
2 changes: 1 addition & 1 deletion src/app/dlib/eyexml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ class DlibDocument
std::stringstream ss;
ss << i;

const int fontFace = CV_FONT_HERSHEY_PLAIN;
const int fontFace = cv::FONT_HERSHEY_PLAIN;
const double fontScale = 2.0;
int thickness = 3, baseline = 0;
const cv::Size textSize = cv::getTextSize(ss.str(), fontFace, fontScale, thickness, &baseline);
Expand Down
2 changes: 1 addition & 1 deletion src/app/fddb/fddbcrop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ int main(int argc, char* argv[])

std::stringstream text;
text << o.occ << " " << o.bb.width;
cv::putText(image, text.str(), o.bb.tl(), CV_FONT_HERSHEY_COMPLEX, 0.5, cv::Scalar::all(255));
cv::putText(image, text.str(), o.bb.tl(), cv::FONT_HERSHEY_COMPLEX, 0.5, cv::Scalar::all(255));
}

glfw::imshow("image", image);
Expand Down
2 changes: 1 addition & 1 deletion src/examples/drishti-upload
Submodule drishti-upload updated 1 files
+1 −1 config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void VideoCaptureList::release()
m_impl->image.release();
}

bool VideoCaptureList::open(const cv::String& filename)
bool VideoCaptureList::open(const cv::String& filename, int /*apiPreference*/)
{
m_impl = detail::make_unique<Impl>(filename);
return !m_impl->image.empty();
Expand All @@ -130,11 +130,11 @@ double VideoCaptureList::get(int propId) const
{
switch (propId)
{
case CV_CAP_PROP_FRAME_WIDTH:
case cv::CAP_PROP_FRAME_WIDTH:
return static_cast<double>(m_impl->image.cols);
case CV_CAP_PROP_FRAME_HEIGHT:
case cv::CAP_PROP_FRAME_HEIGHT:
return static_cast<double>(m_impl->image.rows);
case CV_CAP_PROP_FRAME_COUNT:
case cv::CAP_PROP_FRAME_COUNT:
return static_cast<double>(m_impl->filenames.size());
default:
return 0.0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class VideoCaptureList : public cv::VideoCapture
bool grab() override;
bool isOpened() const override;
void release() override;
bool open(const cv::String& filename) override;
bool open(const cv::String& filename, int apiPreference = cv::CAP_ANY) override;
bool read(cv::OutputArray image) override;
double get(int propId) const override;

Expand Down
4 changes: 2 additions & 2 deletions src/examples/facefilter/app/facefilter/desktop/face.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ int main(int argc, char** argv)
return 1;
}

video->set(CV_CAP_PROP_FRAME_WIDTH, params.videoWidth);
video->set(CV_CAP_PROP_FRAME_HEIGHT, params.videoHeight);
video->set(cv::CAP_PROP_FRAME_WIDTH, params.videoWidth);
video->set(cv::CAP_PROP_FRAME_HEIGHT, params.videoHeight);

cv::Size size = getSize(*video);
if (size.area() == 0)
Expand Down
10 changes: 5 additions & 5 deletions src/lib/drishti/core/padding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "drishti/core/drishti_core.h"

#include <opencv2/imgproc.hpp>
#include <opencv2/videostab.hpp>
#include <opencv2/photo.hpp>

#include <iostream>

Expand All @@ -30,9 +30,9 @@ cv::Point padWithInpainting(const cv::Mat& image, cv::Mat& padded, int top, int
mask = cv::Mat::zeros(padded.size(), CV_8UC1);
mask({ { std::max(left, 0), std::max(top, 0) }, image.size() }).setTo(255);

cv::videostab::ColorAverageInpainter inpainter;
//cv::videostab::ColorInpainter inpainter(cv::INPAINT_TELEA, std::min(image.cols, image.rows)/16.0);
inpainter.inpaint(0, padded, mask);
cv::Mat painted;
cv::inpaint(padded, mask, painted, std::min(image.cols, image.rows)/16.0, cv::INPAINT_TELEA);
cv::swap(padded, painted);

return cv::Point(left, top);
}
Expand Down Expand Up @@ -119,7 +119,7 @@ cv::Mat borderMask(const cv::Mat& image)
void inpaintBorder(const cv::Mat& input, cv::Mat& output, cv::Mat& mask)
{
cv::Mat black;
cv::reduce(input.reshape(1, input.size().area()), black, 1, CV_REDUCE_MAX);
cv::reduce(input.reshape(1, input.size().area()), black, 1, cv::REDUCE_MAX);
black = black.reshape(1, input.rows);

mask = cv::Mat1b::zeros(input.size());
Expand Down
2 changes: 1 addition & 1 deletion src/lib/drishti/face/Face.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ cv::Mat estimateMotionLeastSquares(const FaceModel& a, const FaceModel& b)
CV_Assert(b.noseTip.has);
std::vector<cv::Point2f> ptsB{ b.eyeRightCenter.value, b.eyeLeftCenter.value, b.noseTip.value };

cv::Mat H = cv::videostab::estimateGlobalMotionLeastSquares(ptsA, ptsB, cv::videostab::MM_SIMILARITY);
cv::Mat H = cv::estimateRigidTransform(ptsA, ptsB, false);
if (!H.empty())
{
H.convertTo(H, CV_64F);
Expand Down

0 comments on commit c4643c7

Please sign in to comment.