benstats-0.0.3
توضیحات
A Python package for calculating Benford's Law statistics on images
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | benstats-0.0.3 |
| نام | benstats |
| نسخه کتابخانه | 0.0.3 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | - |
| ایمیل نویسنده | gv-sh <gv-sh@outlook.com>, bhaumikdebanshu <bhaumikdebanshu@gmail.com> |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/benstats/ |
| مجوز | - |
# benstats
A Python package for calculating Benford's Law statistics on images
[](https://pypi.org/project/benstats)
[](https://pypi.org/project/benstats)
-----
**Table of Contents**
- [Installation](#installation)
- [License](#license)
## Installation
```console
pip install benstats
```
## Usage
### Importing the package
```python
import benstats
```
### Read an image
```python
image = benstats.read("path/to", "image.png")
```
Supported image formats: bmp, dib, jpeg, jpg, jpe, jp2, png, webp, pbm, pgm, ppm, pxm, pnm, sr, ras, tiff, tif, exr, hdr, pic
### Calculate Benford's Law statistics
```python
benstats.benstats(image, channels=['rgb', 'gray'], scale=1, min=0, max=255)
```
- `channels`: list of channels to calculate statistics for. Possible values: `rgb`, `hsv`, `gray`, `lab`, `luv`, `xyz`, `ycbcr`
- `scale`: scale factor for the image. If `scale` is less than 1, the image will be downsampled. If `scale` is greater than 1, the image will be upsampled.
- `min`: new range min to map pixel values into. Default: 0
- `max`: new range max to map pixel values into. Default: 255
Returns a dictionary of channelwise statistics.
### Plotting Benford's Law statistics
```python
benstats.benplot(image, channels=['rgb'], scale=1, min=0, max=255)
```
Same parameters as above.
## License
`benstats` is distributed under the terms of the [MIT](https://spdx.org/licenses/MIT.html) license.
-----
Built by @gv-sh @bhaumikdebanshu
نیازمندی
| مقدار | نام |
|---|---|
| - | matplotlib |
| - | numpy |
| - | opencv-python |
| - | pandas |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.7 | Python |
نحوه نصب
نصب پکیج whl benstats-0.0.3:
pip install benstats-0.0.3.whl
نصب پکیج tar.gz benstats-0.0.3:
pip install benstats-0.0.3.tar.gz