ipisoft.com
https://forum.ipisoft.com/

iPi Recorder AVI format - converting depth value to meters
https://forum.ipisoft.com/viewtopic.php?f=2&t=6710
Page 1 of 1

Author:  dziwny_16 [ Wed Jan 16, 2013 4:29 am ]
Post subject:  iPi Recorder AVI format - converting depth value to meters

I want to compare ipi soft tracking with openni/kinect sdk skeleton tracking.
Main idea is to record ONI file (using openni) or AVI file (using older version of iPi Recorder) and then convert one format to another.

Of course I choose to use iPi recorder because it is a software better suited for for recording long video sequences.
Quick look into frame structure and I got what I needed :
* component R was an Raw Bayer patter from RGB camera
* components B and G should be a 16 bit depth value.
I quickly written simple software to do this conversion, butt well I got stuck.
The problem is that value in B and G is not a '11bit raw depth' (it cannot by converted to depth by using equation depth = 0.1236f * Tan( val / 2842.5 + 1.1863 ) ), it isn't also correct depth value (in metres).

After some experimentation I know two things:
1. Value in G component can have only tree values : 3 ( pixel is before point X ), 4 ( point lies after point X ), 7 ( depth of point in not known )
2. Value in B is used to describe pseudo-depth.

Problem is that I don't know where point X lies or how to convert pseudo-depth to depth (in meters want to compare ipi soft tracking with openni/kinect sdk skeleton tracking.
Main idea is to record ONI file (using openni) or AVI file (using older version of iPi Recorder) and then convert one format to another.

Of course I choose to use iPi recorder because it is a software better suited for for recording long video sequences.
Quick look into frame structure and I got what I needed :
* component R was an Raw Bayer patter from RGB camera
* components B and G should be a depth value.
I quickly written simple software to do this conversion, butt well I got stuck.
The problem is that value in B and G is not a '11bit raw depth' (it cannot by converted to depth by using equation depth = 0.1236f * Tan( val / 2842.5 + 1.1863 ) ), it isn't also correct depth value.

After some experimentation I know two things:
1. Value in G component can have only tree values : 3 ( pixel is before point X ), 4 ( point lies after point X ), 7 ( depth of point in not known )
2. Value in B is used to describe pseudo-depth.

Problem is that I don't know where point X lies or how to convert pseudo-depth to depth (in meters).
I already tried function :
int depth(int G, int B) // in range <0, 512>
{
if (G == 7) { return 0; } // depth unknown
if (G == 3) { return B; }
return B + 255;
}

Is there any one from dev-team that could give equation to converting B, G components to depth (in meters), or 'raw depth value' ?

Author:  vmaslov [ Wed Jan 16, 2013 5:54 am ]
Post subject:  Re: iPi Recorder AVI format - converting depth value to mete

Hi
Congratulations on successfully exploring details of AVI encoding employed in v1 of our software :)
You are correct about the meaning of Red component.
Green and Blue combined indeed represent raw depth value coming from the sensor. It is computed as Green * 256 + Blue (Blue is 8 low-order bits, Green is 3 high-order bits). Then, the formula you supplied is used to convert this raw value to meters.

Author:  dziwny_16 [ Wed Jan 16, 2013 6:57 am ]
Post subject:  Re: iPi Recorder AVI format - converting depth value to mete

Thank you very much.
I should have thought of this earlier, yet for some reason i was doing something like t= G + B<<8, or shuffling bits in t = t&0xF0 | (t&0xF<<8) | (t&0xF00>>8.

Again thank you very much and I hope that soon new iPi Recorder will be able to convert ipivideo to avi (or specification of ipivideo format will be available to public).

Author:  vmaslov [ Wed Jan 16, 2013 7:50 am ]
Post subject:  Re: iPi Recorder AVI format - converting depth value to mete

dziwny_16 wrote:
I hope that soon new iPi Recorder will be able to convert ipivideo to avi (or specification of ipivideo format will be available to public).

Export to AVI will be intented solely for the purpose of getting color info from individual cameras in widely supported format. Not the same AVIs that were produced by iPi Recorder 1.x.
We do not plan to make any specification for iPiVideo format, as we do not expect it to be used anywhere outside of our software. If you are interested in using iPiVideo for another application, and have knowledge of Microsoft .NET, you can employ the iPiVideo.dll assembly from iPiRecorder. However, we cannot provide any support for this, and you will be on your own in exploring its API.

Page 1 of 1 All times are UTC - 8 hours [ DST ]
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/