Closed juliohm closed 5 years ago
I'm not quite sure how to answer that, to me the help text for Percentile
explains its purpose pretty clearly. HomogenousPoint
could just as well move to CoordinateTransformations
or something.
Thank you Tim, so these two could live in another source file or another package in the project? I find it strange that these two concepts currently live in the main project file alone.
The location is reasonably arbitrary, however we don't (yet) need them in any lower-down dependency. I'm fine with moving them if that makes more sense.
I wrote the homogeneous_point_to_indices
as part of the sub-pixel corner detection corner2subpixel
code in corner.jl
. Homogeneous coordinates are used throughout computer vision for various projective geometry operations so I thought that the sub-pixel corners may as well be already stored as homogeneous points. However, I have subsequently discovered the StaticArrays
package and now I tend to store points as length-2 static arrays, and just append a 1 to convert to homogeneous coordinates by using the push
function of SVector
whenever I need to do a projective geometry operation.
Hence, I would actually like to move away from the current definition of HomogeneousPoint
type and use an SVector
instead. However, there was some issue with creating custom indexing behavior for an SVector
I reckon that we still need to overwrite Base.to_indices
and add some kind of subpixel_to_indices
function somewhere in the Image ecosystem. The reason for this is that we would like to be able to plot corner points that are known with subpixel precision, or we might want to extract a local neighbourhood of pixels around a corner point which is known to subpixel precision. CartesianIndex
assumes integer values, but we actually need some way to index into an array with floating point values.
Thank you @zygmuntszpak for clarifying :+1: I will not touch the code given that you have nicer plans for it.
Please feel free to close this issue when you have it solved. The src/Images.jl file is already a little cleaner in https://github.com/JuliaImages/Images.jl/pull/734 but that PR will only be merged after the issues with ColorTypes.jl and Colors.jl are fixed.
@zygmuntszpak can I move the definitions to corner.jl meanwhile and close this issue?
Yes, absolutely!
Dear all,
What is this code for?
and should it be moved somewhere else other than
src/Images.jl
?