JuliaImages / JuliaImages/ImageFiltering.jl

Error When Using `SMatrix` for FIR Separable Filtration

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

Nobody has claimed this yet.

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

Description

This code works:

using Images;
using StaticArrays;

mA = rand(RGB{Float32}, 2048, 2048);

vW = [0.2f0 -0.5f0 0.3f0];
vW = centered(vW);

imfilter(mA, (vW', vW), "replicate", ImageFiltering.Algorithm.FIR());

Yet with this change:

using Images;
using StaticArrays;

mA = rand(RGB{Float32}, 2048, 2048);

vW = SMatrix{1, 3, Float32}([0.2f0 -0.5f0 0.3f0]);
vW = centered(vW);

imfilter(mA, (vW', vW), "replicate", ImageFiltering.Algorithm.FIR());

It will fail.

Environment information:

  • OS: Windows 10 64 Bit.
  • Julia: 1.8.3.
  • Images.jl: 0.25.2.
  • ImageFiltering.jl: 0.7.2.

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 running the two Julia reproductions using imfilter, centered, SMatrix, and ImageFiltering.Algorithm.FIR() to capture the failure and compare it with the working array case. Trace the FIR filtering entry point and add a regression test covering the SMatrix kernel; done means the reproducer succeeds like the regular array version.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
computer-vision
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.