Project

General

Profile

Actions

Support #379

closed

AR set webcam HD resolution

Added by Frankieo almost 13 years ago. Updated over 12 years ago.

Status:
Resolved
Priority:
High
Assignee:
Category:
OS3D_PlugIT
Target version:
Start date:
01/25/2012
Due date:
% Done:

100%

Estimated time:

Description

I would like to make use of a HD camera (1280x720 / 1920x1080 pixels) in my AR project, but only standard resolution is currently supported (I assume it is 800x600?). How to do this?

edit
With some email help I am now able to diplay 1280x720 webcam! By adding a line to the ARcapture plugIt (carcapture.pkg)
-> Added in the connectCapture function (about line 172), just before the _GETcaptureSize call):

_SETcaptureSize capstr.CAP_Device 1280 720;

problem
The program runs OK, but the 3D model gets dislocated (see added picture). I think this is because there are othe OpenSpace3D settings that are still making use of the 800x600 settings. How to solve this?


Files

HDwebcam.jpg (443 KB) HDwebcam.jpg Illustration of the problem: wrong model position Frankieo, 01/25/2012 09:35 AM
calibration.rar (1.44 MB) calibration.rar calibration tool from openCV but modified with new vh vw parameter for capture size arkeon, 01/25/2012 11:17 AM
camera_1280_720.yml (21.3 KB) camera_1280_720.yml calibration file for 16/9 cameras arkeon, 01/25/2012 11:17 AM
HDweb_withYML.jpg (417 KB) HDweb_withYML.jpg 1280x720 no_mirrormode with camera_1280_720.yml Frankieo, 01/31/2012 03:33 PM
pattern.pdf (4.75 KB) pattern.pdf arkeon, 02/06/2012 03:56 PM
HDwebcam_withYML_andMirror_OK.jpg (356 KB) HDwebcam_withYML_andMirror_OK.jpg HDcam with MirrorMode OK Frankieo, 02/07/2012 11:18 AM
Actions #1

Updated by arkeon almost 13 years ago

You need to calibrate your camera since the picture aspect ratio change the camera projection matrix.

I made a version of the calibration tool to manage capture image size (not implemented in the original version).

however there still have a problem on camera mirror mode, I think that we should revert the X matrix in this case .. TODO
and I should manage a default 16/9 cam matrix in the code .. TODO

Actions #2

Updated by Frankieo almost 13 years ago

This is the result with the new camera_1280_720.yml file in use, it is not okay yet. And mirror mode is indeed not supported.
(I didn't try the calibration program myself yet)

Actions #3

Updated by arkeon almost 13 years ago

You should try to generate your own YML from the calibration tool

Actions #4

Updated by Frankieo almost 13 years ago

I tried running the calibration program, but I keep getting these errors, no matter what I try:
"RMS error reported by calibrateCamera: 0.451272
Calibration succeeded. avg reprojection error = 0.45"
So I am unable to create a yml file myself.

Did I already mention that I use a Logitech C910 HD camera, which can even run with a 1920x1080 resolution?
I think your camera_1280_720.yml dow not run correctly with my camera, because it even has a better resolution as 1280x720.
(however, I would like to run the program on 1280x720, not with 1920x1080, that will run too slow)

Actions #5

Updated by Frankieo almost 13 years ago

Any news on this project? I would like to work with HD webcam input/display soon?

Actions #6

Updated by arkeon almost 13 years ago

try this :
1 - print the pattern.pdf without the fit to page setting
2 - open a windows consol (cmd command)
3 - type "calibration.exe -w 8 -h 6 -s 0.025 -vw 1280 -vh 720 -o camera720.yml -op" without the quotes
4 - press "g" and
5 - (move the camera around the pattern like showed here : http://www.uco.es/investiga/grupos/ava/node/26
6 - when "calibrated" is shown press "esc" key
7 - the camera720.yml file is written in the current directory
8 - copy the yml file in your scol partition (my documents\Scol Voyager\Partition_LocalUsr\..)
9 - use the camera720.yml in the ARcapture plugIT
10 - disable the mirror mode in the plugIT

Actions #7

Updated by arkeon almost 13 years ago

RMS error reported by calibrateCamera: 0.451272
Calibration succeeded. avg reprojection error = 0.45
are normal messages this is your camera projection correction / error
your YML file is written anyway

Actions #8

Updated by Frankieo almost 13 years ago

Great! It works, even with Mirror Mode on!

I used this command in cmd:
C:\opencv_calibration\calibration.exe -w 8 -h 6 -s 0.03 -vw 1280 -vh 720 -o C:\opencv_calibration\camera720.yml -op
(as you can see I had to define export location full path)

Actions #9

Updated by arkeon over 12 years ago

  • Status changed from New to Resolved
  • % Done changed from 80 to 100

Applied in changeset r4254.

Actions

Also available in: Atom PDF