Page 2 of 5 FirstFirst 12345 LastLast
Results 11 to 20 of 41

Thread: geometric correction algorithm

  1. #11
    Join Date
    Nov 2008
    Location
    Cleveland Ohio
    Posts
    2,599

    Default

    Quote Originally Posted by trojek View Post
    What exactly do you mean by build trig functions?
    http://www.jacques-laporte.org/TheSe...Algorithms.htm

    http://www.efunda.com/math/taylor_series/trig.cfm

  2. #12
    Join Date
    Sep 2016
    Posts
    7

    Default

    Hi Trojek, I recently had this problem too and was writing custom software for correction. I found that the book explanation was not very detailed nor helpful. I also wanted to see an example calculation. So, with that in mind, let me try to type up a nice response with the formula and case examples to see how to apply the formula correctly.
    ~
    A lot of members have bragged about the plethora of solutions out there for solving this problem, but I have yet to see a single member actually illustrate an example solution showing the math and the before and after photos with their projectors.

  3. #13
    mixedgas's Avatar
    mixedgas is offline Creaky Old Award Winning Bastard Technologist
    Infinitus Excellentia Ion Laser Dominatus
    Join Date
    May 2007
    Location
    A lab with some dripping water on the floor.
    Posts
    9,890

    Default

    Oh, Those who do not know history are doomed to repeat it...
    I don't have to show you code, ok.. I can tell you that I have it in commercial software, which eliminates the need to have my own code.
    ~
    Many years ago I had a minor role in seeing to it that two major software systems in the late 90s had software correction.. I do not wish to go into the embarrassing political detail of how I conned two of my programmer friends into adding it, but trust me, the core equation posted works... Once suitable scaling and conditioning of the input data are performed. (Sorry Willie, Sorry Bob, I had no idea how angry you two would have been at me after I did that, mea culpa.)

    Steve
    Last edited by mixedgas; 01-30-2017 at 16:41.
    Qui habet Christos, habet Vitam!
    I should have rented the space under my name for advertising.
    When I still could have...

  4. #14
    Join Date
    Sep 2016
    Posts
    7

    Default

    Quote Originally Posted by mixedgas View Post
    Oh, Those who do not know history are doomed to repeat it...
    I don't have to show you code, ok.. I can tell you that I have it in commercial software, which eliminates the need to have my own code.
    You know, I am not trying to be rude. You are basically saying that you don't really know how to answer this question and you pay for commercial software that already does what OP is asking. Sure, you have a general idea of the solution and can even name some algorithms, but I personally doubt that you can work through them and apply them on your own, never mind code them. The textbook from Bill, mentioned, HAS the equations, it HAS the solution. But you know, it doesn't explain how to calculate the angles theta X and theta Y, it offers no guide as to how to determine what d is for a arbitrarily placed placed projector. For e, you have to know or be able to measure the distance between x and y axis. Then you realize umm wait, this equation inherently does not give me a location in projector analog coordinates and you are forced to determine how to convert a nearly arbitrary X, Y pair into coordinates that the projector understands.

    Say for example you wanted to draw a vertical line on the far right from top to bottom of your projection plane. You know the points should be (2^16, 2^16) and (2^16, 0) for unsigned 16-bit coordinates, but when you use those you get a really curved line. So you try to recompute those coordinates using the formula and the angles for you max X and Y field of view... but one of two things probably happen, either you get the same result, or you get coordinates that are no longer at the 16-bit scale.

    Many coders have asked for help creating their own implementations of the distortion correction and I have not seen any one offer up the solution openly. I have even seen incorrect solutions for the given problem presented by senior members. It is almost as if the senior members don't want it to become common knowledge how to correct these things. Then, at the same time, they complain that there are not enough trained people to hire. In reality, these algorithms have been around for decades and applied openly to many other fields like computer vision, which has solutions to pincushion and barrel distortion for images baked into an open-source library OpenCV. In other communities, they do not charge you a hefty price for equipment that has distortion and then charge hundreds more to fix the distortion on the expensive projector.

    If you are sending data in a 16-bit cartesian coordinate system to a projector, you expect that data to be projected in a cartesian coordinate system without distortions. Now, companies like Pangolin offer plugin hardware to fix this more or less, but the average projector enthusiast isn't going to pay $900 for it. I think that the distortion correction should come default with new projectors and here is why - to do any kind of novel development with projectors, to encourage any kind of product development not of projectors but using projectors, you have to be able to specify a coordinate, say 4cm up and to the left of the center of the projection, and have the laser actually go there.

    There are companies using laser projectors to do complexish patterns for milling and layout and so on, but most of them are developing their own proprietary software or paying premiums for laser show software that they really don't need, just to have the distortion correction capability. I'm sure that the light show software is amazing, but can they put a laser somewhere in a 50ft square area with precision of 1/16"? The capability is there, 50 feet contains 600inches or 9,600 1/16inches. Meanwhile, with 16 bits you have 65,536 grid spaces - and that is just in one dimension. Similarly, what if you want to project is a region with the projector at an angle (creates a trapezoidal plane). Most software will let you make a square our of the quadrilateral plane but you loose out on useable projection space. These are some of the considerations that should already be default so that much more complicated applications can be conceived.

    These are all trivial matters but every month someone someone asks how to do them and everyone says oh use this equation, read this 200 page book, heheh not gonna work out an example for you or just distribute the code.

  5. #15
    mixedgas's Avatar
    mixedgas is offline Creaky Old Award Winning Bastard Technologist
    Infinitus Excellentia Ion Laser Dominatus
    Join Date
    May 2007
    Location
    A lab with some dripping water on the floor.
    Posts
    9,890

    Default

    You have not seen many " incorrect" solutions presented by senior members, here. I've been on this forum since two years after it was founded. As far as I know, I'm the only "member" to have ever bothered publish anything close to how a geometry correction solution works. I've only published some hints, because I do have a professional interest in a related technology, and If I link the relevant references, I'd be giving a direct link to an astute engineer in China. I've been badly burned by that before.
    ~
    You'll find a lot of posts where I can only drop a hint, as I work in an Academic and sometimes Defense environment. I freely admit that. I've went out of my way to verify what I've posted. It took four man hours to dig thru my 1990s/2000s notes and find that generalization, and another two on the patent server to dig up the confirmation, across four patents. It works well enough for CRT based computer output microfilm when implemented in its original analog hardware, or in later software. Which was as stringent as marking in its demands.
    '
    Nobody sells the hardware fix any more... I have one board left, and I bought the "rights" to one of the many PCB designs of the laser board , the problem being, once I got my hands on it, that its a direct copy of the LSDI/Benner Design, just the board layout is different and some parts have been changed. So I'm in no mood to infringe their copyright. No one has made the boards since the late 1990s early 2000s. There is a small demand, a few units a year, only for abstract console projection on domes. I know where there are three more boards in storage. AS the industry has shifted away from graphics shows to being nearly 95% beam shows, there is no demand... Especially as most software packages have it.
    ~
    It would take me 100-200 man hours to "prove" a solution to you in code. Because if I do, it will be a useful utility when I'm done, not a code fragment for the glory of Freeware. The problem is only perhaps ten people here would ever use it, because if I do code it, it would only be for 2D frames and pre-projection. So the cycle would be project a frame, look at the results visually, apply pre-distortion, save and copy it to the show software, see how that works, make an adjustment to the pre-distortion, and repeat that cycle till you have a good looking test grid. It would not use the Pangolin or Etherdream SDKs, that simply would take weeks and weeks of free time.
    ~
    I only code in 8051 Assembler / sometimes in Atmel Assembler, and a sophisticated dialect of compiled Basic that no longer runs well on Win 10. Well, unless you count TRS-80 Basic, because I'm that old. Before I could code the correction, I'd have to code the ILDA file routines, and that is a real can of worms as many coders here can attest. And I have no desire or need to learn C, I get paid to do hardware.

    ~
    If I need PC software, I layout the related hardware, do the flow charts, plan out the math if needed, and hire a programmer. Then I assist in programming the peripherals or solving the math problems. That's a far more efficient use of my time.
    ~
    Even Benner's book only gives you how to estimate the Pincushion, not correct it, (At least not in my June, 2016, Paper Edition) and I'm guessing he started with a paper by Dr. Pierre Brosens, a retired founder of General Scanning.
    ~
    Maybe if I have some time this weekend, I'll work you an example in Excel and project it, as I have a utility that strips and recreates 2D ILDA files to CSV.
    ~
    Yes, I CAN do it, in a horribly inefficient way. I assure you I can... But I'm really doubting you bothered to even plot the transfer function I gave you on graph paper.
    !
    Steve
    Last edited by mixedgas; 01-31-2017 at 06:46.
    Qui habet Christos, habet Vitam!
    I should have rented the space under my name for advertising.
    When I still could have...

  6. #16
    Join Date
    Jun 2009
    Location
    St. Louis, MO
    Posts
    1,198

    Default

    "I think that the distortion correction should come default with new projectors and here's why..." Bullshit. "...but the average projector enthusiast isn't going to pay $900 for it." Exactly.

    The answer is (and always was) trigonometry. Characterize the surface you want to project upon. Flat screens and hemispheres spring to mind. Example: In a planetarium you have a dome with a radius. You have a projector positioned at some azimuth to an arbitrary direction. Since it's a planetarium we'll call this direction "south". The projector is some horizontal distance from the center of the dome and some vertical distance from the center of the dome. The projector is adjusted to some elevation, azimuth, and cant. Now you can assign variables for projector output angles and calculate where your projector's beam is going to hit the dome. This is the "is" value. You're half way home. You still need to define the "should be" value. Is it relative to the zenith of the dome? Is it relative to where the projector is pointing? Is it relative to where a line passing through the center of the hemisphere perpendicular to the edge of the hemisphere intersects the dome? (The dome can be tilted...) Or is it relative to something else? (is "south" part of the relative definition?) But for the purpose of this example I don't care, but you have to be able to define and calculate it. So let's assume you've defined the way to calculate your "should be" point. If you iterate through all the x/y values you get a table relating "is" values to "should be" values. Now there are several possibilities. The easiest to envision is simply recalculating your table so for a given "should be" x/y value you can look up and output the "is" x/y value to result in the "should be" point. If all you have to work with is analog circuitry you'll satisfy yourself with some painfully complex circuitry that's probably a subset of a universal solution. And the reason you'll choose a subset in the analog era is you didn't need a universal solution. You probably still don't, but some people...
    "There are painters who transform the sun into a yellow spot, but there are others who, with the help of their art and their intelligence, transform a yellow spot into the sun." Pablo Picasso

  7. #17
    Join Date
    Sep 2016
    Posts
    7

    Default

    Quote Originally Posted by mixedgas View Post
    You have not seen many " incorrect" solutions presented by senior members, here. I've been on this forum since two years after it was founded. As far as I know, I'm the only "member" to have ever bothered publish anything close to how a geometry correction solution works. I've only published some hints, because I do have a professional interest in a related technology, and If I link the relevant references, I'd be giving a direct link to an astute engineer in China. I've been badly burned by that before.
    !
    Steve
    Hi Steve,

    I appreciate your efforts and your honesty. However, I still argue that geometric correction is no where near novel. Real Chinese engineers are probably more capable at it than the rest of us. Also, who cares if they have the equations, don't we WANT them to do it right? I suppose not if you are competing with them. But who I really think this hurts is the little guys who don't have big budgets or a lot of experience in geometric correction. I'm a trained machine-vision engineer, I can work with my knowledge of image transformation and apply it to projectors, even though it *is* a pain - it is nothing that I invented.
    ~
    I appreciate you use of ~ by the way
    ~
    Anyways, alright, 100-200 man hours would be asking a bit much. Programming in assembly would definitely be overkill. Maybe it is just that no one has the implementation without commercial interests. I have research funding so what I am going to do is spend 40 hours this week coding up what I think are the basic required tools for accurate positioning of that darn laser projector beam (which is what my application's interest is in). From here
    ~
    http://www.art-science.org/journal/v...-v7n4pp155.pdf
    ~
    and here http://www.vassg.hu/pdf/vass_gg_2003_lo.pdf
    ~
    I think the community will find that when you can position a beam precisely in a 16-bit grid with any decent projector that all kinds of industrial mapping applications become possible. Maybe that will increase the demand for projectors and help everyone here out.

    Best,
    Josh

  8. #18
    Join Date
    Sep 2016
    Posts
    7

    Default

    Quote Originally Posted by mixedgas View Post
    You have not seen many " incorrect" solutions presented by senior members, here.
    !
    Steve
    I forgot to say that "incomplete" or "misleading" may have been more appropriate. You yourself acknowledge that you only post hints, which I think can cause more confusion just as easily as help someone out. Especially when your hint is to an estimation not a general solution.

  9. #19
    mixedgas's Avatar
    mixedgas is offline Creaky Old Award Winning Bastard Technologist
    Infinitus Excellentia Ion Laser Dominatus
    Join Date
    May 2007
    Location
    A lab with some dripping water on the floor.
    Posts
    9,890

    Default

    Let me see if I can do this without giving away the farm, using open source.... My fear is one particular component data sheet showing up on PL, which if I start linking the geo-correction patents, it will be found. I have a product in the works based on that component. I'm about to possibly lose my position due to unavoidable budget cuts, and I'd rather sell a small product then have to collect un-employment. I'd have a small window before some very bright people find that chip, then either copy my board or post the schematic in public domain, just because they can.. Which is the issue I have a problem with. I already lost one product to copying, and every time I walk into Wall Mart, I can mentally estimate the lost royalties...
    ~
    I do strive to post whole pieces of technology here, which is why I obtained permission for the original ILDA Standards to be linked on PL. Shortly after that, ILDA finally posted the all new Tech Comm stuff.
    ~
    Start with the legendary Jed Margolin...
    ~
    http://www.jmargolin.com/xy/xymon.pdf See pages 7-11
    http://www.jmargolin.com/uvmath/uvmath.htm
    ~
    The above is "Dynamic Pincushion" and one type of linearity correction explained pretty well..... However his stuff does not have scanner inertia, he's using e-beams.. Mentally subtract out the CRT stuff, and if you need help reducing the posted circuit to an equation let me know.. His high speed vector math is amazing. But he does not cover when the projection plane is tilted. Also note his feeding X correction into Y and Y correction into X, the recursive nature of his/their hardware. That is the key right there.
    ~
    If You'd like the rest of Dr. Chiba's papers let me know... I have them... I found them two years ago. Mostly they are focused on improving scan speed. can't post them here , but I can email if your within the US....
    ~

    Steve
    Last edited by mixedgas; 01-31-2017 at 10:10.
    Qui habet Christos, habet Vitam!
    I should have rented the space under my name for advertising.
    When I still could have...

  10. #20
    Join Date
    Jul 2008
    Location
    My momentum is too precisely determined :S
    Posts
    1,777

    Default

    Quote Originally Posted by kecked View Post
    Ps that's how your calculator calculates trig functions and exp ln.....too
    but if your doing this in software why not just use the built in trig functions
    Except most processors now use modulo and trig lookup tables instead... which would make Taylor approximations less efficient. I think. Will obviously be different depending on the type of processor but I'm fairly certain for any even modest µprocessor produced today or even ten years ago doing trigonometry based on sin/cos instead of a crude third order approximation will not have an impact on 2000 point frames at say 30 fps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •