From 59b1e78dd7feda64c9d34bc1ca95c82aef2ab482 Mon Sep 17 00:00:00 2001 From: Pascal Zingg Date: Mon, 3 Apr 2017 08:40:25 +0200 Subject: [PATCH] Load stones.jpg for Android correctly --- .../textures/{planartracking.jpg => stones.jpg} | Bin app-Demo-Android/app/CMakeLists.txt | 3 ++- lib-SLProject/source/CV/SLCVTrackerFeatures.cpp | 8 ++++---- 3 files changed, 6 insertions(+), 5 deletions(-) rename _data/images/textures/{planartracking.jpg => stones.jpg} (100%) diff --git a/_data/images/textures/planartracking.jpg b/_data/images/textures/stones.jpg similarity index 100% rename from _data/images/textures/planartracking.jpg rename to _data/images/textures/stones.jpg diff --git a/app-Demo-Android/app/CMakeLists.txt b/app-Demo-Android/app/CMakeLists.txt index 748cad0ab..e462d14af 100644 --- a/app-Demo-Android/app/CMakeLists.txt +++ b/app-Demo-Android/app/CMakeLists.txt @@ -205,7 +205,8 @@ file(GLOB_RECURSE TEXTURES ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/t ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/wood*.jpg ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/cursor.png ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/Vision*.png - ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/LiveVideoError.png) + ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/LiveVideoError.png, + ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/textures/stones.jpg) file(GLOB_RECURSE FONTS ${CMAKE_CURRENT_SOURCE_DIR}/../../_data/images/fonts/*.png) diff --git a/lib-SLProject/source/CV/SLCVTrackerFeatures.cpp b/lib-SLProject/source/CV/SLCVTrackerFeatures.cpp index 745136cc7..2caf0ea31 100644 --- a/lib-SLProject/source/CV/SLCVTrackerFeatures.cpp +++ b/lib-SLProject/source/CV/SLCVTrackerFeatures.cpp @@ -81,10 +81,10 @@ SLCVTrackerFeatures::SLCVTrackerFeatures(SLNode *node) : //------------------------------------------------------------------------------ void SLCVTrackerFeatures::loadModelPoints() { - // Read marker - //TODO: Loading for Android - Mat planartracking = imread("../_data/images/textures/planartracking.jpg"); - cvtColor(planartracking, _map.frameGray, CV_RGB2GRAY); + // Read reference marker + SLGLTexture trackerTexture("stones.jpg"); + SLCVImage* img = trackerTexture.images()[0]; + cvtColor(img->cvMat(), _map.frameGray, CV_RGB2GRAY); // Detect and compute features in marker image SLScene::current->_detector->detect(_map.frameGray, _map.keypoints);