I am currently working on a project that requires me to be able to take a picture of a document (say sheet music, for example) and transform that image so it looks like the picture was taken from directly above. This functionality is similar to the app "Office Lens". Most likely, this is a problem in Linear Algebra, but I have never taken it and my friends who have taken it have no clue.  The problem is, given a picture of a document and given the four coordinates of the corners of the document and the ratio of its sides, how can I transform the picture to make the document look like it was taken from above?  My first idea was to consider a coordinate (x,y) in the picture and then define the new coordinates (x', y') to be angles from a point of intersection made by the sides of the document, but this makes no sense. If I did this, the image would appear distorted. How can I do this?
19279
I'm working on a project using Chrome - JS and Webkit 3D CSS3 transform matrix. The final goal is to create a tool for artistic projects using projectors and animation - somewhat far away from using maths... I'm using a projector to project several squares over several shapes - as seen in the picture. What I would like to do is for the user to draw 4 points on the screen (2D x and y) and from there extract a matrix object that I could apply to a regular DIV element of a dimension of 100px by 100px. By finding scaleX, scaleY, rotation, rotationX, rotationZ and probably some perspective that I could apply to the div to relatively match the surface. I'm not really familiar with geometry beyond sin and cos, and 3D in general and don't even know if that is something doable. If anyone could help me get started or point me in the right direction, I would greatly appreciate. Here is an animated gif (click to enlarge), hoping it makes it more clear to understand.
5404
I have a few digital images that are not georeferenced. E.g.:  Img01.tif   Img02.tif   ... Img99.tif     On the other hand, I have a text file, which contains georeferencing information for these images. E.g., I have a file c:\tfws\list.txt which contains the following information:  Img01.tfw 0.25 0 0 - 0.25 456258,125 4569852,125   Img02.tfw 0.25 0 0 - 0.25 456586,125 4570001,125    Img03.tfw 0.25 0 0 - 0.25 456952,125 4570300,125   ... Img99.tfw 0.25 0 0 - 0.25 458412,125 4575123,125     I need to generate a TFW file for each image in the text file. E.g. create a file named C:\tfws\img??.tfw containing the following information:  0.25   0   0   -0.25   456258,125   4569852,125     Does anyone know of a tool able to generate these TFW files automatically?
35631
Trying to follow along with a tutorial and in that tutorial the idea is to look at an object I created from the front and then set the camera to the current view.  The steps to do this are:   Numpad 1 (Front perspective) Ctrl+Alt+Numpad 0 (Align Camera to View)   For some reason whenever I do this I don't see anything in the camera and then panning the view around I see that my object seems to have moved to where I wanted the camera and my camera hasn't moved at all.
47330
Is there a tool like  available for Android or Windows systems? I'd like to  turn images into polygones/triangles like shown on the app site.
98899
My document should be letterpaper and my attachments should be a4paper. I had high hopes for the \newgeometry command from the geometry package, but the documentation says      \newgeometry is almost similar to   \geometry except that \newgeometry   disables all the options specified in   the preamble and skips the   papersize-related options: landscape,   portrait and paper size options (such   as papersize, paper=a4paper and so   forth).   Any help is appreciated!
34606
I've been doing some architectural photography and indoors with the Nikon 14-24 f2.8 lens.  Most of the time I can get my camera high enough to frame my shot and keep vertical lines vertical. But there are times when I want a low- or high-angle shot, so I end up using the new "Upright" tool in Lightroom to straighten my photos out in post.  I've never used or owned a tilt-shift lens before, so my question is how much of a difference is there between photos that have the perspective fixed in post as opposed to being shot with a tilt lens?
40698
I'm looking for an algorithm which when given a latitude and longitude pair and a vector translation in meters in Cartesian coordinates (x,y) would give me a new coordinate. Sort of like a reverse Haversine. I could also work with a distance and a heading transformation, but this would probably be slower and not as accurate. Ideally, the algorithm should be fast as I'm working on an embedded system. Accuracy is not critical, within 10 meters would be good.
35773
I came across this photo by Jacob Sutton and wanted to know if someone knew how to get this effect in photoshop?    (source: )
45916
Typically when drawing a 3D figure on paper (or a black/white board), a mathematician draws the z-axis to point due north on the page, the y-axis to point due east, and the x-axis to point due southwest (as if coming out of the page). And then the 3D objects are drawn on that; e.g., when a sphere is drawn on those axes, it looks head-on like a circle, without distortion, so that its cross-section in the yz-plane is a perfect circle.  In the answer  by @Max to my question , he shows how to create a 3d set of axes that look like that, using a Cabinet projection.  However, when the Cabinet projection is applied to a sphere, it distorts the sphere's shape, as he shows.  Is there a way to create with TikZ a 3D drawing that does draw the axes as I've described, but does not distort solid object such as a sphere?
79505
I have a photo of a blank exhibition stand and I wanted to add some content to it to show how it might look. The stand is curved and the photograph is taken at an angle. I hoped I might be able to:   Draw around the outline of the exhibition stand Convert the outline to a mesh Add text and bitmaps that automatically warp to fit the mesh, so they look like they're actually on the exhibition stand.   I’ve played about with all the warp/perspective/gradient mesh/3D tools in Illustrator and Photoshop but can’t find anything suitable. Illustrator’s perspective tool works for straightforward perspectives, but doesn’t appear to work with irregular shapes such as mine.  I can‘t find anyone else wanting to do this – perhaps I’m approaching it the wrong way? How do I go about it?
16801
I have old photos of a town and landscape around it. I'd like to take these photos again, from the same locations. In some cases I am struggling with finding the original location of the camera.   I can identify objects on the photo, I know their position on the map in some cases even their dimensions, but I don't know anything about camera or lens. Are there any techniques (or even better any ready-made software) to calculate position of the camera from the photo?
118747
Based on the equation at , I use another way to draw. My code  \documentclass[border=2mm,12pt,tikz]{standalone} \usepackage{tikz-3dplot-circleofsphere} \usepackage{fouriernc} \makeatletter \tikzset{     reuse path/.code={\pgfsyssoftpath@setcurrentpath{#1}} } \tikzset{even odd clip/.code={\pgfseteorule},     protect/.code={         \clip[overlay,even odd clip,reuse path=#1]         (-6383.99999pt,-6383.99999pt) rectangle (6383.99999pt,6383.99999pt); }} \makeatother \begin{document}     \tdplotsetmaincoords{70}{80}     \begin{tikzpicture}[tdplot_main_coords,scale=1,line join = round, line cap = round,declare function={R=5;r=4;h=sqrt(R^2 - r^2);myx= 2; myy=sqrt(R*R-h*h- myx*myx); k=-1; Angle=k*acos(r/R);}]     \path     (0,0,0) coordinate (O)     (0,0,k*h) coordinate (H)     (myx,myy,k*h) coordinate (M)     ;     \begin{scope}     \draw[save path=\sphere,thick,tdplot_screen_coords] (O) circle (R);     \end{scope}     \begin{scope} [canvas is xy plane at z=k*h]     \path[save path=\rectA] (-R,-R) rectangle (R,R);     \begin{scope}     \clip[use path=\sphere];     \draw[dashed,use path=\rectA];     \end{scope}     \tikzset{protect=\sphere}     \draw[thick,use path=\rectA];     \end{scope}         \begin{scope}[shift={(O)}]     \tdplotCsDrawLatCircle[blue, thick]{R}{{Angle}}     \end{scope}     \foreach \p in {H,M,O}     {\draw[fill=black] (\p) circle (1.5pt);}     \foreach \p/\g in {M/90,O/-135,H/30}     {\path (\p)+(\g:3mm) node{$\p$}; }     \draw[dashed] (O) -- (H) -- (M) --cycle;     \end{tikzpicture} \end{document}   I get     How can I get like this picture by using \usepackage{tikz-3dplot} to get result
54026
I have the following code and I expect the resulting angle to be 135 degrees but whatevet I try, I get 90.  \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture}  \coordinate (A) at (1,0); \coordinate (B) at (-1,1);  \pgfmathanglebetweenpoints{A}{B} \edef\angleAB{\pgfmathresult} \node at (0,0) {\angleAB};  \end{tikzpicture} \end{document}   I also tried the following command without knowing what it means, it also prints 90 except one case. The only working case is when A=(1,0) and B=(-1,0), which it prints 180.  \pgfmathanglebetweenpoints{\pgfpointanchor{A}{center}}{\pgfpointanchor{B}{center}}   Why is that? Couldn't find any reference document for "pgfmathanglebetweenpoints" by the way, that's why I am asking here.  EDIT: B is corrected from (-1,-1) to (-1,1)
115293
an image has been taken upside down, then rotated with any software, then uploaded to my Drupal website and it shows how it was originally taken because it read the Exif metadata.   Is there a way to avoid this?  or, if that's not possible,  how can I add a rotation Image Style drop down that the editor can select when creating the node?  Based on the picture preview, after uploading the picture, the editor would select an Image Style that would set the orientation of the picture right. if the picture is upside down, the editor could selec
45983
Let's say I have a shape that I rotated at an awkward angle of let's say 34°. I close the document, return a few hours later, and want to straighten the it back to its original 90° or 0° angle. The problem is I don't remember the angle I originally rotated it at. Shift + Rotating nor resetting its bounding box does the trick. Any shortcuts/options I'm overlooking here? For example how would I rotate this quadrilateral so that it sits horizontally straight and looks like a box.
3115
I see questions come up quite often that have this underlying issue, but they're all caught up in the particulars of a given feature or tool. Here's an attempt to create a canonical answer we can refer users to when this comes up - with lots of animated examples! :)    Let's say we're making a first-person camera. The basic idea is it should yaw to look left &amp; right, and pitch to look up &amp; down. So we write a bit of code like this (using Unity as an example):  void Update() {     float speed = lookSpeed * Time.deltaTime;      // Yaw around the y axis using the player's horizontal input.             transform.Rotate(0f, Input.GetAxis("Horizontal") * speed, 0f);      // Pitch around the x axis using the player's vertical input.     transform.Rotate(-Input.GetAxis("Vertical") * speed,  0f, 0f); }   or maybe  // Construct a quaternion or a matrix representing incremental camera rotation. Quaternion rotation = Quaternion.Euler(                         -Input.GetAxis("Vertical") * speed,                          Input.GetAxis("Horizontal") * speed,                          0);  // Fold this change into the camera's current rotation. transform.rotation *= rotation;   And it mostly works, but over time the view starts to get crooked. The camera seems to be turning on its roll axis (z) even though we only told it to rotate on the x and y!    This can also happen if we're trying to manipulate an object in front of the camera - say it's a globe we want to turn to look around:    The same problem - after a while the North pole starts to wander away to the left or right. We're giving input on two axes but we're getting this confusing rotation on a third. And it happens whether we apply all our rotations around the object's local axes or the world's global axes.  In many engines you'll also see this in the inspector - rotate the object in the world, and suddenly numbers change on an axis we didn't even touch!    So, is this an engine bug? How do we tell the program we don't want it adding extra rotation?  Does it have something to do with Euler angles? Should I use Quaternions or Rotation Matrices or Basis Vectors instead?
47541
I'm working on a scene that, currently, is much more convenient when the view is.. not the correct perspective. There's a word for this, but I have no idea how to phrase it and my tries to look it up has all come up with weird results. (usually directions on how to make your view point from a certain direction) This has probably already been answered here, so please bear with me; I just cannot find anything that has to do with the problem I'm having. I drew a photo to make it easy: (excuse my crappy mouse-drawing skills)  Thanks!