AR set webcam HD resolution
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?
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;
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?
#1 Updated by arkeon almost 9 years ago
- File calibration.rar calibration.rar added
- File camera_1280_720.yml camera_1280_720.yml added
- Assignee set to arkeon
- % Done changed from 10 to 80
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
#4 Updated by Frankieo over 8 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)
#6 Updated by arkeon over 8 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
#8 Updated by Frankieo over 8 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)