-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from khoben/android-update
Android update
- Loading branch information
Showing
40 changed files
with
1,593 additions
and
530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,5 @@ | |
/build | ||
/captures | ||
.externalNativeBuild | ||
/cv42 | ||
/opencv* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# How to run | ||
1) Download appreciate opencv version [(4.2.0)](https://sourceforge.net/projects/opencvlibrary/files/4.2.0/opencv-4.2.0-android-sdk.zip/download) | ||
2) [Import](https://android.jlelse.eu/a-beginners-guide-to-setting-up-opencv-android-library-on-android-studio-19794e220f3c) opencv sdk as module | ||
3) Try to build it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package com.khoben.arcore; | ||
|
||
public class OpenCVJNI { | ||
public static native int start(long matAddrRgba, long matAddrGray); | ||
public static native int process(long matAddrRgba, long matAddrGray); | ||
public static native int init(long matAddrRgba); | ||
public static native int addMarker(long matAddrRgba); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
include ':app', ':opencv410' | ||
include ':app', ':opencv42' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#ifndef AR_CORE_AR_HPP | ||
#define AR_CORE_AR_HPP | ||
|
||
#include "../Tracking/Tracker.hpp" | ||
#include "../Detection/DetectMarkerless.hpp" | ||
|
||
/** | ||
* Base class AR | ||
*/ | ||
class AR { | ||
protected: | ||
// scale factor for queryMat | ||
float scale; | ||
// scaled mat for querying | ||
cv::Mat queryMat; | ||
// masked mat for querying | ||
cv::Mat maskedMat; | ||
// size of queryMat (w x h) | ||
cv::Size querySize; | ||
|
||
// tracking instances | ||
std::vector<std::pair<QueryItem, std::unique_ptr<Tracker>>> trackingItems; | ||
// recognition instance | ||
std::shared_ptr<Detect> recognitionInstance; | ||
|
||
public: | ||
/** | ||
* @brief Initialize AR instance: set querying image size | ||
* | ||
* @param frameSize source frame size | ||
* @param maxSize maximum size of querying image in pixels | ||
* for one of sides | ||
*/ | ||
virtual void init(const cv::Size &frameSize, int maxSize) = 0; | ||
|
||
/** | ||
* @brief Start recognition&tracking process | ||
* | ||
* @param frame Frame | ||
* @return std::vector<QueryItem> Result | ||
*/ | ||
virtual std::vector<QueryItem> process(const cv::Mat &frame) = 0; | ||
|
||
/** | ||
* @brief Add marker image | ||
* | ||
* @param img Marker image | ||
* @return int | ||
*/ | ||
virtual int add(const cv::Mat &img) = 0; | ||
|
||
/** | ||
* @brief Add marker image objects | ||
* | ||
* @param imgs marker images | ||
* @return int | ||
*/ | ||
virtual int addAll(const std::vector<cv::Mat> &imgs) = 0; | ||
|
||
float getScale() { | ||
return scale; | ||
} | ||
}; | ||
|
||
|
||
#endif //AR_CORE_AR_HPP |
Oops, something went wrong.