Sign in to follow this  

right file format?

This topic is 3293 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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..

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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??

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Extract features from image (same as before, corners for example).[quote]
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.

Any easy way of doing the feature extraction for a irregular object i mean not standard cube sphere ? some example?? some code??

Share this post


Link to post
Share on other sites
Quote:
Original post by troubledsoul
Any easy way of doing the feature extraction for a irregular object i mean not standard cube sphere ? some example?? some code??

I think you are seriously underestimating the complexity of this task. Feature extraction, shape recognition and computer vision in general are very difficult to get working reliably. In your case, it's even harder, since you are essentially comparing images of the inside of the object. And some parts of the object's outer bounds might not even be visible in the xray. Which makes it an order of magnitude more difficult.

I think the search space for an irregular object under these conditions is going to be insanely large. You'll probably need massive parallel computing resources (ie. a cluster) to search it.

Aren't you given at least some basic information about the orientation of the object with the xray ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Yann L
Quote:
Original post by troubledsoul
Any easy way of doing the feature extraction for a irregular object i mean not standard cube sphere ? some example?? some code??

I think you are seriously underestimating the complexity of this task. Feature extraction, shape recognition and computer vision in general are very difficult to get working reliably. In your case, it's even harder, since you are essentially comparing images of the inside of the object. And some parts of the object's outer bounds might not even be visible in the xray. Which makes it an order of magnitude more difficult.

I think the search space for an irregular object under these conditions is going to be insanely large. You'll probably need massive parallel computing resources (ie. a cluster) to search it.

Aren't you given at least some basic information about the orientation of the object with the xray ?



The information i have is the distance between source and object and distance between object and the projection screen.

No information about the orientation of the object,The first step of proceeding in this was seeing the x-ray and adjusting the object approximately to match with the orientation of the x-ray and do adjustments to match it better..

Share this post


Link to post
Share on other sites
That's why i was wondering if there is a way to keep the clinical x-ray in background on the renderer of the model. and orient the model manually using the keyboard or mouse... so that initial adjustment can be set as close to the projected image and later use an iterative adjustment of translations and rotations to match it better.

Share this post


Link to post
Share on other sites
Quote:
Original post by troubledsoul
That's why i was wondering if there is a way to keep the clinical x-ray in background on the renderer of the model.


Yes, set it as texture of a plane that is placed behind the model.

But x-rays of what? What kind of objects?

Share this post


Link to post
Share on other sites
I have the image in the form of picture.. so i can directly use it as a .jpeg ,tif.. or n e other picture format which ever is suitable for it.... could you guide me as to how to set the texture as background??

Share this post


Link to post
Share on other sites

This topic is 3293 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this