Posts

Showing posts from November, 2011

Kinect Resolution

Image
There are many many examples of uses of Microsoft Kinect but I have not found around a description of the resolution of the sensor.

The starting point is the depth information that is natively expressed over 11 bits (2048 values) and it can be mapped to a physical depth by means of an equation. In the following (X,Y,Z) in upper case are the coordinates in image space, while (x,y,z) the coordinates in real space, relative to the Kinect reference frame, expressed in mm. Two similar equations have been proposed online, one based on the function 1/Z, the other using tan(z).

z_l = 1000 / (Z * -0.00307 + 3.3309);
z_t = 1000* 0.1236 .* tan(Z / 2842.5 + 1.1863);

Given this mapping we approximate the resolution by computing the distance between points separated by one unit of raw depth. Simply in MATLAB: z_ld = [0, diff(z_l)];

The following figure shows the resolution based on the two functions, limiting the raw depth to 1024, that corresponds to about 5 meters.


In reality we are more interes…

Automating pasting of EMF in Word and adjust scaling

When I am writing with Word instead of LaTeX I prepare figures on Powerpoint so I have them ready for presentations. Unfortunately the default Paste command selects a bitmap image that most of the time is blurry so I prefer the Enhanced Metafile (EMF) format that is vectorial. This requires few more clicks.

Also when I have already an image and I want to replace with a new one I loose the scaling.

The following VBA macro allows to paste in EMF and to keep the with of the original image, while height is obtained by keeping the ratio. Unfortunately it is not possible to replace the image content withour removing the shape, so it has to be destroyed and replaced.

Sub MyPasteEMF() Dim x As InlineShape sw = 0 sh = 0 If Selection.InlineShapes.Count > 0 Then Set x = Selection.InlineShapes(1) sw = x.Width sh = x.Height x.Delete End If Dim r As Range Set r = Selection.Range w = 0 On Error Resume Next r.PasteSpecial Place…