Giter Club home page Giter Club logo

Comments (2)

johnnychen94 avatar johnnychen94 commented on August 19, 2024 1

This issue can be seperated into two parts:

  1. we want an invertible projective transformation so that warp's default inds = autorange(img, inv(tform)) is happy with it.
  2. we might want a high-level API in ImageTransformations so that normal users don't need to talk to warp directly. We currently only have imrotate and imresize.

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.

hyrodium avatar hyrodium commented on August 19, 2024 1

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)

image

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.