Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Please see the documentation for all configuration options:
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file

version: 2
enable-beta-ecosystems: true
updates:
- package-ecosystem: "julia" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
actions:
patterns:
- "*"
23 changes: 0 additions & 23 deletions .github/workflows/CompatHelper.yml

This file was deleted.

13 changes: 2 additions & 11 deletions .github/workflows/Documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,12 @@ jobs:
julia-arch: [x86]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- name: Cache artifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
uses: julia-actions/cache@v3
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Build and deploy
Expand Down
20 changes: 6 additions & 14 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,19 @@ jobs:
arch: x86

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v6
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v3
with:
version: ${{ matrix.julia-version }}

- name: Cache artifacts
uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
uses: julia-actions/cache@v3

- name: "Unit Test"
uses: julia-actions/julia-runtest@master
uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
- uses: codecov/codecov-action@v6
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ImageEdgeDetection"
uuid = "2b14c160-480b-11ea-1b58-656063328ff7"
authors = ["Dr. Zygmunt L. Szpak"]
version = "0.1.8"
version = "0.1.9"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand All @@ -15,8 +15,8 @@ StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
UnPack = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"

[compat]
DataStructures = "0.17, 0.18"
ImageCore = "0.9"
DataStructures = "0.17, 0.18, 0.19"
ImageCore = "0.9, 0.10"
ImageFiltering = "0.7"
Interpolations = "0.10, 0.11, 0.12, 0.13, 0.14"
Parameters = "0.12"
Expand Down
13 changes: 11 additions & 2 deletions test/testutils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,23 @@ function generate_test_types(number_types::AbstractArray{<:DataType}, color_type
test_types
end

function edge_detection_equality(ratio = 0.0)
function edge_detection_equality(ratio = 0.005)
# Compare edge maps as binary masks. Reference images load as N0f8 with
# values exactly in {0, 1}, but the actual may carry floating-point noise
# from upstream colorspace conversions (e.g. Lab(0,0,0) → Gray(4.38e-10),
# Lab(100,0,0) → Gray(0.9999999)) — so bit-exact comparison spuriously
# marks every pixel as different. A small `ratio` also absorbs the handful
# of near-threshold pixels that flip between edge/non-edge across library
# versions (e.g. Lab→Gray rounding shifting a few NMS pixels).
is_edge(v) = float(real(v)) > 0.5

function (ref, x)
if size(ref) != size(x)
@warn "test fails because size(ref) != size(x)"
return false
end

count = sum(ref .!= x)
count = sum(is_edge.(ref) .!= is_edge.(x))
max_count = ceil(Int, length(ref)*ratio)
rst = count <= max_count
if !rst
Expand Down
Loading