Last night I completed a really interesting lab as part of the linear algebra class that I’ve been studying. The purpose of the lab was to build up – and make use of – some Python code to process an image taken at a certain angle and “straighten out” the perspective of an image. The processing was done using matrix operations to translate between coordinate systems – something that’s bread and butter when working with CAD, so I found it particularly interesting.
Here’s the image used as an example – a whiteboard with some writing that’s difficult to make out when viewed from this angle:
After running the code, here’s the resultant image that was generated and displayed (with some visual artifacts that I believe come from the display technology used, which basically creates a humungous HTML page with embedded SVG to generate the various pixels as skewed polygons with an RGB fill).
The whole process had me thinking that there simply have to be interesting applications of this technique for CAD data, perhaps processing captured image data to de-skew it and map it into raster images in world coordinates. That was about as far as I got, though, even though I’ve tried to spend time today considering the possibilities.
Hence this blog post, which is really a call for suggestions. Does anyone have some ideas they’d like to share on a possible application for this type of processing? Right now the code is in Python – it would take some work to replicate in a more AutoCAD-friendly language (although that may be a good reason for me to look at IronPython again, even if the code runs fairly slowly, as it currently stands). Please do post a comment to share your thoughts.