Skip to content

Commit

Permalink
fix in gaussian, now consistent with python version
Browse files Browse the repository at this point in the history
  • Loading branch information
jonocarroll committed Feb 3, 2024
1 parent d65549b commit f51c97f
Show file tree
Hide file tree
Showing 8 changed files with 5,185 additions and 6,557 deletions.
2,498 changes: 449 additions & 2,049 deletions examples/tri_bird_fast.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
830 changes: 443 additions & 387 deletions examples/tri_bird_small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,322 changes: 1,151 additions & 1,171 deletions examples/tri_bird_small_100_refine.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3,982 changes: 2,033 additions & 1,949 deletions examples/tri_bird_small_500.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
634 changes: 338 additions & 296 deletions examples/tri_bird_small_debug.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
632 changes: 337 additions & 295 deletions examples/tri_bird_small_debug_noimage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
836 changes: 430 additions & 406 deletions examples/tri_everest.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/TriangulArt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,20 +60,20 @@ function generate_weighted_points(image::Matrix{RGB{N0f8}}, n_points::Integer=10
radius = floor(Int, length_scale)

amp = 3
entropy_width = 20
entropy_width = 0.2 * length_scale
im2 = skimage.filters.rank.entropy(im1, skimage.morphology.disk(entropy_width))

epts = Array{Int}(undef, (n_points, 2))
for n in 1:n_points
maxpos = last(findmax(im2))
x, y = getindex(maxpos, 1), getindex(maxpos, 2)
epts[n, :] = [y x]
for i in (x-radius):(x+radius)
for j in (y-radius):(y+radius)
for i in (x-2radius):(x+2radius)
for j in (y-2radius):(y+2radius)
if !checkbounds(Bool, im2, i, j)
continue
end
im2[i, j] = im2[i, j] - amp * exp(-sqrt((i - x)^2 + (j - y)^2) / 2sigma^2)
im2[i, j] = im2[i, j] - amp * exp(-((i - x)^2 + (j - y)^2) / 2sigma^2)
end
end
end
Expand Down

0 comments on commit f51c97f

Please sign in to comment.