Skip to main content

OpenCV 轻量扩展:Unicode 路径读写、HALCON 风格灰度缩放

Project description

ydl2

ydl2 是对 OpenCV 的轻量补充:解决 Windows 中文路径 读写问题,并提供与 HALCON 语义一致的灰度缩放算子。

安装

pip install ydl2

快速使用

import ydl2
import numpy as np

# Unicode 路径读写(Windows 中文路径)
img = ydl2.imread(r"D:\图片\测试.png")
ydl2.imwrite(r"D:\图片\输出.png", img)

# HALCON 等价算子
stretched = ydl2.scale_image_max(img)          # scale_image_max
inverted = ydl2.scale_image(img, -1.0, 255.0)  # scale_image(byte 反转)
mapped = ydl2.scale_image_range(img, 100, 200)   # scale_image_range
# 扩展区间: [100,200] -> [50,250]
mapped2 = ydl2.scale_image_range(img, (100, 50), (200, 250))

API

函数 说明
imread / imwrite / imshow 支持中文路径的读写与显示
scale_image_max 每通道 min/max 拉伸到 0–255(byte)
scale_image g' = g * Mult + Add,输出类型与输入一致
scale_image_range 区间线性映射,区间外裁到目标端点(byte)

依赖

  • Python >= 3.8
  • numpy >= 1.21
  • opencv-python >= 4.6

链接

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

ydl2-0.1.3.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ydl2-0.1.3-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file ydl2-0.1.3.tar.gz.

File metadata

  • Download URL: ydl2-0.1.3.tar.gz
  • Upload date:
  • Size: 8.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ydl2-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a79ff3ec995e40e0fddc2cb3d674e5d9fe9784a8ee81c1dfa717c9b827ddcab8
MD5 5e61d34dd0f924112f8a7fabe2afdbd7
BLAKE2b-256 372d125374a625f9556317ad80bb3d4dbc481ae3c0ba1e073a6d05efd2bc5fe1

See more details on using hashes here.

File details

Details for the file ydl2-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: ydl2-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 9.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for ydl2-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 08fd668024e577485951960b7f25f1ddf360948867366a7e678818cf66d19745
MD5 e8db6fcfa69ae6497ac4daea1b920e91
BLAKE2b-256 f8d2a8300bf0deb3da8f8bdd38e371c89226a1913b396b3ea23dfb4873dd33a5

See more details on using hashes here.

Supported by

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