Sunday, July 31, 2016

Mixed Reality: the "Recorder" feature in MARUI v1.4.4

I received some feedback about the last videos. (Thanks again!)
It seems that the "Artist's POV" makes it a bit hard to understand for people who are new to VR what is going on.
Instead, I was told, the first shot should illustrate the work environment by showing the Maya 3D scene in the real world.
I didn't want to "cheat" however, and just produce a fancy concept video. I only wanted to use what MARUI really can do.

Well, the solution was to just make MARUI do more.
So I implemented a "VR Camcorder" - a small module that allows recording videos from a different point of view than what the user sees, which can then just be inserted in a video recorded from that position.

The first attempt was still a bit crappy, but came in handy as release video for the new MARUI version 1.4.4.



The Recorder can be activated from the recording menu in the Maya shelf.
Use either the HMD or one of the controllers to set the Recorder to the position of the camera in reality.

As soon as you open the Recorder, it will start saving the video images as a PNG sequence.


To make good MixedReality videos, you'll need a bit of knowledge about your camera:
the so called "intrinsics" focal length and centroid.

The notation of the camera intrinsics is a bit different in MARUI:
they are relative to the width and height of the image.

So let's say your camera has 2/3" sensor (8.8mm x 6.6mm) and you record it with 15mm focal length, then fx would be 15mm / 8.8mm = 1.7 and fy = 15mm / 6.6mm = 2.27.

However, in most cases (unless you have quite professional gear) the effective focal length will probably be hard to calculate.

Rather you would use some camera calibration toolkit like MRPT, which will require you to take a series of pictures of a chessboard pattern and then calculate the focal length and centroid.

The output may look like this:
resolution=[1920 1080]
cx=970.40973
cy=512.52167
fx=1845.70793
fy=1861.81341
The numbers here are all in pixels, meaning the focal length is about 1845 pixels. It is also different horizontally (x) and vertically (y).

So for MARUI the resulting values are (approximately):
cx=970 / 1920 = 0.50
cy=512 / 1080 = 0.47
fx=1845 / 1920 = 0.96
fy=1861 / 1080 = 1.72
Now you can see why MARUI wants these parameters in such a strange format:

(1) MARUI started as an academic research project, where people are used to this calibration procedure.

(2) If you want to record at a higher or lower resolution, you would usually have to update the parameters (because the size of "a pixel" just changed). But since MARUI uses image-size relative values, you can just switch to 1280x720 or 960x540 without changing the values.


I'll try to make that easier to use in the future.

In the meantime: check out MARUI - Maya VR PlugIn.

No comments:

Post a Comment