Feature detection wavefront object using python. is there any libraries? - python

I am doing a 3D Scan and export the result as a wavefront object (.obj with the mesh, and .mtl and .jpeg for the texture). the link between the faces of the mesh and the texture are in the .obj.
I am trying to detect "circles" for example on the 3D scans which are on the texture.
there is no "3D variation on the mesh specific to the feature that I want to detect. the variation is due to the object on which is set the texture. so I have to detect "only based on the texture".
My problem is that I don't know how to start. the .jpeg is "puzzled".
I can do thresholding and " basic pre-processing" on the .jpeg but I don't know how to do the feature detection which need "geodesic distance information" in addition to the texture. at least I don't know an efficient way.
I could even detect some of the features directly on the jpeg. some of them are not split on different portion of the jpeg. don't know if it can help...
My first thought was to loop on every vertex (which already doesn't sound very optimized), try to reconstruct a local (approximately the size of the feature I want to detect) not puzzled "jpeg" and do the feature detection on this not puzzled jpeg.
I tried by "attributing" the average "color value" on each vertex but I lose too much of the texture information.
My question, is there any python libraries existing to manipulate this format ?
Is there any python libraries to do feature detection on texture on mesh with this kind of texture "puzzled" ?
if not what would be the best way to process ?
I guess the loop on all vertex and local jpeg reconstruction is not ideal...

Related

Workflow to calculate depth of an object

I wanted to check if my understanding is correct. I want to calculate the depth of a crack in an object.
I have a video of the object with a crack on it captured from a smartphone. video is captured from different angles covering almost whole object. using segmentation models, I have changed the background to black keeping only object in the video.
Generate a depth map for each frame of the video using Pytorch depth estimation deep learning model.
Generate .ply file, and point cloud using depth map and frames.
calculate depth using a .ply file, but how?
Does this workflow makes sense and is it feasible? Correct me if I am wrong. Also kindly guide me in the right direction.
Removed the background of the object in the video so there should not be noise in the final output.

How can I compute orthographical projection image from perspective projection image?

My goal is to transform an image captured by a camera and transform that image to orthographical image without effects of perspective.
I have a few objects of known size on a surface. I have a camera, placed above and directed to those objects, as exemplified in the scene. The camera is capturing images as in image captured by the camera. I want to get an orthographical image of the environment as in orthographical image I want to get.
I have read few posts, but did not really understand their relevance to my problem, as I am not expert on these transforms. The answer from this question made me think it is possible, although I did not get how.
I would appreciate a clear explanation or pointing a clear tutorial, using Python or Lua if possible.
Any help is appreciated.
This was not possible without distorting the image. A straightforward explanation is that the perspective causes some parts of the image to be not visible, for example the white line in the marked area is not visible, and there could be something small that we are not able to observe. For those parts, the algorithm is supposed to produce some kind of prediction based on heuristics.

How to convert images taken in a fish eye camera into plane (rectangular) images using opencv?

Is there any predefined code for this or I have to write my own code?
Also, I do not have the camera properties for this, I have only the image taken in fisheye lens and now I have to flatten the images
OpenCV provides a module for working with fisheye images: https://docs.opencv.org/3.4/db/d58/group__calib3d__fisheye.html
This is a tutorial with an example application.
Keep in mind that your task might be a bit hard to achieve since the problem is under-determined. If you have some cues in the image (such as straight lines), that might help. Otherwise, you should seek a way of getting more information about the lens. If it's a known lens type, you might find calibration info online. Also, some images might have the lens used to capture them in the EXIF data.

Constructing a rough 3D points from structure from motion technique

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.

OpenCV: Object detection

My question is rather about feasibility of a task.
Note that I have read the solution of this question, however you can guess I am not dealing with rectangles and cameras here.
Situation:
I need to save lot of pictures in a folder all of them obeying to these rules:
In each picture, there is ONLY one object.
The object can be anything (car, horse, human hand ...)
The size and the format of the picture belong to certain set.
The background of the object is ALWAYS white.
The color of the object itself can be anything else (including, why not, areas of white pixels)
Goal:
I want to detect if the object of each image is CENTERED.
Development environment:
Python
OpenCV
Do you think this is feasible ?
I hope my question is not too broad. I just ask if this can be done automatically without human intervention on the pictures. I have thousands of them. The program will save in a separate folder pictures in which the object is not centered.
EDIT:
Following the comments and answer above: for me, a centered object is the one if I draw a square or rectangle around it, the edges of the square/rectangle must be equivalently distant from let and right sides of the image, whereas the top and the bottom of the object must be equivalently distant from the top and bottom of the picture.
Yep this is very feasible. However, depending on the type of objects the images contain, they are different ways to accomplish this. Assuming the objects in the images all have a uniform color you can easily perform a color detection algorithm, find the centre point of the object in terms of pixels and find it's position using the image resolution as the reference.
As the background is always white as specified, this is probably your best method as you can just extract all the non white (Or different shade of white) objects within the image.
if you do decide to go with this approach, i should be able to point you to some relevant code
Although writing in c++, more information on this can be found in the link below.
http://opencv-srf.blogspot.co.uk/2010/09/object-detection-using-color-seperation.html
the link is based on object detection in a video but as a video is just a series images the same concept can be used on images

Categories

Resources