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.
Related
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?
I've searched without getting any success.
Is it possible create a regular triangle mesh in opencv ?
You could use cv::Subdiv2D for triangulation. Here is a link to C++ and Python examples.
But I think this implementation cannot handle holes, if I remember correctly.
I would also suggest that you check out the C-library Triangle. It allows you to specify holes besides many other useful things. Apparently, several wrappers for Python exist for it (but I have never used them).
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'm looking in to learning about processing and handling images with Python. I'm experimenting with searching the inside of an image for a specific picture. For example, this picture has two images in it that are the same;
In Python, how would I go about detecting which two images are the same?
I would recommend you to take a look at OpenCV and PIL, if you want to implement simple (or complex) algorithms on your own.
Furthermore you can integrate OpenCV with PIL and also numpy, which makes it a really powerful tool for this kind of jobs.
I am trying to detect a marker in a webcam video feed and overlay it with a 3d object - pretty much exactly like this: http://www.morethantechnical.com/2009/06/28/augmented-reality-with-nyartoolkit-opencv-opengl/
I know artoolkit is the best module for this, but I was hoping to just use opencv in python since I dont know nearly enough c/c++ to be able to use artoolkit. I am hoping someone will be able to get me on the right track towards detecting the marker and determining its location and orientation etc since I have no idea how best to go about this or what functions I should be using.
OpenCV doesn't have marker detection / tracking functionality out of box. However it provides all algorithms needed so it's fairly easy to implement your own one.
The article you are referring to uses OpenCV only for video grabbing. The marker detection is done by NyARToolkit which is derived from ARToolkit. NyARToolkit have versions for Java, C# and ActionScript.
ARToolkit is mostly written in plain C without using fancy C++ features. It's probably easier to use than you thought. The documentation contains well explained tutorials. e.g http://www.hitl.washington.edu/artoolkit/documentation/devstartup.htm
The introductory documentation can help you understand the process of marker detection even if you decide not to use ARToolkit.
I think the most used way to perform marker detection using python and open CV is to use SURF Descriptors.
I have found very useful this video and the linked code you can find in this page. Here you can download the code. I don't know how to overlay it with a 3d object but I'm sure you can do something with pygame or matplotlib.