Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect channelview for SubArray #188

Open
ymtoo opened this issue Nov 10, 2022 · 0 comments
Open

Incorrect channelview for SubArray #188

ymtoo opened this issue Nov 10, 2022 · 0 comments

Comments

@ymtoo
Copy link

ymtoo commented Nov 10, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant