Coordinate mapping at an angle -


i have issue have possibly overcomplicated in head. i've been @ long time , appreciate if give me direction.

so i'm trying do, map coordinates on image taken sky, coordinate on flat surface on ground. fine directly above point, can scale coordinates factor calculated using basic trigonometry.

the problem if camera @ angle.

http://i61.tinypic.com/359wsok.png [note, height z axis here]

i hope diagram makes sense. centre line (the 1 ends @ (x2,y2) bisects 2 other lines i.e. each of outer lines (1/2)a degrees centre one. understand complicated. more horizontal camera points, more surface going in view of image. means distance between 2 pixels @ furtherest away parts of image greater distance between closer pixels 'magnified' in sense. if manage works reasonably 40 degrees vertical, great.

my first attempt size of surface in view, use scale coordinates. however, not believe worked. (x2,y2) may not in centre of captured surface , there kind of offset needs added coordinates since captured surface not directly below.

i hope clear. if need more information please let me know. i'm going around in circles bit.

thanks

i'll try give overview on algorithm used solve kind of problem. first, need know physical characteristics of camera, focal length , real size of images takes, size in pixels. if i'm saying "real" size of image means size of image (or maybe, easier imaginable, size of negative of classical film camera). example values typical medium format camera aerial mapping 50mm focal length, 9000*6800 pixels, 6microns pixel size, giving ~40x54mm image size.

the algorithm compute position of 1 pixel on ground (adapted use lsr system, 1 might geographic coordinates well):

public void imagetoground(camera sensor, double posx, double posy, double posz,      double ddeltax, double ddeltay,      matrix4d rotationmatrixitg,      double groundheight, out double resultx, out double resultx)     {         // rotation matrix right-handed, x pointing in flight direction, y right , z down.         // image cs increasing x right , y bottom (y = 0 front in flight direction)         vector3d imagepointrelativetofocalpoint = new vector3d(              ddeltax,              ddeltay,              -sensor.metricfocallength);           // transform img camera coord system , rotate.          // rotation matrix contains transformation image coordinate system camera          // coordinate system.           vector3d imagepointrotated = rotationmatrixitg * imagepointrelativetofocalpoint;           double dir, dist;           // create horizontal plane @ groundheight, pointing upwards. (z still points down)          plane plane = new plane(new vector3d(0, 0, -1), new vector3d(0, 0, -groundheight));           // , ray, starting @ given image point (including real height of image position).          // direction opposite vector given above (from image focal point).           ray start = new ray(new vector3d(imagepointrotated.x, imagepointrotated.y, imagepointrotated.z - evhasl),      -(new vector3d(imagepointrotated.x, imagepointrotated.y, imagepointrotated.z)));           // find point ray intersects plane (this on opposite side of          // x , y axes, because ray goes trough origin).           intersectionpair p = start.intersects(plane);          if (p.numintersections < 1)          {              resultx = 0;              resulty = 0;              return;          }           resultx = p.intersection1.x;          resulty = p.intersection1.y;     } 

with posx, posy, posz: position of image center; ddeltax, ddeltay: position (in meters) of pixel on focal plane; rotationmatrixitg: image ground rotation matrix, created yaw, pitch, roll of image; groundheight: elevation of ground; resultx, resulty: result position on ground. have simplified algorithm, might need adjust meet needs.

the problem gets more complex when terrain not flat. if whole image needs projected ground, 1 goes inverse way, because more easy interpolation , can done in parallel.

i don't know mean "virtual" images, because created projection, there exist theoretical image parameters can used.


Comments

Popular posts from this blog

php - Magento - Deleted Base url key -

javascript - Tooltipster plugin not firing jquery function when button or any click even occur -

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -