Skip to content

Commit

Permalink
Merge pull request #5 from JuliaRobotics/23Q3/enh.imgext
Browse files Browse the repository at this point in the history
imgext fixes
  • Loading branch information
dehann authored Sep 21, 2023
2 parents effa187 + a5546b4 commit 8871750
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 49 deletions.
7 changes: 3 additions & 4 deletions ext/PyCaesarImagesExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ using TensorCast
using SHA: sha256

import PyCaesar: calcFlow, getPose, goodFeaturesToTrack, goodFeaturesToTrackORB, combinePlot
import PyCaesar: trackFeaturesFrames, trackFeaturesForwardsBackwards, makeBlobFeatureTracksPerImage_FwdBck!, makeORBParams, plotBlobsImageTracks!
import PyCaesar: whatcv
import PyCaesar: trackFeaturesFrames, trackFeaturesForwardsBackwards
import PyCaesar: makeBlobFeatureTracksPerImage_FwdBck!, makeORBParams

export calcFlow, getPose, goodFeaturesToTrack, goodFeaturesToTrackORB, combinePlot
export trackFeaturesFrames, trackFeaturesForwardsBackwards, makeBlobFeatureTracksPerImage_FwdBck!, makeORBParams, plotBlobsImageTracks!

export trackFeaturesFrames, trackFeaturesForwardsBackwards, makeBlobFeatureTracksPerImage_FwdBck!, makeORBParams

const np = PyNULL()
const cv = PyNULL()
Expand Down
43 changes: 1 addition & 42 deletions ext/services/OpenCVFeatures.jl
Original file line number Diff line number Diff line change
Expand Up @@ -225,47 +225,6 @@ function makeORBParams(
end


# visualization aid

function plotBlobsImageTracks!(
dfg::AbstractDFG,
vlb::Symbol,
key = r"IMG_FEATURE_TRACKS_FWDBCK";
fig = GLMakie.Figure(),
ax = GLMakie.Axis(fig[1,1]),
resolution::Union{Nothing,<:Tuple} = nothing,
img::Union{Nothing,<:AbstractMatrix{<:Colorant}} = nothing,
linewidth = 5
)

height = 0
if !isnothing(img)
image!(ax, rotr90(img))
height = size(img,1)
end

eb = getData(dfg,vlb,key)
img_tracks = JSON3.read(String(eb[2]), Dict{Int, Vector{Vector{Float32}}})

len = length(img_tracks)
UU = [Vector{Float64}() for k in 1:len]
VV = [Vector{Float64}() for k in 1:len]

fbk = floor(Int, (len-1)/2)
for k in 1:len
for i in -fbk:fbk
push!(UU[k], img_tracks[i][k][1])
push!(VV[k], height-img_tracks[i][k][2])
end
lines!(ax, UU[k], VV[k]; color=RGBf(rand(3)...), linewidth)
end
if !isnothing(resolution)
xlims!(ax, 0, resolution[1])
ylims!(ax, height - resolution[2], height)
# ylims!(ax, -resolution[2], 0)
end

fig
end


#
3 changes: 0 additions & 3 deletions ext/services/WeakdepsPrototypes.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@

# prototypes for functions in this PyCaesar extensions

function whatcv end

# Images.jl
function calcFlow end
function getPose end
Expand All @@ -13,7 +11,6 @@ function trackFeaturesFrames end
function trackFeaturesForwardsBackwards end
function makeBlobFeatureTracksPerImage_FwdBck! end
function makeORBParams end
function plotBlobsImageTracks! end

# RobotOS.jl
function loop! end
Expand Down

0 comments on commit 8871750

Please sign in to comment.