ARCore:从frame.acquireCameraImage访问摄像机图像数据

时间:2018-04-18 13:44:28

标签: rendering augmented-reality arcore

我有一个Java应用程序需要从ARCore获取相机图像以进行自定义渲染。最近,ARCore(v1.1.0)中增加了两个新的API,它们应该支持这一点。好吧,除了这两个电话,其他一切都适合我。两个调用都失败并出现相同的错误(SIGINIT): SIGINIT

我在Logcat中有这条消息:

04-18 14:52:32.007 32623-32623 / A / Ion:[java / com / google / vr / dynamite / client / native / dynamite_client.cc:74]检查失败:表达式=&# 39;" env"'

04-18 14:52:32.007 32623-32623 / A / Ion:倾销堆:

相关代码是:

    try
    {
        // Obtain the current frame from session.
        mSession.setCameraTextureName( mTextureId );
        Frame frame = mSession.update();
        TrackingState trackingState = frame.getCamera().getTrackingState();
        if ( trackingState == TrackingState.TRACKING )
        {
            // Compute lighting, this is also crashing
            //final float[] colorCorrectionRgba = new float[4];
            //frame.getLightEstimate().getColorCorrection( colorCorrectionRgba, 0 );

            //getPixelIntensity works fine
            float lightIntensity = frame.getLightEstimate().getPixelIntensity();
            Log.d( TAG, " light intensity is " + lightIntensity );

            //This is also crashing
            android.media.Image image = frame.acquireCameraImage();
            //do something useful with the image
            image.close();

app level build.gradle在依赖项下有以下条目:

实施' com.google.ar:核心:1.1.0'

我尝试启用和禁用了proguard。

有人能发现我做错了吗?

PS:如果不清楚,拨打失败的电话为frame.acquireCameraImage()frame.getLightEstimate().getColorCorrection()

0 个答案:

没有答案