Skip to content

Commit f4988d2

Browse files
committed
fix corner offsets in WarpAffine
1 parent 7918c34 commit f4988d2

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/projective/warp.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ function getprojection(
1818
randstate = getrandstate(tfm))
1919
T = Float32
2020
rng = Random.seed!(Random.MersenneTwister(), randstate)
21-
scale = sqrt(prod(sum.(bounds.rs)))
21+
scale = sqrt(prod(length.(bounds.rs)))
2222

2323
srcps = shuffle(rng, SVector{2, T}.(corners(bounds)))[1:3]
2424
offsets = rand(rng, SVector{2, T}, 3)
2525
offsets = map(v -> (v .* (2one(T)) .- one(T)) .* convert(T, scale * tfm.σ), offsets)
26+
2627
return threepointwarpaffine(srcps, srcps .+ offsets)
2728
end
2829

0 commit comments

Comments
 (0)