JuliaImages / JuliaImages/ImagesAPI.jl

Proposal: add abstract types ImageAlgorithm and ImageFilter

Open
#2 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
4
Forks
4
PR merge metrics
No merged PRs in 30d

Description

I propose to add two abstract types

abstract type AbstractImageAlgorithm end
abstract type AbstractImageFilter<: AbstractImageAlgorithm end

where filters are algorithms whose input and output are both images, so that they can be stacked together, i.e., new_img = old_img |> filter1 |> filter2 |> ...|> filterN.

These two types serve in two ways: as the root of the unified algorithms hierarchy system, and as a placeholder in ImagesAPI.jl


use case:

# ImagesAPI.jl
remove_noise(img, ::AbstractImageFilter) = img
# ImageNoise.jl
using ImageAPIs: AbstractImageFilter, denoise

abstract type AbstractImageDenoiseFilter <: AbstractImageFilter end
struct BlockMatching3dFiltering <: AbstractImageDenoiseFilter end
remove_noise(img::GenericImage, f::AbstractImageDenoiseFilter) = f(img)

function (f::BlockMatching3dFiltering)(img::GenericImage)
...
end

related issues:

https://github.com/JuliaImages/Images.jl/issues/772
https://github.com/zygmuntszpak/ImageBinarization.jl/issues/23
https://github.com/zygmuntszpak/ImageBinarization.jl/issues/26

cc: @zygmuntszpak

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing ImagesAPI.jl definitions and the related issues linked in the proposal. Compare the proposed AbstractImageAlgorithm and AbstractImageFilter hierarchy with the demonstrated ImageNoise.jl use case, then confirm that the resulting API supports the stated filter composition and dispatch examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.