Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP - converting to OpenCL - 1 test #3

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Source/ARX/OCVT/PlanarTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,10 @@ class PlanarTracker::PlanarTrackerImpl
info.fileName = _trackables[i]._fileName;
// Copy the image data and use a shared_ptr to refer to it.
unsigned char *data = (unsigned char *)malloc(_trackables[i]._width * _trackables[i]._height);
memcpy(data, _trackables[i]._image.ptr(), _trackables[i]._width * _trackables[i]._height);
/// this needs to be verifyed!!
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only a test, completely not sure of.

cv::Mat dataPtr(_trackables[i]._width, _trackables[i]._height, CV_8UC4, data);
_trackables[i]._image = dataPtr.getUMat(cv::ACCESS_READ);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should do the reverse!, we will have to fill in the data from the trackables to image data, so it doesn't work

//memcpy(data, _trackables[i]._image.ptr(), _trackables[i]._width * _trackables[i]._height);
info.imageData.reset(data, free);
info.width = _trackables[i]._width;
info.height = _trackables[i]._height;
Expand Down