Mapping 2d point to 3d coordinate - python

I have two videos with a moving point in different views.
There have some markers in this two video. For example there have a five points objects in each videos but in different angle.
Is it possible for me to map the 2d point to 3d coordinate?

Related

How to calculate an intersection of polyline and 3D surface?

I want to calculate intersection points of polyline and a closed 3D surface (given as a set of polygons).
For simple 2D cases I can use shapely. Can you advice me something for 3D case?
P.S. My programming language is Python, but C++ libraries can be useful too.
Consider every line segment and every polygon independently and build their axis-aligned bounding boxes. Now for every pair of overlapping boxes, rotate the polygon to the horizontal plane, and the segment accordingly, and find the piercing point of the supporting line of the segment.
Then check if the piercing point belongs to the segment and to the inside of the polygon.

How to compare the orientation of a 3D vector against a plane in three dimensions

I am currently trying to plot a plane in three dimensional space but not sure how to do it for the problem I have.
Currently I have code that defines a 3D vector according to co-ordinates I have, this includes the ability to rotate, translate, and work out the angle between vectors.
The next step is to define a plane. I am not sure the best way to do this, however. The plane will be in a 100,100,100 box, be flat, and likely exist at a z height of around 30.
My issue comes because I need this plane to do a couple of things:
1: I need to be able to rotate it around the three axes.
2: I need to be able to measure the smallest angle between the plane and the vector I have defined where the vector intersects the plane.
I was initially playing around trying to fill a numpy array with 1s where the plane would be etc but I don't see this really working how I need it to.
Does anyone know of any other tool that I would be able to use in this situation? Many thanks.
First of all, you'll need the normal vector to the plane. From there and following this link it should be easy for you to figure it out :)
Basically you get arcsin of the scalar product of your vector and the normal vector of the plane divided by the product of the norms of both vectors.
PS: If the plane is paralel to the XY plane, then it's normal vector it's just (0,0,1).

Plot Arbitray Slice of 3d points in Python

So I am a bit new to python and having a little trouble.
I am attempting to plot (project) a 3d data set onto an arbitrary plane. I can of course plot xy etc. but since my data has a particular orientation (all the points fall into an arbitrary orientated cylinder) I want project all the points onto a plane that slices that cylinder orthogonally and that plane would have a arbitrary orientation.
I am working with microseismic data if anyone is familiar with that and all the points are located around a wellbore with follows an arbitrary but fairly straight azimuth.
The data is in Cartesian coordinates.

generate an arbitrary angled contour from 3D data points

I am wondering if there is a way to generate 2d contour plots from a set of 3D data points using either python or matlab? The 3D data points create a roughly spherical shape and the contour would represent the outer border of this spheroid on different planes angled from 0 to 180 degrees
I am thinking one way is to generate a 3D surface from the pointcloud by using numpy.meshgrid and then using plot_surface. However, I also do not find a way to take angled slices out of the interpolated 3D data to obtain a contour.
Ideas very welcome!
thanks
Jesse

Python: Calculate the 2D area of an object from a 3D projection

Context
I have a object in 3D for which I have the co-ordinates for. I then rotate the object n number of times and I want calculate the 2D area (in nano meteres) of the object, when the object is projected onto a grid.
For example,
I have an image below which describes my problem. I have the same object but in three different orientations. If i were to project that object onto the grid how would I calculate the area the object occupies in 2D?
My question is
How can I project the object onto a grid (if necessary) and measure the area of the object at that particular orientation? I'm not necessarily looking for code but maybe libraries people can point me to.
If I understand correctly, if your 3d object is convex, then you only need to project it's vertices and take the convex hull of those. The area of the convex hull polygon will be your area.

Categories

Resources