JuliaImages / JuliaImages/ImageCore.jl

Incorrect `channelview` for `SubArray`

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

MWE:

(jl_TQljLn) pkg> st
Status `/tmp/jl_TQljLn/Project.toml`
  [a09fc81d] ImageCore v0.9.4

julia> x = rand(3,100,100,10); # 10 images

julia> @views x1 = x[:,:,:,1]; # first image

julia> size(x1)
(3, 100, 100)

julia> rgb_x1 = colorview(RGB, x1);

julia> size(rgb_x1)
(100, 100)

julia> channelview(rgb_x1) |> size
(3, 100, 100, 10)

julia> channelview(rgb_x1) == x # incorrect channelview
true

julia> x2 = x[:,:,:,1]; 

julia> rgb_x2 = colorview(RGB, x2);

julia> channelview(rgb_x2) |> size
(3, 100, 100)

julia> channelview(rgb_x2) == x
false

julia> channelview(rgb_x2) == x2
true

The channelview(rgb_x1) is equal to the 4D parent array of x1.

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 reproducing the Julia MWE with ImageCore v0.9.4, focusing on the channelview and colorview entry points for a SubArray. Compare channelview(rgb_x1) with the sliced parent x1 and the non-view result x2; done means the SubArray case has the expected three-dimensional channel view rather than the parent array's fourth dimension.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.