Skip to main content

implement of local laplace filter algorithm

Project description

Install

$ pip install localaplace

This is an implement of Local Laplace Filter algorithm [1] [Paper]. Just see the effect below.

Image modal Original Enhanced
RGB (800 × 533) Image 1 Image 2
RGBA (600 × 460) Image 1 Image 2
CT (3072 × 3072) Image 1 Image 2

This is a boring code when I attempt to finish my computer vision homework, but no available python package is found on PyPi

Usage

Demo is as follows, the only function is local_laplace_filter (Please see my detailed comment of the function to see the meaning of arguments):

import os

import cv2
import localaplace as llp

image = cv2.imread('./images/flower.png', cv2.IMREAD_UNCHANGED)

result = llp.local_laplace_filter(
    image, 0.2, 0.5, 0.8, 100, 
    num_workers=-1, 
    verbose=1, 
    return_layers=False
)

# save result to disk
if not os.path.exists('results'):
    os.makedirs('results')
cv2.imwrite('./results/flower_enchanced.png', result)

If you are interested in the Laplace Pyramid, set return_layers as True to get layers:

result, layers = llp.local_laplace_filter(
    image, 0.2, 0.5, 0.8, 100, 
    num_workers=-1, 
    verbose=1, 
    return_layers=True
)

# save inner layers to disk
for i, layer_image in enumerate(layers):
    cv2.imwrite(f'./results/layer_{i + 1}.png', layer_image)

Reference

[1] Paris, Sylvain, Samuel W. Hasinoff, and Jan Kautz. "Local Laplacian filters: edge-aware image processing with a Laplacian pyramid." Communications of the ACM 58.3 (2015): 81-91

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

localaplace-0.0.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

localaplace-0.0.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file localaplace-0.0.1.tar.gz.

File metadata

  • Download URL: localaplace-0.0.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for localaplace-0.0.1.tar.gz
Algorithm Hash digest
SHA256 ecfab21738cb8582484f3ebc5d994db640282ab74d3d3f800571f49b89f4f4f8
MD5 2dac4740d7da117bd5fe45010097d97e
BLAKE2b-256 550c0b3708d27bd21cfa2dca3f4bdb910e5baef89a41d9f4233d13db63cf5cef

See more details on using hashes here.

File details

Details for the file localaplace-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: localaplace-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 10.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for localaplace-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 37ebf40cbee4ae2bb6870e6084824938af56012c3fb34932e2a76d15ee998ddf
MD5 d2be81a194a96e823dda4ea77f44620a
BLAKE2b-256 4b31d549dae69803d74d09591bb97f7b2cf15c19d66fca440f19d85670a8c4b6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page