Skip to content

Commit

Permalink
processFrameData now may process also RGB data input
Browse files Browse the repository at this point in the history
  • Loading branch information
kalwalt committed Nov 10, 2023
1 parent f6dfcbc commit 218eda8
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class WebARKitTracker::WebARKitTrackerImpl {
WEBARKIT_LOGi("Init Tracker!\n");

cv::Mat refGray;

if (colorSpace == ColorSpace::RGBA) {
cv::Mat colorFrame(refRows, refCols, CV_8UC4, refData);
refGray.create(refRows, refCols, CV_8UC1);
Expand All @@ -66,10 +67,6 @@ class WebARKitTracker::WebARKitTrackerImpl {
refGray = cv::Mat(refRows, refCols, CV_8UC1, refData);
}

WEBARKIT_LOGi("Gray data ok!\n");

//cv::Mat refGray(refRows, refCols, CV_8UC1, refData);

cv::Mat trackerFeatureMask = createTrackerFeatureMask(refGray);

this->_featureDetector->detect(refGray, refKeyPts, trackerFeatureMask);
Expand Down Expand Up @@ -119,6 +116,10 @@ class WebARKitTracker::WebARKitTrackerImpl {
cv::Mat colorFrame(frameRows, frameCols, CV_8UC4, frameData);
grayFrame.create(frameRows, frameCols, CV_8UC1);
cv::cvtColor(colorFrame, grayFrame, cv::COLOR_RGBA2GRAY);
} else if (colorSpace == ColorSpace::RGB) {
cv::Mat colorFrame(frameRows, frameCols, CV_8UC3, frameData);
grayFrame.create(frameRows, frameCols, CV_8UC1);
cv::cvtColor(colorFrame, grayFrame, cv::COLOR_RGB2GRAY);
} else if (colorSpace == ColorSpace::GRAY) {
grayFrame = cv::Mat(frameRows, frameCols, CV_8UC1, frameData);
}
Expand Down

0 comments on commit 218eda8

Please sign in to comment.