Periodic loss of Leibniz pose information

I just updated my device to the latest version (Leibniz), and here are some notes / issues:

1) In my application, there are now long (2-3 s) intermittent periods when these poses are invalid. I assume that the problem is in the driver, because the problem also occurs in Tango Explorer. Just starting Explorer and letting it sit, as a result, the “Motion Tracking Lost” dialog box appears for entry and exit. Can anyone confirm this?

2) The color buffer in the TangoService_connectOnFrameAvailable () callback is now enabled, but in the YUV420SP, as indicated in the release notes. Can any of the tango developers please submit a code to convert it to RGB. I know I can use this material, but it would be nice to have a pattern that binds in width, height, TangoImageBuffer step, etc.

+4
source share
4 answers

Quickly, here is the YUV code I used with Tango

// http://en.wikipedia.org/wiki/YUV
int halfi, uvOffset, halfj, uvOffsetHalfj;
float y_scaled, v_scaled, u_scaled;
const float Umax = 0.436f;
const float Vmax = 0.615f;

unsigned char* pData = TangoData::cameraImageBuffer;
unsigned char* iData = TangoData::cameraImageBufferRGBA;
float invByte = 0.0039215686274509803921568627451;  // ( 1 / 255)

is_image_dirty = false;
int size = (int)(TangoData::imageBufferStride * TangoData::imageBufferHeight);

int uOffset = size / 4 + size;
int halfstride = TangoData::imageBufferStride / 2;
for (int i = 0; i < TangoData::imageBufferHeight; ++i)
{
    halfi = i / 2;
    uvOffset = halfi * halfstride;
    for (int j = 0; j < TangoData::imageBufferWidth; ++j)
    {
        halfj = j / 2;
        uvOffsetHalfj = uvOffset + halfj;
        y_scaled = pData[i * TangoData::imageBufferStride + j] * invByte;
        v_scaled = 2 * (pData[uvOffsetHalfj + size] * invByte - 0.5f) * Vmax;
        u_scaled = 2 * (pData[uvOffsetHalfj + uOffset] * invByte - 0.5f) * Umax;
        *iData++ = (unsigned char)((y_scaled + 1.13983f * v_scaled) * 255.0);;
        *iData++ = (unsigned char)((y_scaled - 0.39465f * u_scaled - 0.58060f * v_scaled) * 255.0);
        *iData++ = (unsigned char)((y_scaled + 2.03211f * u_scaled) * 255.0);
        *iData++ = 255;
    }
}

, , , , - , . , , , , ..... ! Google Devs, , . , , , , . , , Google, AR, . , Google Devs, , - A . , , . !

+2

, , , . Tango , , " ". , , . , , - , NaN .

+1

: .

Leibnez : NaNs, , INVALID STATE. , . , "" OTA Leibnez. messagae , . , , , . 5 ...

:

: KOT49H.150414

0

. . , " ", ( , , ).

, , . NV12 RGB:

 int size = (int)(buffer->width * buffer->height);
 for (int i = 0; i < buffer->height; i++)
 {
   for (int j = 0; j < buffer->width; j++)
     {
     float y = buffer->data[i * buffer->stride + j];
     float u = buffer->data[size+2*((i / 2) * (buffer->stride / 2) + (j / 2))];
     float v = buffer->data[size+2*((i / 2) * (buffer->stride / 2) + (j / 2))+1];

            TangoData::GetInstance().color_buffer[3*(i*buffer->width+j)]=y;
            TangoData::GetInstance().color_buffer[3*(i*buffer->width+j)+1]=u;
            TangoData::GetInstance().color_buffer[3*(i*buffer->width+j)+2]=v;;
}
}

x Y, UV . (, FrameAvailable) (Android YUV format):

attribute vec4 vertex;
attribute vec3 color;
uniform mat4 mvp;
varying vec4 v_color;
void main() {
gl_PointSize = 7.0;
gl_Position = mvp*vertex;
float r=color.x + (1.370705f * (color.z-128.0f));
float g=color.x - (0.698001f * (color.z-128.0f)) - (0.377633f * (color.y-128.0f));
float b=color.x + (1.732446f * (color.y-128.0f));
v_color = vec4(r/255.0f,g/255.0f,b/255.0f,1.0);

.

  • Y ( , , ), , . , / .
  • UV, . -, . - .
  • ( , , "YUV" "RAW" ):

     E/camera-metadata﹕ /home/ubuntu/jobs/redwood_internal/RedwoodInternal/Redwood/common/player-engine/‌​src/camera-metadata.cc:56 YUV failed to match frame 1545.014677
    

    - , . , . - ?

I changed the configuration a bit because it was said that the color camera should be turned on. But I could not find any explanation of how this is done. I hope the following code is correct, it did not give me any error messages:

bool TangoData::SetConfig() {

[...]

if (TangoConfig_setBool(config_, "config_enable_color_camera", true) !=
    TANGO_SUCCESS) {
  LOGE("config_enable_color_camera Failed");
  return false;
}

if (TangoConfig_setInt32(config_, "config_color_exp", 300) !=
    TANGO_SUCCESS) {
  LOGE("config_color_exp Failed");
  return false;
}

[...]
return true;
}

Hope this helps, or you already have good results with the camera in the Leibniz release!

0
source

All Articles