Skip to main content

No project description provided

Project description

What is it

imagetk是一个图像分析的Python包,用以进行图像处理、特征提取、边缘检测等。

imagetk is a Python package providing image process, feature extraction, and edge detection.

Where to get it

最新版本的源码和编译安装包可以在Python package index获取。

The source code and binary installers for the latest released version are available at the [Python package index].

https://pypi.org/project/imagetk

可以用pip安装imagetk。

You can install protege like this:

pip install imagetk

也可以用setup.py安装。

Or in the protege directory, execute:

python setup.py install

How to use it

特征提取

brisque

from imagetk import feature
import numpy
from PIL import Image

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
brisque_feature=feature.brisque(image)#brique特征计算

mean_grad

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
mean_grad=feature.mean_grad(image)#mean_grad计算

gray_quantile_expose

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
bright,dark=feature.gray_quantile_expose(image,q=0.75,pix=(96,192))#gray_quantile_expose计算

block_value_expose

image=Image.open("test.png")#图片读取
image=numpy.array(image)#转换为numpy.array
bright,dark=feature.block_value_expose(array,stride=8,channel_first=False)

cumprob

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
cumprob=feature.cumprob(image)

边缘检测

sobel

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
edges=edge.sobel(image)

canny

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
edges=edge.canny(image,kernel_size=3,sigma=1)

houghline

from imagetk import threshold

image=Image.open("test.png")#图片读取
image = image.convert('L')#转换为灰度图
image=numpy.array(image)#转换为numpy.array
# 二值化处理
thres=threshold.otsu(image)
image[image>thres]=255
image[image<=thres]=0
# 边缘检测
edge_image=edge.canny(image).astype(numpy.uint8)
# houghline 检测
lines=edge.houghlines(edge_image, rho=1, theta=numpy.pi/180, threshold=100)

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

imagetk-0.1.2.tar.gz (343.6 kB view details)

Uploaded Source

Built Distribution

imagetk-0.1.2-cp312-cp312-win_amd64.whl (290.6 kB view details)

Uploaded CPython 3.12 Windows x86-64

File details

Details for the file imagetk-0.1.2.tar.gz.

File metadata

  • Download URL: imagetk-0.1.2.tar.gz
  • Upload date:
  • Size: 343.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for imagetk-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5420e0728eb2a2027db703e6d846627e2445ae2be783057ae88150cbf3ad101b
MD5 4805651d351fb2f3a51d5e6c99bae4e2
BLAKE2b-256 c013e4dfa3ea1b4cca249f914e130e14436cc6bf2122f031d1951b8da00a0e2e

See more details on using hashes here.

File details

Details for the file imagetk-0.1.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: imagetk-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 290.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.0

File hashes

Hashes for imagetk-0.1.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cac806fd203a8cf3d34508fcc3883d07eafd1afde6f294bf5680bcac3d39a070
MD5 7516577a19b526b02db5f3959929453d
BLAKE2b-256 3f469822374be47819a2cef1a59fcddab92e44150aa13cf0914caffaa611742b

See more details on using hashes here.

Supported by

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