right file format?

Started by
15 comments, last by troubledsoul 15 years, 4 months ago
Hello- I am newbie in this stuff since you have been in this field for a long time i thought you could guide me. My project is finding wear of an object using its x-ray.I have cad model of the object and i have the x-ray which is obtained clinically.I have to find the exact pose of the cad model which matches with the x-ray and find the difference between the x-ray i obtain using the cad model and clinical model. I need a x-ray simulator for my research which i was planning to do using an opengl program with cad model in form of .obj format and ray trace it and project the result in form of x-ray.But inorder to match with the clinical x-ray I need to rotate and translate the object i have but as you might be knowing .obj wont allow me to have any animation. so next step was chosing a file format suitable for my work and i have come across .3ds format i thought this would be appropriate for me.So all i need to do is introduce a .3ds file loader and continue the raytracing as i have planned to do with the .obj file. Since i am new to this i dont know if my thinking is right.Could you please tell me if i am right in my thinking if i am not right could you tell me what approach would be better for me? Thank you for your time.
Advertisement
You don't need any animation capability for that. All you need is a transformation matrix that modifies the orientation of the model to match with the orientation of the real world object as it was x-ray'ed. This is entirely independent of the file format you're using. It works with OBJ, 3DS or whatever other 3D file format.
Firstly thanks for the reply.Even if i have 2 parts in the model and i wish to have different rotational and translation for 2 parts will it still not matter what format it is? Because when i introduced my object in .obj format i saw that the 2 parts are fixed? so when i rotate or translate both same to rotate or translate in same direction..

Quote:Original post by troubledsoul
Firstly thanks for the reply.Even if i have 2 parts in the model and i wish to have different rotational and translation for 2 parts will it still not matter what format it is? Because when i introduced my object in .obj format i saw that the 2 parts are fixed? so when i rotate or translate both same to rotate or translate in same direction..
There is no such thing as a 'format' in OpenGL. It's all just vertex data. You cna do whatever you want with it.

It may be easier for you to just load these 2 parts as seperate models, and then control them however you like with your code.

How many x-ray images of object in same pose do you have? If it's a single one, then it's impossible to determine the pose object was in due to symmetry. Even with multiple images some poses may result in same projection.
Thank you .. is there a way of placing the image i want to be matched in background of the renderer? or a way to automate it so that i can compare the model with the x-ray and resulting image produced can be continuously compared with the clinical one and continue the rotation or translation?
I have only one x-ray .. trust me i haven't been able to get one precise pose wherein it matches leave alone many such options...
Quote:Original post by troubledsoul
I have only one x-ray .. trust me i haven't been able to get one precise pose wherein it matches leave alone many such options...


It's not possible with single image. X-ray is parallel projection.

Quote:or a way to automate it so that i can compare the model with the x-ray and resulting image produced can be continuously compared with the clinical one and continue the rotation or translation?


It's possible, but search space is absurdly large. Doing image-space comparison of computer generated and x-ray image needs sub-pixel accuracy, which means you'd need to test rotations of fraction of a degree.

But again, if you only have a single image, it's not possible to determine exact pose, only down to symmetrical solutions, and there may be many poses which match the x-ray.
But that is the only input i have.. if i do get many results as you said i would then probably the next step would be finding the most acceptable one..but seriously i haven't been that lucky so far.. i haven't been able to get even one perfect match...

Do you have any suggestions how to go about it .. if you think it is not possible??
Actually, my bad, x-rays aren't parallel. I was thinking of something else.

Quote:if i do get many results as you said i would then probably the next step would be finding the most acceptable one..but seriously i haven't been that lucky so far.. i haven't been able to get even one perfect match


Yes, and you won't be. You might need millions of image comparisons just for trivial case.

The only viable way to do this would be to perform feature space comparison. Pre-process the model to extract features, such as sharp corners. Store those as coordinates.

Extract features from image (same as before, corners for example).
Calculate the x-ray projection matrix (effectively camera transform matrix).
Now apply this matrix to the model features, and solve for rotation/translation, you should have min/max distance to planes, as well as perspective factor.

This is about as viable as it gets, and is essentially what photogrametry does. But it's still difficult with single image, since sub-pixel accuracy is almost required for somewhat accurate solution.

This topic is closed to new replies.

Advertisement