0

我正在尝试通过使用注册回调函数来检索 TANGO_CAMERA_COLOR 图像像素数据

static void onFrameAvailable( void* context, const TangoCameraId id, const TangoImageBuffer* buffer )
{

    LOGVI( "\nGOOGLE TANGO FRAME AVAILABLE" );

}

...

if(TangoService_connectOnFrameAvailable( TANGO_CAMERA_COLOR, NULL, onFrameAvailable ) == TANGO_SUCCESS)
{
    LOGVI( "\nGOOGLE TANGO ONFRAMEAVAILABLE CONNECTED" );
}

我实际上将我的成功日志作为输出,但从未调用过回调函数

输出:

01-13 12:04:02.655: I/tango_client_api(187): Tango Service: connect, internal status 0
01-13 12:04:02.655: I/VR(8529): GOOGLE TANGO CONNECTED
01-13 12:04:02.655: I/VR(8529): GOOGLE TANGO EVENT HANDLER CONNECTED
01-13 12:04:02.656: I/tango_client_api(187): Tango Service: getCameraIntrinsics, internal status 0
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE WIDTH 1280
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE HEIGHT 720
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE FOCAL X 1039.630000
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE FOCAL Y 1039.900000
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE PRINCIPAL X 634.922000
01-13 12:04:02.656: I/VR(8529): GOOGLE TANGO CAMERA IMAGE PRINCIPAL Y 362.981000
01-13 12:04:02.656: I/tango_client_api(187): Tango Service: connectSurface, internal status 0
01-13 12:04:02.657: I/VR(8529): GOOGLE TANGO ONFRAMEAVAILABLE CONNECTED
01-13 12:04:02.694: I/chromium(8529): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported
01-13 12:04:02.823: I/Camera3-OutputStream(168): enqueue first Preview frame or first video frame
01-13 12:04:02.825: I/native-camera(187): Dropping VGA with too much latency 92240.015085 > 0.000000 + 2 * 0.033328
01-13 12:04:02.899: I/native-camera(187): VGA Stats: 3 frames, 0 locked_buffer_drops, 0 sensor_hub_drops, 1 ambiguous, 0 feature_tracking_drops
01-13 12:04:02.899: I/native-camera(187): COLOR Stats: 0 frames, 0 locked_buffer_drops, 0 sensor_hub_drops, 0 ambiguous

... what follows are only event notifications like FisheyeUnderExposed, TooFewFeaturesTracked

我正在使用 C-API 版本的笛卡尔。清单中的权限已定义。回调工作需要什么(初始化、连接、..)?

4

2 回答 2

1

值得检查的一件事是许可。要使用彩色相机,您需要将相机权限添加到清单文件中。

于 2015-01-12T19:57:00.047 回答
1

尝试构建增强现实 C 示例 - 我将它(很差)破解以完全做到这一点并且它工作正常 - AquireTangoImage 被调用(我砍掉了胆量,因为调用发生了,然后我无法更新纹理:-)) - ConnectTexture 是原始示例的一部分,我刚刚添加了辅助 connectOnFrameAvailable - 请注意,至少根据我的经验,一旦您开始获取回调,您就会停止获取纹理更新:-(

GLuint cached_single_texture_id;
void AcquireTangoImage(void *context, TangoCameraId id, const TangoImageBuffer *buffer)
{
    TangoData* td = (TangoData*)context;


}
void TangoData::ConnectTexture(GLuint texture_id) {
    cached_single_texture_id = texture_id;
  if (TangoService_connectTextureId(TANGO_CAMERA_COLOR, texture_id, nullptr,
                                    nullptr) == TANGO_SUCCESS) {
    LOGI("TangoService_connectTextureId(): Success!");
  } else {
    LOGE("TangoService_connectTextureId(): Failed!");
  }
  if (TangoService_connectOnFrameAvailable(TANGO_CAMERA_COLOR, this, AcquireTangoImage) == TANGO_SUCCESS) {
      LOGI("TangoService_connectOnFrameAvailable(): Success!");
  }
  else {
      LOGE("TangoService_connectOnFrameAvailable(): Failed!");
  }
}
于 2015-01-16T13:26:44.917 回答