SIMD-accelerated Sobel edge detection. 5-12x faster than OpenCV single-threaded.
Project description
easobel
SIMD-accelerated Sobel edge detection. 5-12x faster than OpenCV single-threaded.
import easobel
import numpy as np
image = np.random.rand(1080, 1920).astype(np.float32)
edges = easobel.sobel(image) # single-threaded
edges = easobel.sobel_mt(image, num_threads=4) # multi-threaded
Installation
pip install easobel
Pre-built wheels for Linux x86_64, Linux aarch64, and Windows x86_64. No compiler needed.
API
easobel.sobel(image) -> np.ndarray
Single-threaded Sobel edge detection.
- Input: 2D
float32numpy array(height, width), grayscale - Output: 2D
float32array, same shape - Border pixels are zero (Sobel stencil needs 1-pixel border)
- Image must be at least 3x3
easobel.sobel_mt(image, num_threads=None) -> np.ndarray
Multi-threaded Sobel with row-striped parallelism.
- Same input/output as
sobel() num_threadsdefaults toos.cpu_count()- ctypes releases the GIL for true thread parallelism
Algorithm
Computes gradient magnitude using L1 norm: |Gx| + |Gy|.
Sobel kernels:
Gx = [-1 0 1] Gy = [-1 -2 -1]
[-2 0 2] [ 0 0 0]
[-1 0 1] [ 1 2 1]
The SIMD kernel processes 4 pixels per iteration using f32x4 vectors with a scalar tail loop for remaining pixels.
How it works
The Sobel kernel is written in Ea, a SIMD kernel compiler. Pre-compiled shared libraries are shipped in the wheel. Python handles validation and memory management via ctypes.
License
Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easobel-0.1.0-py3-none-win_amd64.whl.
File metadata
- Download URL: easobel-0.1.0-py3-none-win_amd64.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb72257cfb9ccee47c48a84c531ecf03beef778ab85f7be7513934afaff54920
|
|
| MD5 |
4c467b0a7e2cb2c999c410e3c1d21a4b
|
|
| BLAKE2b-256 |
4cc861ed6e84d5043a7d51f51b4edd944a8dd2138460ea66415aff2262913cef
|
Provenance
The following attestation bundles were made for easobel-0.1.0-py3-none-win_amd64.whl:
Publisher:
publish.yml on petlukk/easobel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easobel-0.1.0-py3-none-win_amd64.whl -
Subject digest:
bb72257cfb9ccee47c48a84c531ecf03beef778ab85f7be7513934afaff54920 - Sigstore transparency entry: 1008489781
- Sigstore integration time:
-
Permalink:
petlukk/easobel@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file easobel-0.1.0-py3-none-manylinux_2_17_x86_64.whl.
File metadata
- Download URL: easobel-0.1.0-py3-none-manylinux_2_17_x86_64.whl
- Upload date:
- Size: 13.3 kB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
780b53f136e1a175168139f54b6c90a72766799a50ad85c59f7be166412a0136
|
|
| MD5 |
54ff1629f3f48679e441df2bf46602bb
|
|
| BLAKE2b-256 |
af810ba399d4a5f323e5c16c32694c0db10bb09ae355b63984ddb0056116335b
|
Provenance
The following attestation bundles were made for easobel-0.1.0-py3-none-manylinux_2_17_x86_64.whl:
Publisher:
publish.yml on petlukk/easobel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easobel-0.1.0-py3-none-manylinux_2_17_x86_64.whl -
Subject digest:
780b53f136e1a175168139f54b6c90a72766799a50ad85c59f7be166412a0136 - Sigstore transparency entry: 1008489785
- Sigstore integration time:
-
Permalink:
petlukk/easobel@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file easobel-0.1.0-py3-none-manylinux_2_17_aarch64.whl.
File metadata
- Download URL: easobel-0.1.0-py3-none-manylinux_2_17_aarch64.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
24aabe08aa8b3a99db16f4a39f7887ef8cb4757cb14ecfe8f50067d121c6bd57
|
|
| MD5 |
aa26f85be3c6eb1e34c6d2301e0666e4
|
|
| BLAKE2b-256 |
99259feed5136e8108d1afcb2aa5e1b180e1882c976c4bbaca9eee636aca23e8
|
Provenance
The following attestation bundles were made for easobel-0.1.0-py3-none-manylinux_2_17_aarch64.whl:
Publisher:
publish.yml on petlukk/easobel
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
easobel-0.1.0-py3-none-manylinux_2_17_aarch64.whl -
Subject digest:
24aabe08aa8b3a99db16f4a39f7887ef8cb4757cb14ecfe8f50067d121c6bd57 - Sigstore transparency entry: 1008489777
- Sigstore integration time:
-
Permalink:
petlukk/easobel@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Branch / Tag:
refs/heads/main - Owner: https://github.com/petlukk
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@0ca4c0658c52770a25f1af21151ffca22952bf5f -
Trigger Event:
workflow_dispatch
-
Statement type: