I have read this post in https://mathoverflow.net/questions/268106/generating-random-curves-with-fixed-length-and-endpoint-distance
The main task is drawing a continuous curve between two fixed points that has also a fixed length.
I wondered how can I implement it in python?
I was looking for creating it in pytorch, but opencv and scikit image also works for me.
I was unable to find even a relatively close implementation anywhere.
Do you have any suggestion what function from what package can make it work?
Related
I'm trying to automatically draw a mesh or grid over a face, similar to the image below, to use the result in a blog post that I'm writing. However, my knowledge of computer vision is not enough to recognize which model or algorithm is behind these types of cool visualizations.
Could someone help pointing me some link to reador or a starting point?
Using Python, OpenCV and dlib the closest thing I found is something called delauny triangulation but I'm not sure if that's exactly what I'm looking for seeing the results.
Putting it in a few words what I have so far is:
Detect all faces on image and calculate their landmarks using dlib.get_frontal_face_detector() and dlib.shape_predictor() methods from dlib.
Use the method cv2.Subdiv2D() from OpenCV to compute a 2D subdivision based on my landmarks. In particulary I'm getting the delauny subdivision using the getTriangleList() method from the resulting subdivision.
The complete code is available here.
However, the result is not so attractive perhaps because the division is using triangles instead of polygons and I want to check if I can improve it!
I'm wondering if it is possible to plot a vertex as image (loaded from a file or directly) in Igraph. Any ideas?
This is definitley possible in the R version of iGraph using the raster function, however a brief search did not reveal any implementation of this function in Python (it's not in the igraph documentation anyway).
If this is essential to your work, then I would consider switching to R, or possibly another tool such as Gephi. For Python, however, you might consider using something like pyvis. This package is small but powerful in terms of visualization. I've been playing around with it over the past few days and its very easy to display a graph with pictures as nodes, and it comes with the added benefit of providing interactive functioning. Take a look at the tutorial here, which will highlight what this package can provide.
I am using OpenCV and Python.
Let say I have this sequence video of the car. And I have tracked some 'interesting points' of the car with the cv2.goodFeaturesToTrack and cv2.calcOpticalFlowPyrLK. Now, given the traced points, I want to estimate a very rough shape (maybe a 3D box) of the car and its distance from the camera. It doesn't need to be that accurate.
On top of that, I want it to be keep updating in real time. The closest youtube video I can find that can give a view of what I am trying to achieve is this. I have found a new Structure from Motion module in OpenCV, but it is more on building a 3D model from a collection of points.
The question is, what is the best way of achieving this and what kind of library I can use (especially in order to construct the 3D space)?
And it is also OK if somehow I need to use C++ for this (although I am still not good in it yet).
Thanks.
I wish to make a 3D reconstruction of a scene. For that, I have 2 images of the scene taken from two different angles.
Is there a library that does that? (I work in python)
if not, what are the steps that must be followed?
if you have the code ready, it is welcome.
thanks
I have not tried it for myself yet, but it seems simple with OpenCV.
OpenCV has module for 3D reconstruction.
Also check out this tutorial.
Upd. Please look at comments from #berak below. I misunderstood yours question at first.
I found SfM-Toy-Library library on github, which uses algorithms from mentioned "Multiple View Geometry" book. It's written using OpenCV and better relates to the topic, but it might be not so easy to use library in Python.
You can use vtk
First step is image processing and second step is 3d reconstructions
For example you can try for first step:
1)Median Filtering
2)Image contrast
3)Thresholding
4)Noise reduction
And second step includes:
1)vtkMarchingCubes
2)vtkPolyDataMapper
3)vtkActor
4)Renderer
Also you can read this article : enter link description here
I want to detect symmetries (rotation, translation, etc) of a simple figure or a shape in a image. That is, if I find one symmetry I want to replicate my original figure with it.
Are there any function or module?
I have thought in python-opencv, but I did not find nothing.
Let me just throw some packages at you: OpenCV for Python Cookbook might be a good start. A search for "opencv" on the Python Package Index yields several bindings of OpenCV for Python.
Concerning the detection of symmetries: The answer to question how to detect simple geometric shapes using OpenCV? might be a good start. After you find similar objects, check their orientation. Replacing then should be a piece of cake.