Giter Club home page Giter Club logo

shearlab.jl's People

Contributors

arsenal9971 avatar dsweber2 avatar staticfloat avatar tkelman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

shearlab.jl's Issues

more idiomatic API

I haven't fully wrapped my head around everything the package does, but it seems super useful, and as someone not really familiar with shearlets in general, I'm really impressed with the results.

If you're interested, there are a few things that I think you could do to make your package's API a little more "julian".

  1. You include your own image loading facilities wrapping around PyPlot, but you're also depending on Images, so maybe you can try to interoperate more with the Images/FileIO stuff? It seems like you may be able to remove PyPlot as a dependency.
  2. Once you have a ShearletSystem object, you can remove a lot of information from the function names and rely on dispatch

As an example, it seems like you could have something more like:

using FileIO, Shearlab

X = load("someimg.png")
sys = ShearletSystem(args...)
transformed = dst(X, sys) # discrete shearlet transform, analogous to `fft`, `dwt`
@assert isapprox(idst(transformed, sys),  X)

It may be that shearlet() and ishearlet() are better than dst() and idst() for clarity, but the general idea is to move information from the function names into the type system, so the shearlet() function could work for 1D, 2D, whatever, depending on how the ShearletSystem was constructed. There also may be some gotchas, but IMO this would be a nice direction to move in.

Cannot update

@arsenal9971, I'm trying to update Shearlab.jl, but it failed as follows. The current version I have on this machine is 0.2.0+ (master branch). But interestingly, after this failure, I still could run Pkg.build("Shearlab") and using Shearlab without errors. But that's because these commands run on the current version on my machines, not on the latest updated version. The same thing happens on three different configurations I use, i.e., linux, Mac OS X, windows10.
Thanks a lot for your help!

julia> Pkg.update("Shearlab")
INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove
ERROR: Update finished with errors.
=> Package Shearlab cannot be updated.
GitError(Code:ERROR, Class:Checkout, Cannot checkout to invalid path 'presentations/Oberseminar/\')
macro expansion at .\libgit2\error.jl:99 [inlined]
#checkout_tree#26(::Base.LibGit2.CheckoutOptions, ::Function, ::Base.LibGit2.GitRepo, ::Base.LibGit2.GitCommit) at .\libgit2\repository.jl:233
ffmerge!(::Base.LibGit2.GitRepo, ::Base.LibGit2.GitAnnotated) at .\libgit2\merge.jl:52
#merge!#62(::Base.LibGit2.MergeOptions, ::Base.LibGit2.CheckoutOptions, ::Function, ::Base.LibGit2.GitRepo, ::Array{Base.LibGit2.GitAnnotated,1}, ::Bool) at .\libgit2\merge.jl:122
(::Base.#kw##merge!)(::Array{Any,1}, ::Base.#merge!, ::Base.LibGit2.GitRepo, ::Array{Base.LibGit2.GitAnnotated,1}, ::Bool) at .\<missing>:0
#merge!#109(::String, ::String, ::Bool, ::Base.LibGit2.MergeOptions, ::Base.LibGit2.CheckoutOptions, ::Function, ::Base.LibGit2.GitRepo) at .\libgit2\libgit2.jl:722
(::Base.#kw##merge!)(::Array{Any,1}, ::Base.#merge!, ::Base.LibGit2.GitRepo) at .\<missing>:0
(::Base.Pkg.Entry.##37#43{CompositeException})(::Base.LibGit2.GitRepo) at .\pkg\entry.jl:431
with(::Base.Pkg.Entry.##37#43{CompositeException}, ::Base.LibGit2.GitRepo) at .\libgit2\types.jl:608
update(::String, ::Set{String}) at .\pkg\entry.jl:419
(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:36
cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
#cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:36
update(::String, ::Vararg{String,N} where N) at .\pkg\pkg.jl:228
eval(::Module, ::Any) at .\boot.jl:235
eval_user_input(::Any, ::Base.REPL.REPLBackend) at .\REPL.jl:66
macro expansion at .\REPL.jl:97 [inlined]
(::Base.REPL.##1#2{Base.REPL.REPLBackend})() at .\event.jl:73
Stacktrace:
 [1] update(::String, ::Set{String}) at .\pkg\entry.jl:466
 [2] (::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}})() at .\pkg\dir.jl:36
 [3] cd(::Base.Pkg.Dir.##4#7{Array{Any,1},Base.Pkg.Entry.#update,Tuple{String,Set{String}}}, ::String) at .\file.jl:59
 [4] #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, ::Vararg{Any,N} where N) at .\pkg\dir.jl:36
 [5] update(::String, ::Vararg{String,N} where N) at .\pkg\pkg.jl:228

Cannot add v0.3.1 under Julia v1.1.0

@arsenal9971 : I tried to add the latest version of Shearlab.jl (v0.3.1) on Julia v1.1.0. But I couldn't due to the following error:

(v1.1) pkg> add Shearlab
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package Shearlab [bd728e11]:
 Shearlab [bd728e11] log:
 ├─possible versions are: [0.1.2-0.1.3, 0.2.0] or uninstalled
 ├─restricted to versions * by an explicit requirement, leaving only versions [0.1.2-0.1.3, 0.2.0]
 └─restricted by julia compatibility requirements to versions: uninstalled — no versions left

Thanks!

conv2 not found

The command cov2 is no longer implemented in julia. conv has been moved to the package DSP.jl if I'm not mistaken. After installing Shearlab directly from github (on Julia 1.8 beta) the following code doesn't work

Im #Some image
using Shearlab
nScales = 4;
shearLevels = ceil.((1:nScales)/2)
scalingFilter = Shearlab.filt_gen("scaling_shearlet");
directionalFilter = Shearlab.filt_gen("directional_shearlet");
waveletFilter = Shearlab.mirror(scalingFilter);
scalingFilter2 = scalingFilter;
full = 0;
scales = 4;
@time shearletSystem_nopar = Shearlab.getshearletsystem2D(size(Im,1), size(Im,2), scales,shearLevels,full,directionalFilter,scalingFilter,0);

This leads to the following error:

ERROR: LoadError: UndefVarError: conv2 not defined
Stacktrace:
 [1] getwedgebandpasslowpassfilters2D(rows::Int64, cols::Int64, shearLevels::Vector{Int64}, directionalFilter::Matrix{Float64}, scalingFilter::Vector{Float64}, waveletFilter::Vector{Float64}, scalingFilter2::Vector{Float64}, gpu::Int64)
   @ Shearlab ~/.julia/packages/Shearlab/m0yFj/src/2D/getshearlets2D.jl:175
 [2] preparefilters2D(rows::Int64, cols::Int64, nScales::Int64, shearLevels::Vector{Int64}, directionalFilter::Matrix{Float64}, scalingFilter::Vector{Float64}, waveletFilter::Vector{Float64}, scalingFilter2::Vector{Float64}, gpu::Int64)
   @ Shearlab ~/.julia/packages/Shearlab/m0yFj/src/2D/getshearlets2D.jl:266
 [3] getshearletsystem2D(rows::Int64, cols::Int64, nScales::Int64, shearLevels::Vector{Float64}, full::Int64, directionalFilter::Matrix{Float64}, quadratureMirrorFilter::Vector{Float64}, gpu::Int64)
   @ Shearlab ~/.julia/packages/Shearlab/m0yFj/src/2D/getshearlets2D.jl:352
 [4] top-level scope
   @ ./timing.jl:242 [inlined]
 [5] top-level scope
   @ ~/Documents/Julia Code/CS/src/main.jl:0
in expression starting at /Users/simon/Documents/Julia Code/CS/src/main.jl:578

Updates to make

  • Sparse Parallel optimization.
  • Check problem with random binary mask implementation.
  • Serial Decomposition with gpu.
  • Examples of inpainting and denoising in gpu.

Strange space shift relative to shearlab.mat

baseDomainShearletExampleTmp.pdf
Hi Hector,

@BoundaryValueProblems and I were attempting to plot the shearlets in the space domain, and noticed that there is a shift (see the image for an example, though it is somewhat difficult to see). When comparing relative to the results from shearlab.mat, this led to a relative error of 1.4 or so in the frequency domain. I'm wondering if you've done a comparison like this, and what you got.

Additionally, I believe that the shearing indexing is in the opposite order for the matlab and julia codes.

Rename to Shearlets.jl?

Given that there aren't any other shearlet packages on the horizon I think it would be OK to grab the name Shearlets.jl, to be more aligned with Wavelets.jl. It also makes it more clear that it's focused on the Shearlet transform, and not modeling mechanical shear forces or something like that.

Include FWT

Include FWT as a folder in src instead of as another library

Error in PKG

I installled julia

But julia> Pkg.add (''Shearlab'')

error: Pkg not defined

Edge effects for non-periodic data

Turns out when I use the shearlet transform on functions which are non-periodic, I get edges showing up where they shouldn't be. This also happens in the Matlab version; I haven't had time to check either pyshearlab, bendlab, or PPFT. A pretty clear example:

using Shearlab, Plots
pyplot()
X = zeros(500,500)
X[200:300,250:500] = 1
heatmap(X)
system = Shearlab.SLgetShearletSystem2D(size(X)...,3)
sheared = Shearlab.SLsheardec2D(X,system)
heatmap(abs(sheared[:,:,2]))

data:
edgeeffectsdata
Second Shearlet:
edgeeffects
The problem is on the outsides of the transformed result: there's no edge there to detect (especially on the left), but because the fft interprets the signal as periodic, we get a jump from one side to the other.

There are certainly ways to address the issue. User-side, one could just mirror the data over both axes; however, this has run into memory problems for me. Since the Shearlet transform is implemented using a fft, I suspect that there's a way to adjust the creation of the coefficients to use the dct, which is equivalent to the mirroring, without the increase in memory usage.

Make more easy to install

  • Create a module that installs fast pyjulia.
  • ArrayFire is temporarly disabled, it is too hard to make it work in any computer.

Plan for Julia v1.0.x?

Hector: it would be nice if Shearlab.jl is updated to work under Julia v1.0.x. Most of the common packages we rely on works now under Julia v1.0.1 except the plotlyjs backend of Plots.jl. But that too may be resolved in the near future. Recently, JuMP.jl has been update and works under v1.0.1. What is your plan to update Shearlab.jl?
Thanks!

Fast Fixes

  • Precision issue with OpenCL on Intel HD card.
  • ArrayFire issue with abs function.

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

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.