Is Onvif TranslationSpaceFov translation space required to centre camera view via conversion of x,y coords - onvif

This link poses the same question and provides a solution. I need to understand how TranslationSpaceFov relates to the solution:
Converting x/y values from on screen click to ONVIF PTZ pan/tilt values
Does my camera need to provide this translation space?
My camera does not provide this translation space, can I add it?

If you want to do go to center action the camera has to have this translation space and you want to add it into the PTZ configuration.
When the camera doesn't provide this space you simply cannot implement it by yourself and if so the action would be very inaccurate.

Related

Is there a way to define the camera parameters myself?

I am working with Shapenet dataset which contains 3D information. I want to create images out of that dataset by defining the camera intrinsics and extrinsics on my own (so its like I will be defining where my camera is with respect to object and what will be the focal length and optical center of camera). Is there a concrete way by which I can pick some values for these ?
PS : I can load the shapenet models in some 3D viewing software and if I could extract the camera parameters might be using (since at any particular time, it is showing me an image)

How to calculate a pixels world space position on an image plane formed by a virtual camera?

First, this Calculating camera ray direction to 3d world pixel helped me a bit in understanding what the virtual camera setup is like. I don't understand how the vectors work in this setup, and I thought normalized device coordinates had to be used which led me to this page http://www.scratchapixel.com/lessons/3d-basic-lessons/lesson-6-rays-cameras-and-images/building-primary-rays-and-rendering-an-image/. What I am trying to do is build a ray tracer, and as the question states, find out the pixels position in order to shoot out a ray. What I really, really really would like, is an actually example showing a virtual camera setup, screen resolution and how to calculate a pixels position, then transform to world space coordinates. Experts!, Thank you for your help! :D
Multiply a matrix by the coordinates. What matrix? There are lots of choices. For example XNA uses a projection matrix, view matrix and world matrix. Applying all of them transforms pixel coordinates into world coordinates or vice versa. Breaking it down this way helps to understand the different transformations going on so you can more easily construct the matrices.
Isn't this webpage providing you already with 4 pages of explanation on how these rays are built? It seems like you haven't made the effort to read the content of the link you are referring to. I would suggest you read it first, try to understand it, maybe look at the source code they provide and come back with a real question regarding what you potentially don't understand.
It's all there, and I am not going to re-write what these people seem to have put a lot of energy already to explain! (nor should anybody else really ...).

Can I remap mouse co-ordinates when using Gdiplus::SetPageScale using a GDI Function?

I want to add zoom capability to an app, which at its core is a spf graph app. Now I currently have no zoom, but the ability to select/move, multi-select objects on the graph in the graph window. I started to write my own code to do scaling of the objects and then work out mouse co-ordinates to map clicks and redraws correctly. I didnt complete this as I found the Gdiplus::SetPageScale function, which scales the window fine but I cannot see any GDI function I can use to map the mouse click co-ordinates from the world co-ord's to the page co-ords. I tried TransformPoints(Gdiplus::CoordinateSpaceWorld, ::Gdiplus::CoordinateSpacePage, points, 2) but this does not convert the points and the returned points are (0,0).
So is this even possible with Gdiplus or do I need to write this mapping myself? Any advice appreciated!
You don't want to use Graphics::SetPageScale() in this case. The much more general way is to use the Matrix class instead. Its Scale, Translate and Rotate methods are handy to get the matrix you need. You'll want to use the Scale() method here, possibly Translate() to change the origin.
Before you start drawing, activate the matrix with the Graphics::SetTransform() method. Anything you draw will now automatically be scaled according to the arguments you passed to the Matrix::Scale() method. Mapping a mouse position is now exceedingly simple with Matrix::TransformPoints() method, the exact same transform that was used while drawing is now applied to the mouse coordinates. Even going back from graph coordinates to mouse coordinates is simple, use the Matrix::Invert() method to obtain the inverse transform.
When GDI+ draws, it applies a world transform (which is controlled by Graphics::SetTransform, ScaleTransform, etc.) followed by the page transform (which is controlled by Graphics::SetPageScale and Graphics::SetPageUnit) to transform the points to device coordinates.
So it normally goes like this: World coordinates --[World transform]--> Page coordinates --[Page transform]--> Device coordinates
You can use Graphics::TransformPoints the way you wanted, to map mouse coordinates to world coordinates, but you have to specify Device coordinates as the source space and World coordinates as the destination space.
However, there are good reasons to do it as Hans describes with a Matrix you store separately, most notably that you shouldn't be holding on to your Graphics object for long enough to process mouse input (nor should there be a need to create one then).

how to draw several shape (circle, line, rec, etc.) with more control?

I know there is a nice class Graphics with basic api like drawLine, drawRect. But I need more control to set pixel size, wide, thick, thin, lines in my shape. My intention is to draw a dynamic shape (similar to attached image) depending on different criteria.
I'm new in J2ME. Any other suggestion to achieve my goal is appreciated. Thanks!
There is no way to set line thickness in J2ME.
However, you can try some workarounds:
To simulate thick lines, you can just draw multiple lines.
And to draw a thick circle you can draw a larger filled circle and then a smaller one inside it.
For dotted lines use setStrokeStyle.
If your target devices are Nokia than you can use drawPixels(...) and drawPolygon(...) in conjunction with MIDP graphics methods drawLine(...), drawRect(...) and drawArc(...). To achieve your goal. The drawPixels(...) is a very powerful method in the sense you can draw virtually any custom shape you would like. I know of SonyEricsson that supports nokia UI api's but with "strings attached".
More descriptive information can be found at this link.
.
If your target devices are not just Nokia than i would suggest you find / do-self port of Nokia UI class DirectGraphics. There are no ODM specific libraries the way Nokia have it.

Line of Sight blockage using bitmaps

I'm building a simulation model for a vehicle. I must determine if the vehicle's line of sight is being blocked by other vehicles in the sim.
(There is no visual display for our sim, it's purely for calculations.)
One idea is to generate a view with the camera at the line of sight's origin and orientation. Then I rasterize the scene into a black and white bitmap, with black meaning blocked, and white meaning clear.
Does this seem feasible?
Is this in 2d or 3d? Also, have you considered using an existing simulation frame such as Gazebo or Microsoft Robotics?

Resources