When I try to map to a quadrilateral where all the x coordinates are the same, I get the following error:
TypeError: Cannot read property '3' of undefined
at Object.inv (C:\Users\Ryan\Documents\Code\js_playground\node_modules\perspective-transform\dist\perspective-transform.js:98:17)
at getNormalizationCoefficients (C:\Users\Ryan\Documents\Code\js_playground\node_modules\perspective-transform\dist\perspective-transform.js:224:22)
at PerspT (C:\Users\Ryan\Documents\Code\js_playground\node_modules\perspective-transform\dist\perspective-transform.js:248:20)
at PerspT (C:\Users\Ryan\Documents\Code\js_playground\node_modules\perspective-transform\dist\perspective-transform.js:242:11)
at Object.<anonymous> (C:\Users\Ryan\Documents\Code\js_playground\js.js:5:14)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
I poked around in the code a bit to try to come up with a nice solution, but the best I could get was throwing in a check like:
This just maps everything to a line that is the height of the source quadrilateral and on the x coordinate that all the x points of the destination quadrilateral are on, which is fine for my use case, but I feel like there could be a better solution.
When I try to map to a quadrilateral where all the x coordinates are the same, I get the following error:
I poked around in the code a bit to try to come up with a nice solution, but the best I could get was throwing in a check like:
This just maps everything to a line that is the height of the source quadrilateral and on the x coordinate that all the x points of the destination quadrilateral are on, which is fine for my use case, but I feel like there could be a better solution.