JuliaImages / ImageSegmentation.jl

Partitioning images into meaningful regions
Other
47 stars 23 forks source link

unseeded_region_growing returns MethodError #83

Closed cheetahspots01 closed 2 years ago

cheetahspots01 commented 2 years ago

I am unable to get any segmentation algorithm working, even using the example code found here. I believe the error is caused by the function default_diff_fn.

Screen Shot 2021-09-11 at 3 29 12 PM

Screen Shot 2021-09-11 at 3 33 13 PM

timholy commented 2 years ago

I think you must have some package incompatibility, perhaps because you switched environments. What version of ColorVectorSpace are you running? This shouldn't happen in a consistent environment. Can you post the results of Pkg.status()?

https://github.com/JuliaLang/julia/issues/35663

cheetahspots01 commented 2 years ago

Screen Shot 2021-09-12 at 9 24 31 AM

cheetahspots01 commented 2 years ago

It also fails (with the same error) in this environment: Screen Shot 2021-09-12 at 9 53 52 AM

originalsouth commented 2 years ago

Can reproduce with [80713f31] ImageSegmentation v1.5.1 using [c3611d14] ColorVectorSpace v0.9.7 on Julia v1.6.3.

originalsouth commented 2 years ago

@cheetahspots01 try working around the problem by doing img = real.(img) first.

ahjulstad commented 2 years ago

Something changed between v1.5.0 and v1.5.1.

This works (but changing to v1.5.1 does not):

begin
    import Pkg
    Pkg.activate(mktempdir())
    Pkg.add([
        Pkg.PackageSpec(name="Images"),
        Pkg.PackageSpec(name="ImageSegmentation", version="1.5.0"),
        Pkg.PackageSpec(name="TestImages"),
        Pkg.PackageSpec(name="ImageIO"),
        Pkg.PackageSpec(name="ImageMagick")
    ])
    Pkg.instantiate()
    using Images, ImageSegmentation, TestImages
end

##

begin
    img = testimage("coffee.png") # fullname
end;

# imshow(img)

##

begin
    seeds = [(CartesianIndex(200,200),1)]
    print(seeded_region_growing(img, seeds))
end
ahjulstad commented 2 years ago

but with the development version, it seems to work:

        Pkg.PackageSpec(name="Images", rev="master"),
        Pkg.PackageSpec(name="ImageSegmentation", rev="master"),
johnnychen94 commented 2 years ago

With Images v0.25 and ImageSegmentation v1.7 released, it should work now.