Skip to content

Unable to use readme examples (except with ImageSegmentation dev'd). methoderror iterate(::Gray{Float64}) #79

@anandijain

Description

@anandijain

I'm trying to follow these docs https://juliaimages.org/stable/pkgs/segmentation/

I tried starting a temp environment with Pkg.activate(;temp=true) to ensure it wasn't just my current environment causing issues, but the following code fails. (FFTW is just because I'm on m1, I don't think it is related to my issue).

using Pkg
Pkg.add(url="https://github.com/giordano/FFTW_jll.jl")
Pkg.add(["ImageCore", "ImageSegmentation"])
using Images, ImageSegmentation, ImageFiltering
img = rand(Gray, 1000, 1000)
seeds = [(CartesianIndex(126,81),1), (CartesianIndex(93,255),2), (CartesianIndex(213,97),3)]
segments = seeded_region_growing(img, seeds)

julia> segments = seeded_region_growing(img, seeds)
ERROR: MethodError: no method matching iterate(::Gray{Float64})
  ...
Stacktrace:

After deving ImageSegmentation itself, I was able to run those last 4 lines and get seeded_region_growing to work.

I vaguely suspect it has something to do with ColorVectorSpace, as this was the only thing that stuck out as having a lower version, but having a tough time figuring out whats wrong.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions