Home › Forum › SOFA › Programming with SOFA › Get/change camera parameters
Tagged: 64_bits, camera calibration, MacOS, Plugin_other, SOFA_2006
- This topic has 5 replies, 3 voices, and was last updated 4 years ago by Hugo.
-
AuthorPosts
-
11 November 2020 at 17:52 #17634JonnyBlocked
Hi everybody,
I am trying to use an image sequence from my Sofa scene with a SLAM algorithm to create a map of my scene/track the camera movement. Capturing the images works fine but I was wondering if there is any chance I can get a calibration of the camera used in Sofa and/or even change the parameters of the camera because currently the SLAM does not work with my images.
I am using following components in my scenes trying to control/predetermine the movement of the camera: interactiveCamera, recordedCamera (navigation/rotation mode) and also OglViewport. I have different scenes for each component and at this point of my project it doesn’t really matter which one I use. So if anybody could provide help for any of the components that would be extremely helpful!
Also I found a way to change the default settings of the VideoRecorderManager in the source code. Is there also a way to change/limit the (file)size of the resulting images as they currently depend on the size of my SofaGUI-window (at least the size changes a lot)? I just start/stop recording by pressing ‘v’ or mimicking it in my script.
Thanks in advance.10 December 2020 at 10:27 #17992HugoKeymasterHi @jonny
Thank you for your question.
Maybe @omar could help on this topic of calibration.Camera settings use as you do: InteractiveCamera, RecordedCamera, OglViewport (if a new viewport is needed)
<InteractiveCamera name="baseCamera" position="2.5 5 37.4995" orientation="-0 -0 0 1" lookAt="2.5 5 0" distance="37.4995" minBBox="-5 0 -8.66" maxBBox="10 10 8.66" widthViewport="190" heightViewport="552" />
You can also use some Camera recorder. You should find an example in examples/Components/visualmodel/RecordedCamera.scn
@froy do you have any idea if there is a way to change the default resolution of the VideoRecorderManager?Best
Hugo
10 December 2020 at 10:28 #17993HugoKeymasterI noticed your topic is closed @jonny.
Let us know if you need any further help or if you are willing to share your decision/solution.Best wishes,
Hugo
10 December 2020 at 10:59 #17994FroyKeymasterThe current implementation in the GUI does not allow to change the resolution of the output (either for the video or the screenshots actually) and it takes the current size of the widget. 😕
The recording function itself does allow any custom size, so it should not be difficult to add fields in the GUI, and feed it in the function.10 December 2020 at 19:44 #17997JonnyBlockedThanks @hugo and @froy for you replies.
I got the SLAM to run without giving my any error messages, that’s why I closed this topic. However, it is not working very well atm and I am not exactly sure why that is. So far I have calibrated the camera using SOFA screenshots of a floor with checkerboard texture (like you would do with real physical camera) with MATLAB Calibration Toolbox. Thus I obtained the intrinsic camera parameters and with some minor changes in the SLAM code, I was able to get it to run through. The mapping is pretty poor right now, my guess would be that the scene I am using right now (contains RecordedCamera to determine a certain camera path) is not optimally suited for my use-case. But maybe the whole calibration thing was wrong in the first place. Does somebody have any experience using simulation image data with computer vision/mapping algorithms?
In terms of the screenshot size/resolution I am going to look into the recording function, as of right now that’s not my biggest concern though. As long as I don’t change the size of the widget the resolution remains the same.
I will open this topic again and post an update as soon as I progress!
19 December 2020 at 00:28 #18062 -
AuthorPosts
- You must be logged in to reply to this topic.