Metadata-Version: 2.3
Name: IconMatch
Version: 0.0.2
Summary: Package for detecting Icons from images or screen
Project-URL: Homepage, https://github.com/NativeSensors/IconMatch
Project-URL: Issues, https://github.com/NativeSensors/IconMatch/Issues
Author-email: Piotr Walas <piotr.walas@eyegestures.com>
Maintainer-email: Piotr Walas <piotr.walas@eyegestures.com>
License: MIT License
        
        Copyright (c) 2020 Luis Zugasti
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.txt
Keywords: Icon,IconMatch,NativeSensors,scanning
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown

<h1 align="center">
	IconMatch
</h1>

<p align="center">
	<i>Easily select icons on the screen in any environment.</i>
</p>

<p align="center">
  <a href="">
    <img src="https://raw.githubusercontent.com/luiszugasti/IconMatch/main/images/screenshot.png" alt="Showcasing bounding boxes and original image"/>
  </a>
  <a href="">
    <img src="https://raw.githubusercontent.com/luiszugasti/IconMatch/main/images/nearest_box.gif" alt="Showcasing candidate boxes functionality"/>
  </a>
  <a href="">
    <img src="https://github.com/NativeSensors/IconMatch/assets/40773550/ebc5aa2e-50b3-464a-a033-7c54b7615eeb" alt="Showcasing realtime demo"/>
  </a>
</p>


This is part of the Hands Free Computing project. Built with [OpenCV 3.12](https://opencv.org) and [Python 3.8](https://python.org).

### 💜 Sponsors: 

```
Sponsor us and we can add your link, banner or other promo materials!
```
<!-- POLAR type=ads id=eizdelwu subscription_benefit_id=bb272b6d-f698-44e3-a417-36a6fa203bbe width=240 height=100 -->


<!-- POLAR-END id=eizdelwu -->

### 💜 Follow NativeSensors: 

<a href="https://polar.sh/NativeSensors"><picture><source media="(prefers-color-scheme: dark)" srcset="https://polar.sh/embed/subscribe.svg?org=NativeSensors&label=Subscribe&darkmode"><img alt="Subscribe on Polar" src="https://polar.sh/embed/subscribe.svg?org=NativeSensors&label=Subscribe"></picture></a>

## Table of Contents


  - [Installation](#installation)
  - [Usage](#usage)
  - [API](#api)
  - [Roadmap](#roadmap)
  - [Contributing](#contributing)
  - [License](#license)
  - [Contact](#contact)


## Installation 

1. Install from PyPI:
```
$ pip install iconmatch
```

## Usage

You can use the functions as shown in [demo.py](https://github.com/luiszugasti/IconMatch/blob/main/icondetection/demo/demo.py) as a default entry point.

In the below example, the main set of functions is called within a callback function, as this allows the threshold value
to be controlled from a GUI in OpenCV.

Image Scanner:

```python
import cv2 as cv

import IconMatch.IconMatch from ImageScanner

src = cv.imread("source to your image file")
scanner = ImageScanner(thersh = 100)

detected_rectangles = scanner.scan(src)
# list of [(x,y,w,h),(x,y,w,h), ... , (x,y,w,h)]

```

Screen Scanner:

```python
import IconMatch.IconMatch from ScreenScanner

scanner = ScreenScanner(thersh = 100)

detected_rectangles = scanner.scan(bbox = (x,y,w,h))
# list of [(x,y,w,h),(x,y,w,h), ... , (x,y,w,h)]

```

RealTime demo:
```bash
python rt_demo.py
```

## Key Features

- Detection of areas with a high likelihood of being clickable icons.
- Detection of closest rectangle to point of interest (be it gaze, or mouse as in the examples)

## API

The current available APIs encompass what your image processing pipeline should contain. Both APIs are 
currently still experimental as I learn more about OpenCV and optimize code.

### ImageScanner
> Performs Canny detection on passed images and group overlapping rectangles 

### ScreenScanner
> Scans your display, take screnshoots and call ImageScanners

## Roadmap

- [x] Detect regions of interest with moderate accuracy
- [x] Detect candidate region based on proximity
- [x] Detect icon-like objects on the screen
- [?] Context provision into regions of interest


## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **genuinely appreciated**.

1. Fork the Project
2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)
3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the Branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

Distributed under the MIT License. See `LICENSE` for more information.

## Contact

Original Creator: Luis Zugasti - [@luis\_\_zugasti](https://twitter.com/luis__zugasti)
Original Creator blog: [https://luiszugasti.me](https://luiszugasti.me)

Current Maintainer: Piotr Walas - [@Piotr\_\_Walas](https://twitter.com/PW4ltz)

Project Link: [https://github.com/NativeSensors/IconMatch](https://github.com/NativeSensors/IconMatch)
