Skip to content

Make OffsetArray usable in edge.jl #926

@vis-florum

Description

@vis-florum

Currently, when trying to detect edges with canny() for an image in an OffsetArray, error occurs because of an indexing issue in thin_edges_nonmaxsup_core!().
In specific, the problem seems to be from line 301 onwards because:
[...]
(height,width) = size(img)

for x = 1:width, y = 1:height
    (c = img[y,x]) == 0 && continue  # For thresholded images

[...]
the image is addressed by x and y which depend on the absolute size of the array.
Instead, one could maybe change it to use CartesianIndices of the image instead.

I would be great to be able to use OffsetArray and the CartesianIndices because both are extensively used throughout the Images.jl package.

Thanks for your great work!

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