-
Notifications
You must be signed in to change notification settings - Fork 13
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
Add play and explore for 3D and framestack image playback/interaction #43
Conversation
Thanks for proposing the new functionalities. I just come back from vacation; will try this out and fix the test tomorrow night. |
function play(io::IO, arr::T, dim::Int; fps::Real=30, maxsize::Tuple = displaysize(io), paused = false) where {T<:AbstractArray} | ||
@assert dim <= ndims(arr) "Requested dimension $dim, but source array only has $(ndims(arr)) dimensions" | ||
@assert ndims(arr) <= 3 "Source array dimensions cannot exceed 3" | ||
firstframe = T <: Vector ? first(selectdim(arr, dim, 1)) : selectdim(arr, dim, 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a little bit dirty here to put the framestack support here. Indeed, a better strategy IMO is to put a lazy-view to convert Vector{<:AbstractArray{T, 2}}
to Array{T, 3}
.
- play(io::IO, framestack::Vector{T}; kwargs...) where {T<:AbstractArray} = play(io, framestack, 1; kwargs...)
+ play(io::IO, framestack::Vector{T}; kwargs...) where {T<:AbstractArray} = play(io, 3dview(framestack), 3; kwargs...)
Do you know if there's such a 3dview
tool in Julia? Or I can make one for this.
@johnnychen94 just checking in on this. I believe your plan was to extend it to ImageShow first? |
Yes, I feel it a little bit hard to maintain by mixing both terminal display and keyboard IO control. So I want to put the keyboard IO control part to ImageShow, and then extend the terminal display feature here. That said, ImageInTerminal will depend on ImageShow in the future. I'm recently started to finish my pending PRs, and this is on my to-do list.
Ideally, we need an independent package (maybe |
Superseded by JuliaImages/ImageShow.jl#29. |
I thought these methods would make more sense in here than in https://github.com/IanButterworth/VideoInTerminal.jl given they require no further deps, and feel like an extension of current ImageInTerminal offerings.
The methods that depend on VideoIO could stay in VideoInTerminal (like the webcam viewer.. which I recommend trying out!)
It's so awesome how well this works ImageInTerminal. The frame rates are really impressive. Nice work!