Skip to content

Commit

Permalink
Merge pull request #983 from JuliaRobotics/23Q3/refac/moreros
Browse files Browse the repository at this point in the history
refac toImage
  • Loading branch information
dehann authored Sep 22, 2023
2 parents 69be612 + c60a550 commit 9ff48fe
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
7 changes: 2 additions & 5 deletions ext/CaesarImagesExt.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
module CaesarImagesExt

@info "Loading Caesar tools related to Images.jl."


using Images
# using ImageTransformations
using ColorVectorSpace
Expand All @@ -28,7 +25,7 @@ import GeometricalPredicates as GeoPr
import ApproxManifoldProducts: sample, _update!
import IncrementalInference: getSample, preambleCache, _update!, getManifold

import Caesar: applyMaskImage, makeMaskImage, makeMaskImages, imhcatPretty, toImage
import Caesar: applyMaskImage, makeMaskImage, makeMaskImages, imhcatPretty
import Caesar: writevideo, csmAnimationJoinImgs, csmAnimateSideBySide, makeVideoFromData
import Caesar: overlayScanMatcher
import Caesar: overlayScatter, overlayScatterMutate
Expand All @@ -46,7 +43,7 @@ import Caesar: unionFeatureMountain, sortKeysMinSighting
# NOTE usage requires ImageFeatures.jl
import Caesar: curateFeatureTracks

include("Images/ROSImageConversion.jl")

include("Images/ImageMask.jl")
include("Images/ImageToVideoUtils.jl")
include("Images/ScanMatcherUtils.jl")
Expand Down
2 changes: 2 additions & 0 deletions src/Caesar.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ include("beamforming/MatchedFilter.jl")
include("beamforming/SASBearing2D.jl")
include("beamforming/SASUtils.jl")

include("services/ToImage.jl")

include("3rdParty/_PCL/_PCL.jl")

# object affordance work
Expand Down
4 changes: 3 additions & 1 deletion src/ExportAPI.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,6 @@ export packBlob, unpackBlob

# imagedraw.jl
export makeImage!
export drawKeypointsAndMask
export drawKeypointsAndMask

export toImage
4 changes: 2 additions & 2 deletions ext/Images/ROSImageConversion.jl → src/services/ToImage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
$SIGNATURES
Also see: [`toROSImage`](@ref)
Also see: [`PyCaesar.toROSImage`](@ref)
"""
function toImage(msgd::Dict{String,Any})
data = haskey(msgd, "data_b64") ? base64decode(msgd["data_b64"]) : UInt8.(msgd["data"])
Expand All @@ -24,4 +24,4 @@ function toImage(msgd::Dict{String,Any})
else
error("Conversion for ROS sensor_msgs.Image encoding not implemented yet $(msgd["encoding"])")
end
end
end

0 comments on commit 9ff48fe

Please sign in to comment.