I want to rotate a image with camara extri parameters matrix. but have error, can you help me amend it ? please!!!
using Images, ImageFeatures, FileIO, ImageView
using CoordinateTransformations, StaticArrays, ImageTransformations, LinearAlgebra;
img2 = load(“…/test/all_3/2.jpg”);
rot_1 = [0.999788 0.003629 -0.020254;
-0.003697 0.999988 -0.003359;
0.020242 0.003433 0.999789 ]
tran = [23.244938 -0.077094 0.316536]
rot_1 = RotMatrix{3, Float64}(rot)
H = LinearMap(rot_1)
img2_1 = ImageTransformations.warp(img2, H) # error
DimensionMismatch(“Tried to multiply arrays of size (3, 3) and (2,)”)
Stacktrace:
[1] #s177#398 at C:\Users\m1.julia\packages\StaticArrays\WmJnA\src\matrix_multiply.jl:44 [inlined]
[2] #s177#398(::Any, ::Any, ::Any, ::Any, ::Any, ::Type, ::Any, ::Any, ::Any) at .\none:0
[3] (::Core.GeneratedFunctionStub)(::Any, ::Vararg{Any,N} where N) at .\boot.jl:506
[4] * at C:\Users\m1.julia\packages\StaticArrays\WmJnA\src\matrix_multiply.jl:8 [inlined]
[5] LinearMap at C:\Users\m1.julia\packages\CoordinateTransformations\IrN9A\src\affine.jl:50 [inlined]
[6] autorange(::CartesianIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}, ::LinearMap{RotMatrix{3,Float64,9}}) at C:\Users\m1.julia\packages\ImageTransformations\2CYgE\src\autorange.jl:7
[7] warp(::Interpolations.FilledExtrapolation{RGB{Normed{UInt8,8}},2,Interpolations.BSplineInterpolation{RGB{Normed{UInt8,8}},2,Array{RGB{Normed{UInt8,8}},2},Interpolations.BSpline{Interpolations.Linear},Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}},Interpolations.BSpline{Interpolations.Linear},RGB{Normed{UInt8,8}}}, ::LinearMap{RotMatrix{3,Float64,9}}) at C:\Users\m1.julia\packages\ImageTransformations\2CYgE\src\autorange.jl:3
[8] warp(::Array{RGB{Normed{UInt8,8}},2}, ::LinearMap{RotMatrix{3,Float64,9}}) at C:\Users\m1.julia\packages\ImageTransformations\2CYgE\src\warp.jl:101
[9] top-level scope at In[264]:2
help me, please …
image is this: