can anyone provide a code for converting 2d point into 3d cordinate system

i want to map the 2d point into 3d cordinate usinf direct linear transformation algo(DLT) or using homography I am not sure how to do or which method shd i do I want the code with brief xplanation for eg i have (x1,y1),(x2,y2)...x and y denote cordinate and with ref to d same point i want in object space i.e (x,y,z) coordinate

6 Comments

Have a read here and here. It will greatly improve your chances of getting an answer.
its not abour rgb channel suppose in image plane i have a pixel value 38(gray level or 3,4,5 in rgb) and s coordinate of this value is 28,42 i.e (x,y) now i want this coordinate to be represent in cartesian plane in x,y,z nothng related to pixel value its al about coordinate value i want to convert.. u got my point???
You may have noticed you aren't getting the answer you're looking for. In this case the reason is that your question isn't clear. The best way of making sure your meaning is clear, is to use complete words and interpunction, which you haven't done so far.
Do you mean you have a photograph of some scene and you want to detect the objects in that image and find out the real world position of those objects (and thus the 3D location that was projected to your 2D pixel).
If this is what you mean, you should at the very least provide the image you are working on, because that is a very difficult problem, which may not be possible with your data. I have little experience with computer vision, but usually it uses two cameras side by side or a single camera whose movements are known.
Looks like he accepted John's answer so I guess we're done here and he got what he needed.
@ rik Wisselink i guess exactly what u are saying is right.I have used single camera i have the data set can u provide me code for this prob so that i can put the values and get my result or u need the data sets and image.. @image analyst i have accepted his ans for his explanation i didnt get what i want..rik understand my prob just i want from him what he said can he provide me the code
You just got upgraded from unintelligible to a case of doit4me. Read those links I gave you and then follow my suggestion from the second comment:
"You should at the very least provide the image you are working on, because that is a very difficult problem, which may not be possible with your data. I have little experience with computer vision, but usually it uses two cameras side by side or a single camera whose movements are known."
I don't know much about computer vision, but if I were you I would start Googling examples until you have something that is close to working. As you know the name from a specific algorithm, I suspect you are in some educational program or course. If that's the case, ask your teacher/instructor for help. It seems you need more than what you can reasonably expect to get here.

Sign in to comment.

 Accepted Answer

Sure. Trivial to do, in fact.
xy2xyz = @(x,y) [x,y,1];
For any value of x and y, this creates a new set of coordinates in the R^3 (x,y,z) domain.
It is a rather boring transformation, but it satisfies the requirements. I suppose you could have done something more exciting. Perhaps...
xy2xyz = @(x,y) [x,y,randn()];
or
xy2xyz = @(x,y) [x,y,x+2*y];
The latter can be written as
xy2xyz = @(x,y) [x,y]*[1 0 1;0 1 2];
Any of infinitely many transformations will exist. What you have not said is what mapping is appropriate.

2 Comments

ya u r right.. right word is mapping but dis transformation i dont need i wl find some solution..i want to do with DLT algorithm it contain so many parameters i know d algo but want to implement in matlab
But only you know what you want to do. So only you can write the code.

Sign in to comment.

More Answers (1)

I don't exactly know what you want, but perhaps you're thinking of colorcloud().

2 Comments

no no m not thnkng of color cloud i want 2d coordinates convert into 3d coordinate..let me xplain u know image is 2d plane but d real world is 3d (x,y,z) i.e cartesian plane converts to (x,y) i.e 2d/image plane but i want 2d plane to 3d plane means image plane to cartesian plane..now u got it or still not clear i have also mention d algo name i.e DLT

Sign in to comment.

Tags

Asked:

on 13 Sep 2017

Commented:

Rik
on 15 Sep 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!