绕过 Vuforia 对相机图像和姿势的处理
Bypass Vuforia's handling of the camera image and pose
我想在 iOS 上绕过 Vuforia 对相机图像和帧标记姿势的显示处理,这可能吗?
在- (void)QCAR_onUpdate:(QCAR::State *)state
中,您可以获取相机数据和标记姿势。
相机图像数据
QCAR::Frame frame = state->getFrame();
for (int i = 0; i < frame.getNumImages(); i++) {
const QCAR::Image *image = frame.getImage(i);
if (image->getFormat() == kQCARFrameFormat) {
const void *pixelData = image->getPixels();
int width = image->getWidth();
int height = image->getHeight();
}
}
标记姿势
NSMutableArray *mutableFramemarkers = [[NSMutableArray alloc] initWithCapacity:state->getNumTrackableResults()];
for (int i = 0; i < state->getNumTrackableResults(); i++) {
const QCAR::TrackableResult *trackableResult = state->getTrackableResult(i);
const QCAR::MarkerResult *markerResult = static_cast<const QCAR::MarkerResult *>(trackableResult);
const QCAR::Marker &marker = markerResult->getTrackable();
QCAR::Matrix44F qcarPose = QCAR::Tool::convertPose2GLMatrix(trackableResult->getPose());
}
我想在 iOS 上绕过 Vuforia 对相机图像和帧标记姿势的显示处理,这可能吗?
在- (void)QCAR_onUpdate:(QCAR::State *)state
中,您可以获取相机数据和标记姿势。
相机图像数据
QCAR::Frame frame = state->getFrame();
for (int i = 0; i < frame.getNumImages(); i++) {
const QCAR::Image *image = frame.getImage(i);
if (image->getFormat() == kQCARFrameFormat) {
const void *pixelData = image->getPixels();
int width = image->getWidth();
int height = image->getHeight();
}
}
标记姿势
NSMutableArray *mutableFramemarkers = [[NSMutableArray alloc] initWithCapacity:state->getNumTrackableResults()];
for (int i = 0; i < state->getNumTrackableResults(); i++) {
const QCAR::TrackableResult *trackableResult = state->getTrackableResult(i);
const QCAR::MarkerResult *markerResult = static_cast<const QCAR::MarkerResult *>(trackableResult);
const QCAR::Marker &marker = markerResult->getTrackable();
QCAR::Matrix44F qcarPose = QCAR::Tool::convertPose2GLMatrix(trackableResult->getPose());
}