OrangeLab


NameOrangeLab JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://www.pythonanywhere.com/
SummaryThe Python module developed for the Orange Python Tool Plugin serves a dual purpose, providing functionalities for both image processing using OpenCV and the generation of synthetic datasets through the Faker library.
upload_time2023-11-17 19:40:38
maintainer
docs_urlNone
authorNagiPragalathan
requires_python
licenseMIT
keywords image processing computer vision color analysis color design color palette image enhancement image filters feature extraction pattern recognition color manipulation image segmentation color spaces histogram equalization edge detection contrast adjustment saturation control hue adjustment color grading image restoration color correction digital image processing visual perception color harmony color psychology image effects texture synthesis color transfer image compression color quantization optical character recognition (ocr) machine learning for image processing deep learning in image processing neural networks and fuzzy logic robotics and autonomous vehicles medical imaging microscopy remote sensing astronomy geological surveying
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
# OrangeLab

<div style="text-align:center">
  <img src="https://img.recraft.ai/wQ0kjs2kMmj5eWcJqeRcP_JMtDZ9DJN2Ma3v5sLdBDI/rs:fit:1024:1024:0/q:80/g:no/plain/abs://prod/images/15803871-d5b3-4b04-bc9e-7659de4894ab@avif" width="100" style="border-radius:15px" />
</div>
<br/>
The Python module developed for the Orange Python Tool Plugin serves a dual purpose, providing functionalities for both image processing using OpenCV and the generation of synthetic datasets through the Faker library.

[GitHub](https://github.com/NagiPragalathan/OrangeLab)
<br/>
<br/>
<br/>

# Fake Dataset Generator Documentation

## Introduction

The `generate_fake_dataset` function is designed to generate a fake dataset based on the provided configuration using the Faker library. This can be useful for testing, development, or generating sample data.

## Function Signature

```python
generate_fake_dataset(num_rows, path="fake_dataset.csv", none_values=True, table_head=None)
```

- `num_rows`: Number of rows to generate in the dataset.
- `path`: The path where the generated dataset will be saved. Default is "fake_dataset.csv".
- `none_values`: Whether to include None values in the generated dataset. Default is `True`.
- `table_head`: A dictionary specifying the columns and their configurations.

## Column Configuration

The `table_head` dictionary defines the columns of the dataset, where each key is the column name, and the value is a dictionary specifying the column configuration. Supported configurations include:

- `type`: Faker provider type (e.g., "name", "email", "passport_gender").
- `dtype`: Data type (e.g., "int").
- `range`: Range of values for integer columns (e.g., "1-100").
- `len`: Length of integer columns.

## Example Usage

```python
import pandas as pd
from faker import Faker

# Define the column configurations
table_head = {
    "name": {"type": "name"},
    "email": {"type": "email"},
    "gender": {"type": "passport_gender"},
    "age": {"dtype": "int", "range": "10-100"},
    "score": {"dtype": "int", "range": "10-100"},
    "time_s": {"dtype": "int", "range": "10-100"},
}

# Generate a fake dataset with 500 rows and save it to a CSV file
generate_fake_dataset(500, "sample.csv", True, table_head)
```

## Supported Faker Providers

The `Faker` library provides a wide range of providers for generating fake data. Some of the supported types include:

```python
Types = [ "aba", "add_provider", "address", "administrative_unit", "am_pm", "android_platform_token", "ascii_company_email", "ascii_email", "ascii_free_email", "ascii_safe_email", "bank_country", "basic_phone_number", "bban", "binary", "boolean", "bothify", "bs", "building_number", "cache_pattern", "catch_phrase", "century", "chrome", "city", "city_prefix", "city_suffix", "color", "color_hsl", "color_hsv", "color_name", "color_rgb", "color_rgb_float", "company", "company_email", "company_suffix", "coordinate", "country", "country_calling_code", "country_code", "credit_card_expire", "credit_card_full", "credit_card_number", "credit_card_provider", "credit_card_security_code", "cryptocurrency", "cryptocurrency_code", "cryptocurrency_name", "csv", "currency", "currency_code", "currency_name", "currency_symbol", "current_country", "current_country_code", "date", "date_between", "date_between_dates", "date_object", "date_of_birth", "date_this_century", "date_this_decade", "date_this_month", "date_this_year", "date_time", "date_time_ad", "date_time_between", "date_time_between_dates", "date_time_this_century", "date_time_this_decade", "date_time_this_month", "date_time_this_year", "day_of_month", "day_of_week", "del_arguments", "dga", "domain_name", "domain_word", "dsv", "ean", "ean13", "ean8", "ein", "email", "emoji", "enum", "factories", "file_extension", "file_name", "file_path", "firefox", "first_name", "first_name_female", "first_name_male", "first_name_nonbinary", "fixed_width", "format", "free_email", "free_email_domain", "future_date", "future_datetime", "generator_attrs", "get_arguments", "get_formatter", "get_providers", "hex_color", "hexify", "hostname", "http_method", "iana_id", "iban", "image", "image_url", "internet_explorer", "invalid_ssn", "ios_platform_token", "ipv4", "ipv4_network_class", "ipv4_private", "ipv4_public", "ipv6", "isbn10", "isbn13", "iso8601", "items", "itin", "job", "json", "json_bytes", "language_code", "language_name", "last_name", "last_name_female", "last_name_male", "last_name_nonbinary", "latitude", "latlng", "lexify", "license_plate", "linux_platform_token", "linux_processor", "local_latlng", "locale", "locales", "localized_ean", "localized_ean13", "localized_ean8", "location_on_land", "longitude", "mac_address", "mac_platform_token", "mac_processor", "md5", "military_apo", "military_dpo", "military_ship", "military_state", "mime_type", "month", "month_name", "msisdn", "name", "name_female", "name_male", "name_nonbinary", "nic_handle", "nic_handles", "null_boolean", "numerify", "opera", "optional", "paragraph", "paragraphs", "parse", "passport_dates", "passport_dob", "passport_full", "passport_gender", "passport_number", "passport_owner", "password", "past_date", "past_datetime", "phone_number", "port_number", "postalcode", "postalcode_in_state", "postalcode_plus4", "postcode", "postcode_in_state", "prefix", "prefix_female", "prefix_male", "prefix_nonbinary", "pricetag", "profile", "provider", "providers", "psv", "pybool", "pydecimal", "pydict", "pyfloat", "pyint", "pyiterable", "pylist", "pyobject", "pyset", "pystr", "pystr_format", "pystruct", "pytimezone", "pytuple", "random", "random_choices", "random_digit", "random_digit_above_two", "random_digit_not_null", "random_digit_not_null_or_empty", "random_digit_or_empty", "random_element", "random_elements", "random_int", "random_letter", "random_letters", "random_lowercase_letter", "random_number", "random_sample", "random_uppercase_letter", "randomize_nb_elements", "rgb_color", "rgb_css_color", "ripe_id", "safari", "safe_color_name", "safe_domain_name", "safe_email", "safe_hex_color", "sbn9", "secondary_address", "seed", "seed_instance", "seed_locale", "sentence", "sentences", "set_arguments", "set_formatter", "sha1", "sha256", "simple_profile", "slug", "ssn", "state", "state_abbr", "street_address", "street_name", "street_suffix", "suffix", "suffix_female", "suffix_male", "suffix_nonbinary", "swift", "swift11", "swift8", "tar", "text", "texts", "time", "time_delta", "time_object", "time_series", "timezone", "tld", "tsv", "unique", "unix_device", "unix_partition", "unix_time", "upc_a", "upc_e", "uri", "uri_extension", "uri_page", "uri_path", "url", "user_agent", "user_name", "uuid4", "vin", "weights", "windows_platform_token", "word", "words", "xml", "year", "zip", "zipcode", "zipcode_in_state", "zipcode_plus4"]
```

Also you can use `supported_types()` function to find the supported types.

For a complete list of supported providers, refer to the `Faker` documentation or use the `Faker.providers` module to explore available options.

# OCR Installation and Tesseract Path Finder

## Introduction

The provided Python script includes functions to install an OCR (Optical Character Recognition) tool from an installer executable and to find the path to the Tesseract OCR executable on the system.

## Functions

### 1. `install_ocr()`

This function installs an OCR tool using an installer executable. The installer file should be specified as `ocr.exe`. The function retrieves the current script's path, combines it with the installer filename to create the full installer path, and then attempts to run the installer using `subprocess.run()`.

#### Example Usage:

```python
# Example: Install OCR
install_ocr()
```

### 2. `find_tesseract()`

This function attempts to find the path to the Tesseract OCR executable. It first checks if Tesseract is installed in a specific path (`C:\Program Files\Tesseract-OCR\tesseract.exe`). If not found, it then tries to locate Tesseract in the system's PATH using `shutil.which("tesseract")`.

#### Example Usage:

```python
# Example: Find Tesseract Path
tesseract_path = find_tesseract()

if tesseract_path:
    print(f"Tesseract found at: {tesseract_path}")
else:
    print("Tesseract not found.")
```

## Important Note

- Ensure that the installer file (`ocr.exe`) is in the same directory as the script or provide the correct path to the installer in the `install_ocr()` function.
- For `find_tesseract()`, if Tesseract is not found in the specified path or in the system's PATH, it will return `None`.

## Recommendations

- Before using `install_ocr()`, verify that the installer file is compatible with your system.
- Make sure to have the necessary permissions to install software on the system.
- If you are installing from a source other than PyPI, ensure that it is trusted or has been verified by an individual who knows what they

# Image Processing and OCR Functions Documentation

The provided Python script includes various functions for image processing using OpenCV and image-to-text extraction using Tesseract OCR. Below is the documentation for each function along with example usages.

## Image Processing Functions

### 1. `read_image(image_path)`

Read an image from the specified path using OpenCV.

#### Example Usage:

```python
image = read_image('path/to/image.jpg')
```

### 2. `display_image(img, title='Image')`

Display the image using Matplotlib.

#### Example Usage:

```python
display_image(image, title='Original Image')
```

### 3. `convert_to_grayscale(img)`

Convert the image to grayscale.

#### Example Usage:

```python
gray_image = convert_to_grayscale(image)
```

### 4. `apply_blur(img, kernel_size=(5, 5))`

Apply Gaussian blur to the image.

#### Example Usage:

```python
blurred_image = apply_blur(image, kernel_size=(9, 9))
```

### 5. `edge_detection(img, low_threshold=50, high_threshold=150)`

Apply Canny edge detection to the image.

#### Example Usage:

```python
edges = edge_detection(gray_image, low_threshold=30, high_threshold=100)
```

### 6. `resize_image(img, new_size=(300, 300))`

Resize the image to the specified dimensions.

#### Example Usage:

```python
resized_image = resize_image(image, new_size=(500, 500))
```

### 7. `adjust_brightness_contrast(img, alpha=1.5, beta=30)`

Adjust the brightness and contrast of the image.

#### Example Usage:

```python
adjusted_image = adjust_brightness_contrast(image, alpha=2.0, beta=50)
```

### 8. `apply_threshold(img, threshold_value=128, max_value=255, threshold_type=cv2.THRESH_BINARY)`

Apply a binary threshold to the image.

#### Example Usage:

```python
thresholded_image = apply_threshold(gray_image, threshold_value=100, max_value=255, threshold_type=cv2.THRESH_BINARY)
```

### 9. `apply_dilation(img, kernel_size=(5, 5))`

Apply dilation to the image.

#### Example Usage:

```python
dilated_image = apply_dilation(thresholded_image, kernel_size=(3, 3))
```

### 10. `change_image_color(img, channel, value)`

Change the intensity of a specific color channel.

#### Example Usage:

```python
modified_image = change_image_color(image, channel=2, value=50)
```

### 11. `find_and_draw_contours(img)`

Find contours in the image and draw them.

#### Example Usage:

```python
contour_image = find_and_draw_contours(thresholded_image)
```

### 12. `most_used_color(img)`

Find the most used color in the image.

#### Example Usage:

```python
most_used_color_value = most_used_color(image)
```

### 13. `image_details(img)`

Get details about the image, including dimensions and pixel values.

#### Example Usage:

```python
details = image_details(image)
```

### 14. `image_to_ascii(img, scale_factor=0.1)`

Convert the image to ASCII art.

#### Example Usage:

```python
ascii_art = image_to_ascii(image, scale_factor=0.05)
print(ascii_art)
```

## OCR Function

### 15. `extract_text_from_image(image_path, tesseract_path)`

Extract text from an image using Tesseract OCR.

#### Example Usage:

```python
text = extract_text_from_image('path/to/image.png', 'path/to/tesseract.exe')
print(text)
```

**Note**: Ensure that Tesseract is installed and provide the correct path to the Tesseract executable in the `extract_text_from_image` function you can use install_ocr() for ocr installation.

The following are additional image processing functions that enhance the capabilities of the provided script. These functions can be used in combination with the existing ones to perform a wider range of image manipulations.

### 16. `rotate_image(img, angle)`

Rotate the image by a specified angle.

#### Function Signature:

```python
rotate_image(img, angle)
```

#### Parameters:

- `img`: The input image.
- `angle`: The angle by which to rotate the image.

#### Example Usage:

```python
rotated_image = rotate_image(image, angle=45)
```

### 17. `apply_mask(img, mask)`

Apply a binary mask to the image.

#### Function Signature:

```python
apply_mask(img, mask)
```

#### Parameters:

- `img`: The input image.
- `mask`: Binary mask with the same dimensions as the image.

#### Example Usage:

```python
# Assuming 'mask' is a binary mask with the same dimensions as the image
masked_image = apply_mask(image, mask)
```

### 18. `invert_image(img)`

Invert the colors of the image.

#### Function Signature:

```python
invert_image(img)
```

#### Parameters:

- `img`: The input image.

#### Example Usage:

```python
inverted_image = invert_image(image)
```

### 19. `add_noise(img, intensity=50)`

Add random noise to the image.

#### Function Signature:

```python
add_noise(img, intensity=50)
```

#### Parameters:

- `img`: The input image.
- `intensity`: Intensity of the noise.

#### Example Usage:

```python
noisy_image = add_noise(image, intensity=30)
```

### 20. `morphological_operations(img, operation='dilate', kernel_size=(5, 5))`

Apply morphological operations (dilation or erosion) to the image.

#### Function Signature:

```python
morphological_operations(img, operation='dilate', kernel_size=(5, 5))
```

#### Parameters:

- `img`: The input image.
- `operation`: Operation to perform ('dilate' or 'erode').
- `kernel_size`: Size of the kernel for the operation.

#### Example Usage:

```python
# Dilate the image
dilated_image = morphological_operations(image, operation='dilate', kernel_size=(3, 3))

# Erode the image
eroded_image = morphological_operations(image, operation='erode', kernel_size=(3, 3))
```


Change Log
==========

0.0.0.1 (17/11/2023)
--------------------

-First Release

            

Raw data

            {
    "_id": null,
    "home_page": "https://www.pythonanywhere.com/",
    "name": "OrangeLab",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Image Processing,Computer Vision,Color Analysis,Color Design,Color Palette,Image Enhancement,Image Filters,Feature Extraction,Pattern Recognition,Color Manipulation,Image Segmentation,Color Spaces,Histogram Equalization,Edge Detection,Contrast Adjustment,Saturation Control,Hue Adjustment,Color Grading,Image Restoration,Color Correction,Digital Image Processing,Visual Perception,Color Harmony,Color Psychology,Image Effects,Texture Synthesis,Color Transfer,Image Compression,Color Quantization,Optical Character Recognition (OCR),Machine Learning for Image Processing,Deep Learning in Image Processing,Neural Networks and Fuzzy Logic,Robotics and Autonomous Vehicles,Medical Imaging,Microscopy,Remote Sensing,Astronomy,Geological Surveying",
    "author": "NagiPragalathan",
    "author_email": "nagipragalathan@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/94/50/046bc2b66d0f5ea763bfdc2da75e1042aedb67d905a3a74d618d387c0627/OrangeLab-0.0.1.tar.gz",
    "platform": null,
    "description": "\r\n# OrangeLab\r\n\r\n<div style=\"text-align:center\">\r\n  <img src=\"https://img.recraft.ai/wQ0kjs2kMmj5eWcJqeRcP_JMtDZ9DJN2Ma3v5sLdBDI/rs:fit:1024:1024:0/q:80/g:no/plain/abs://prod/images/15803871-d5b3-4b04-bc9e-7659de4894ab@avif\" width=\"100\" style=\"border-radius:15px\" />\r\n</div>\r\n<br/>\r\nThe Python module developed for the Orange Python Tool Plugin serves a dual purpose, providing functionalities for both image processing using OpenCV and the generation of synthetic datasets through the Faker library.\r\n\r\n[GitHub](https://github.com/NagiPragalathan/OrangeLab)\r\n<br/>\r\n<br/>\r\n<br/>\r\n\r\n# Fake Dataset Generator Documentation\r\n\r\n## Introduction\r\n\r\nThe `generate_fake_dataset` function is designed to generate a fake dataset based on the provided configuration using the Faker library. This can be useful for testing, development, or generating sample data.\r\n\r\n## Function Signature\r\n\r\n```python\r\ngenerate_fake_dataset(num_rows, path=\"fake_dataset.csv\", none_values=True, table_head=None)\r\n```\r\n\r\n- `num_rows`: Number of rows to generate in the dataset.\r\n- `path`: The path where the generated dataset will be saved. Default is \"fake_dataset.csv\".\r\n- `none_values`: Whether to include None values in the generated dataset. Default is `True`.\r\n- `table_head`: A dictionary specifying the columns and their configurations.\r\n\r\n## Column Configuration\r\n\r\nThe `table_head` dictionary defines the columns of the dataset, where each key is the column name, and the value is a dictionary specifying the column configuration. Supported configurations include:\r\n\r\n- `type`: Faker provider type (e.g., \"name\", \"email\", \"passport_gender\").\r\n- `dtype`: Data type (e.g., \"int\").\r\n- `range`: Range of values for integer columns (e.g., \"1-100\").\r\n- `len`: Length of integer columns.\r\n\r\n## Example Usage\r\n\r\n```python\r\nimport pandas as pd\r\nfrom faker import Faker\r\n\r\n# Define the column configurations\r\ntable_head = {\r\n    \"name\": {\"type\": \"name\"},\r\n    \"email\": {\"type\": \"email\"},\r\n    \"gender\": {\"type\": \"passport_gender\"},\r\n    \"age\": {\"dtype\": \"int\", \"range\": \"10-100\"},\r\n    \"score\": {\"dtype\": \"int\", \"range\": \"10-100\"},\r\n    \"time_s\": {\"dtype\": \"int\", \"range\": \"10-100\"},\r\n}\r\n\r\n# Generate a fake dataset with 500 rows and save it to a CSV file\r\ngenerate_fake_dataset(500, \"sample.csv\", True, table_head)\r\n```\r\n\r\n## Supported Faker Providers\r\n\r\nThe `Faker` library provides a wide range of providers for generating fake data. Some of the supported types include:\r\n\r\n```python\r\nTypes = [ \"aba\", \"add_provider\", \"address\", \"administrative_unit\", \"am_pm\", \"android_platform_token\", \"ascii_company_email\", \"ascii_email\", \"ascii_free_email\", \"ascii_safe_email\", \"bank_country\", \"basic_phone_number\", \"bban\", \"binary\", \"boolean\", \"bothify\", \"bs\", \"building_number\", \"cache_pattern\", \"catch_phrase\", \"century\", \"chrome\", \"city\", \"city_prefix\", \"city_suffix\", \"color\", \"color_hsl\", \"color_hsv\", \"color_name\", \"color_rgb\", \"color_rgb_float\", \"company\", \"company_email\", \"company_suffix\", \"coordinate\", \"country\", \"country_calling_code\", \"country_code\", \"credit_card_expire\", \"credit_card_full\", \"credit_card_number\", \"credit_card_provider\", \"credit_card_security_code\", \"cryptocurrency\", \"cryptocurrency_code\", \"cryptocurrency_name\", \"csv\", \"currency\", \"currency_code\", \"currency_name\", \"currency_symbol\", \"current_country\", \"current_country_code\", \"date\", \"date_between\", \"date_between_dates\", \"date_object\", \"date_of_birth\", \"date_this_century\", \"date_this_decade\", \"date_this_month\", \"date_this_year\", \"date_time\", \"date_time_ad\", \"date_time_between\", \"date_time_between_dates\", \"date_time_this_century\", \"date_time_this_decade\", \"date_time_this_month\", \"date_time_this_year\", \"day_of_month\", \"day_of_week\", \"del_arguments\", \"dga\", \"domain_name\", \"domain_word\", \"dsv\", \"ean\", \"ean13\", \"ean8\", \"ein\", \"email\", \"emoji\", \"enum\", \"factories\", \"file_extension\", \"file_name\", \"file_path\", \"firefox\", \"first_name\", \"first_name_female\", \"first_name_male\", \"first_name_nonbinary\", \"fixed_width\", \"format\", \"free_email\", \"free_email_domain\", \"future_date\", \"future_datetime\", \"generator_attrs\", \"get_arguments\", \"get_formatter\", \"get_providers\", \"hex_color\", \"hexify\", \"hostname\", \"http_method\", \"iana_id\", \"iban\", \"image\", \"image_url\", \"internet_explorer\", \"invalid_ssn\", \"ios_platform_token\", \"ipv4\", \"ipv4_network_class\", \"ipv4_private\", \"ipv4_public\", \"ipv6\", \"isbn10\", \"isbn13\", \"iso8601\", \"items\", \"itin\", \"job\", \"json\", \"json_bytes\", \"language_code\", \"language_name\", \"last_name\", \"last_name_female\", \"last_name_male\", \"last_name_nonbinary\", \"latitude\", \"latlng\", \"lexify\", \"license_plate\", \"linux_platform_token\", \"linux_processor\", \"local_latlng\", \"locale\", \"locales\", \"localized_ean\", \"localized_ean13\", \"localized_ean8\", \"location_on_land\", \"longitude\", \"mac_address\", \"mac_platform_token\", \"mac_processor\", \"md5\", \"military_apo\", \"military_dpo\", \"military_ship\", \"military_state\", \"mime_type\", \"month\", \"month_name\", \"msisdn\", \"name\", \"name_female\", \"name_male\", \"name_nonbinary\", \"nic_handle\", \"nic_handles\", \"null_boolean\", \"numerify\", \"opera\", \"optional\", \"paragraph\", \"paragraphs\", \"parse\", \"passport_dates\", \"passport_dob\", \"passport_full\", \"passport_gender\", \"passport_number\", \"passport_owner\", \"password\", \"past_date\", \"past_datetime\", \"phone_number\", \"port_number\", \"postalcode\", \"postalcode_in_state\", \"postalcode_plus4\", \"postcode\", \"postcode_in_state\", \"prefix\", \"prefix_female\", \"prefix_male\", \"prefix_nonbinary\", \"pricetag\", \"profile\", \"provider\", \"providers\", \"psv\", \"pybool\", \"pydecimal\", \"pydict\", \"pyfloat\", \"pyint\", \"pyiterable\", \"pylist\", \"pyobject\", \"pyset\", \"pystr\", \"pystr_format\", \"pystruct\", \"pytimezone\", \"pytuple\", \"random\", \"random_choices\", \"random_digit\", \"random_digit_above_two\", \"random_digit_not_null\", \"random_digit_not_null_or_empty\", \"random_digit_or_empty\", \"random_element\", \"random_elements\", \"random_int\", \"random_letter\", \"random_letters\", \"random_lowercase_letter\", \"random_number\", \"random_sample\", \"random_uppercase_letter\", \"randomize_nb_elements\", \"rgb_color\", \"rgb_css_color\", \"ripe_id\", \"safari\", \"safe_color_name\", \"safe_domain_name\", \"safe_email\", \"safe_hex_color\", \"sbn9\", \"secondary_address\", \"seed\", \"seed_instance\", \"seed_locale\", \"sentence\", \"sentences\", \"set_arguments\", \"set_formatter\", \"sha1\", \"sha256\", \"simple_profile\", \"slug\", \"ssn\", \"state\", \"state_abbr\", \"street_address\", \"street_name\", \"street_suffix\", \"suffix\", \"suffix_female\", \"suffix_male\", \"suffix_nonbinary\", \"swift\", \"swift11\", \"swift8\", \"tar\", \"text\", \"texts\", \"time\", \"time_delta\", \"time_object\", \"time_series\", \"timezone\", \"tld\", \"tsv\", \"unique\", \"unix_device\", \"unix_partition\", \"unix_time\", \"upc_a\", \"upc_e\", \"uri\", \"uri_extension\", \"uri_page\", \"uri_path\", \"url\", \"user_agent\", \"user_name\", \"uuid4\", \"vin\", \"weights\", \"windows_platform_token\", \"word\", \"words\", \"xml\", \"year\", \"zip\", \"zipcode\", \"zipcode_in_state\", \"zipcode_plus4\"]\r\n```\r\n\r\nAlso you can use `supported_types()` function to find the supported types.\r\n\r\nFor a complete list of supported providers, refer to the `Faker` documentation or use the `Faker.providers` module to explore available options.\r\n\r\n# OCR Installation and Tesseract Path Finder\r\n\r\n## Introduction\r\n\r\nThe provided Python script includes functions to install an OCR (Optical Character Recognition) tool from an installer executable and to find the path to the Tesseract OCR executable on the system.\r\n\r\n## Functions\r\n\r\n### 1. `install_ocr()`\r\n\r\nThis function installs an OCR tool using an installer executable. The installer file should be specified as `ocr.exe`. The function retrieves the current script's path, combines it with the installer filename to create the full installer path, and then attempts to run the installer using `subprocess.run()`.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\n# Example: Install OCR\r\ninstall_ocr()\r\n```\r\n\r\n### 2. `find_tesseract()`\r\n\r\nThis function attempts to find the path to the Tesseract OCR executable. It first checks if Tesseract is installed in a specific path (`C:\\Program Files\\Tesseract-OCR\\tesseract.exe`). If not found, it then tries to locate Tesseract in the system's PATH using `shutil.which(\"tesseract\")`.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\n# Example: Find Tesseract Path\r\ntesseract_path = find_tesseract()\r\n\r\nif tesseract_path:\r\n    print(f\"Tesseract found at: {tesseract_path}\")\r\nelse:\r\n    print(\"Tesseract not found.\")\r\n```\r\n\r\n## Important Note\r\n\r\n- Ensure that the installer file (`ocr.exe`) is in the same directory as the script or provide the correct path to the installer in the `install_ocr()` function.\r\n- For `find_tesseract()`, if Tesseract is not found in the specified path or in the system's PATH, it will return `None`.\r\n\r\n## Recommendations\r\n\r\n- Before using `install_ocr()`, verify that the installer file is compatible with your system.\r\n- Make sure to have the necessary permissions to install software on the system.\r\n- If you are installing from a source other than PyPI, ensure that it is trusted or has been verified by an individual who knows what they\r\n\r\n# Image Processing and OCR Functions Documentation\r\n\r\nThe provided Python script includes various functions for image processing using OpenCV and image-to-text extraction using Tesseract OCR. Below is the documentation for each function along with example usages.\r\n\r\n## Image Processing Functions\r\n\r\n### 1. `read_image(image_path)`\r\n\r\nRead an image from the specified path using OpenCV.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nimage = read_image('path/to/image.jpg')\r\n```\r\n\r\n### 2. `display_image(img, title='Image')`\r\n\r\nDisplay the image using Matplotlib.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ndisplay_image(image, title='Original Image')\r\n```\r\n\r\n### 3. `convert_to_grayscale(img)`\r\n\r\nConvert the image to grayscale.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ngray_image = convert_to_grayscale(image)\r\n```\r\n\r\n### 4. `apply_blur(img, kernel_size=(5, 5))`\r\n\r\nApply Gaussian blur to the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nblurred_image = apply_blur(image, kernel_size=(9, 9))\r\n```\r\n\r\n### 5. `edge_detection(img, low_threshold=50, high_threshold=150)`\r\n\r\nApply Canny edge detection to the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nedges = edge_detection(gray_image, low_threshold=30, high_threshold=100)\r\n```\r\n\r\n### 6. `resize_image(img, new_size=(300, 300))`\r\n\r\nResize the image to the specified dimensions.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nresized_image = resize_image(image, new_size=(500, 500))\r\n```\r\n\r\n### 7. `adjust_brightness_contrast(img, alpha=1.5, beta=30)`\r\n\r\nAdjust the brightness and contrast of the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nadjusted_image = adjust_brightness_contrast(image, alpha=2.0, beta=50)\r\n```\r\n\r\n### 8. `apply_threshold(img, threshold_value=128, max_value=255, threshold_type=cv2.THRESH_BINARY)`\r\n\r\nApply a binary threshold to the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nthresholded_image = apply_threshold(gray_image, threshold_value=100, max_value=255, threshold_type=cv2.THRESH_BINARY)\r\n```\r\n\r\n### 9. `apply_dilation(img, kernel_size=(5, 5))`\r\n\r\nApply dilation to the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ndilated_image = apply_dilation(thresholded_image, kernel_size=(3, 3))\r\n```\r\n\r\n### 10. `change_image_color(img, channel, value)`\r\n\r\nChange the intensity of a specific color channel.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nmodified_image = change_image_color(image, channel=2, value=50)\r\n```\r\n\r\n### 11. `find_and_draw_contours(img)`\r\n\r\nFind contours in the image and draw them.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ncontour_image = find_and_draw_contours(thresholded_image)\r\n```\r\n\r\n### 12. `most_used_color(img)`\r\n\r\nFind the most used color in the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nmost_used_color_value = most_used_color(image)\r\n```\r\n\r\n### 13. `image_details(img)`\r\n\r\nGet details about the image, including dimensions and pixel values.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ndetails = image_details(image)\r\n```\r\n\r\n### 14. `image_to_ascii(img, scale_factor=0.1)`\r\n\r\nConvert the image to ASCII art.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nascii_art = image_to_ascii(image, scale_factor=0.05)\r\nprint(ascii_art)\r\n```\r\n\r\n## OCR Function\r\n\r\n### 15. `extract_text_from_image(image_path, tesseract_path)`\r\n\r\nExtract text from an image using Tesseract OCR.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ntext = extract_text_from_image('path/to/image.png', 'path/to/tesseract.exe')\r\nprint(text)\r\n```\r\n\r\n**Note**: Ensure that Tesseract is installed and provide the correct path to the Tesseract executable in the `extract_text_from_image` function you can use install_ocr() for ocr installation.\r\n\r\nThe following are additional image processing functions that enhance the capabilities of the provided script. These functions can be used in combination with the existing ones to perform a wider range of image manipulations.\r\n\r\n### 16. `rotate_image(img, angle)`\r\n\r\nRotate the image by a specified angle.\r\n\r\n#### Function Signature:\r\n\r\n```python\r\nrotate_image(img, angle)\r\n```\r\n\r\n#### Parameters:\r\n\r\n- `img`: The input image.\r\n- `angle`: The angle by which to rotate the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nrotated_image = rotate_image(image, angle=45)\r\n```\r\n\r\n### 17. `apply_mask(img, mask)`\r\n\r\nApply a binary mask to the image.\r\n\r\n#### Function Signature:\r\n\r\n```python\r\napply_mask(img, mask)\r\n```\r\n\r\n#### Parameters:\r\n\r\n- `img`: The input image.\r\n- `mask`: Binary mask with the same dimensions as the image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\n# Assuming 'mask' is a binary mask with the same dimensions as the image\r\nmasked_image = apply_mask(image, mask)\r\n```\r\n\r\n### 18. `invert_image(img)`\r\n\r\nInvert the colors of the image.\r\n\r\n#### Function Signature:\r\n\r\n```python\r\ninvert_image(img)\r\n```\r\n\r\n#### Parameters:\r\n\r\n- `img`: The input image.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\ninverted_image = invert_image(image)\r\n```\r\n\r\n### 19. `add_noise(img, intensity=50)`\r\n\r\nAdd random noise to the image.\r\n\r\n#### Function Signature:\r\n\r\n```python\r\nadd_noise(img, intensity=50)\r\n```\r\n\r\n#### Parameters:\r\n\r\n- `img`: The input image.\r\n- `intensity`: Intensity of the noise.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\nnoisy_image = add_noise(image, intensity=30)\r\n```\r\n\r\n### 20. `morphological_operations(img, operation='dilate', kernel_size=(5, 5))`\r\n\r\nApply morphological operations (dilation or erosion) to the image.\r\n\r\n#### Function Signature:\r\n\r\n```python\r\nmorphological_operations(img, operation='dilate', kernel_size=(5, 5))\r\n```\r\n\r\n#### Parameters:\r\n\r\n- `img`: The input image.\r\n- `operation`: Operation to perform ('dilate' or 'erode').\r\n- `kernel_size`: Size of the kernel for the operation.\r\n\r\n#### Example Usage:\r\n\r\n```python\r\n# Dilate the image\r\ndilated_image = morphological_operations(image, operation='dilate', kernel_size=(3, 3))\r\n\r\n# Erode the image\r\neroded_image = morphological_operations(image, operation='erode', kernel_size=(3, 3))\r\n```\r\n\r\n\r\nChange Log\r\n==========\r\n\r\n0.0.0.1 (17/11/2023)\r\n--------------------\r\n\r\n-First Release\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "The Python module developed for the Orange Python Tool Plugin serves a dual purpose, providing functionalities for both image processing using OpenCV and the generation of synthetic datasets through the Faker library.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://www.pythonanywhere.com/"
    },
    "split_keywords": [
        "image processing",
        "computer vision",
        "color analysis",
        "color design",
        "color palette",
        "image enhancement",
        "image filters",
        "feature extraction",
        "pattern recognition",
        "color manipulation",
        "image segmentation",
        "color spaces",
        "histogram equalization",
        "edge detection",
        "contrast adjustment",
        "saturation control",
        "hue adjustment",
        "color grading",
        "image restoration",
        "color correction",
        "digital image processing",
        "visual perception",
        "color harmony",
        "color psychology",
        "image effects",
        "texture synthesis",
        "color transfer",
        "image compression",
        "color quantization",
        "optical character recognition (ocr)",
        "machine learning for image processing",
        "deep learning in image processing",
        "neural networks and fuzzy logic",
        "robotics and autonomous vehicles",
        "medical imaging",
        "microscopy",
        "remote sensing",
        "astronomy",
        "geological surveying"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "36e71c81266578bb5593034cbdba697f8600631337a388f701db139c49e10148",
                "md5": "30e0deaf5f0accbe9654ad64d9fe89f7",
                "sha256": "e4c17f30275275cb3b305605c0084d77af48b8ad4dc9553a83491c1c65ba8180"
            },
            "downloads": -1,
            "filename": "OrangeLab-0.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "30e0deaf5f0accbe9654ad64d9fe89f7",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 12948,
            "upload_time": "2023-11-17T19:40:36",
            "upload_time_iso_8601": "2023-11-17T19:40:36.748983Z",
            "url": "https://files.pythonhosted.org/packages/36/e7/1c81266578bb5593034cbdba697f8600631337a388f701db139c49e10148/OrangeLab-0.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9450046bc2b66d0f5ea763bfdc2da75e1042aedb67d905a3a74d618d387c0627",
                "md5": "fddf413f679154702a1b139f2ec3770a",
                "sha256": "4e7a3a7a8692bd425ef6ae513335782f424115fb9dbf1e706c76b896cb20c4c7"
            },
            "downloads": -1,
            "filename": "OrangeLab-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fddf413f679154702a1b139f2ec3770a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 10937,
            "upload_time": "2023-11-17T19:40:38",
            "upload_time_iso_8601": "2023-11-17T19:40:38.569931Z",
            "url": "https://files.pythonhosted.org/packages/94/50/046bc2b66d0f5ea763bfdc2da75e1042aedb67d905a3a74d618d387c0627/OrangeLab-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-17 19:40:38",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "orangelab"
}
        
Elapsed time: 0.18724s