JuliaImages / JuliaImages/ImageCore.jl

incorrect `channelview` for `ReinterpretArray` when constructed from numerical array

Open
#176 0 comments 0 reactions 1 assignee View on GitHub

@johnnychen94 is already working on this.

Since Apr 4, 2022.

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

Description

julia> data = UInt8[0, 255]
2-element Vector{UInt8}:
 0x00
 0xff

julia> img = reinterpret(Gray{N0f8}, data)
2-element reinterpret(Gray{N0f8}, ::Vector{UInt8}):
 Gray{N0f8}(0.0)
 Gray{N0f8}(1.0)

julia> channelview(img) # the eltype should be `N0f8` instead
2-element Vector{UInt8}:
 0x00
 0xff

julia> channelview(collect(img))
2-element reinterpret(reshape, N0f8, ::Array{Gray{N0f8},1}) with eltype N0f8:
 0.0N0f8
 1.0N0f8

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.