Skip to content

incorrect channelview for ReinterpretArray when constructed from numerical array #176

Open
@johnnychen94

Description

@johnnychen94
Member
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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @johnnychen94

      Issue actions

        incorrect `channelview` for `ReinterpretArray` when constructed from numerical array · Issue #176 · JuliaImages/ImageCore.jl