Comments (2)
This issue can be seperated into two parts:
- we want an invertible projective transformation so that
warp
's defaultinds = autorange(img, inv(tform))
is happy with it. - we might want a high-level API in ImageTransformations so that normal users don't need to talk to
warp
directly. We currently only haveimrotate
andimresize
.
we want an invertible projective transformation
The Projective
version you propose definitely works, but maybe the following is a better patch (since it doesn't introduce new concepts to the codebase):
function Base.inv(tform::CoordinateTransformations.ComposedTransformation{PerspectiveMap})
PerspectiveMap() ∘ inv(tform.t2)
end
julia> tform = PerspectiveMap() ∘ inv(AffineMap(RotX(0.3), SVector((0, 0, 0))));
julia> inv(tform)
(PerspectiveMap() ∘ AffineMap([1.0 0.0 0.0; 0.0 0.955336489125606 -0.29552020666133955; 0.0 0.29552020666133955 0.955336489125606], [-0.0, 0.0, -0.0]))
I didn't yet check whether this is equivalent to the Projective
homography, though...
we might want a high-level API in ImageTransformations
This is highly application-oriented so I don't know what your target usage is. Perhaps one just need to properly document it with some small examples #141.
FYI, I'm reaching @c42f for the privilege to CoordinateTransformations
from imagetransformations.jl.
Agreed!
I didn't yet check whether this is equivalent to the Projective homography, though...
Hmm, the tform
seems ℝ³→ℝ², so the following error occours:
julia> warp(img, tform)
ERROR: "Dimension mismatch: cannot rotate a vector of length 2"
...
I don't know what your target usage is
I mainly use homography for image registration.
(Sorry for Japanese, but this might be a good exaple: https://zenn.dev/hyrodium/articles/5dc951f378b46bedb211)
we might want a high-level API in ImageTransformations so that normal users don't need to talk to warp directly.
I think we can create impinch
method:
impinch(img, a1=>b1)
, this cause parallel translation.impinch(img, a1=>b1, a2=>b2)
, this cause similarity transformation.impinch(img, a1=>b1, a2=>b2, a3=>b3)
, this cause affine transformation.impinch(img, a1=>b1, a2=>b2, a3=>b3, a4=>b4)
, this cause projective transformation.
(I'm not sure "pinch" is an appropriate name for it.)
from imagetransformations.jl.
Related Issues (20)
- Does ForwardDiff work with ImageTransformations? HOT 3
- demo: grid stretching and elastic transformation
- add swirl function HOT 1
- Images getting generated differently HOT 4
- No stable version document is deployed HOT 6
- Demos using CoordinateTransformations and Rotations
- Repeated warping HOT 6
- `imrotate(img, pi/2)` changes size of image HOT 3
- Clarification of rotations HOT 7
- Rotation operation is inaccurate HOT 2
- Custom image transformation? HOT 4
- imresize without interpolation for integer upscaling
- imflip function
- The reference frame associated to an image is not the best one to perform a shear transformation HOT 6
- Support for autodiff in warping?
- Support v0.15 of Interpolations.jl HOT 1
- Warp seems to be off HOT 1
- Add docs for imresize!
- Cropping after warp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from imagetransformations.jl.