Metadata-Version: 2.1
Name: Hough-TMF
Version: 0.0.1
Summary: A package for template matching using Torch
Home-page: 
Author: Hao Lv
Author-email: lh21@apm.ac.cn
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# hd-tmf
A high-dimensional template matching framework based on PyTorch.

## Installation
```bash
pip install hd-tmf
```

## Usage
```python
import numpy as np
from hd_tmf import tmf
```

## Example
```python
# generate a random template
tmp = np.random.rand(10, 20, 20)
# generate a random image
data = np.random.rand(1000, 1000)
# calculate the cross-correlation between the template and the image
corr = tmf(tmp, data, step=1, device='cpu', moves=[], batch_size=-1, save_memory=False, max_workers=4)
```

## Parameters
- `tmp` (numpy.ndarray or torch.Tensor): The template to be matched.
- `data` (numpy.ndarray or torch.Tensor): The image to search for the template.
- `step` (int, optional): The step size of the convolution. Defaults to 1.
- `device` (str, optional): The device to perform the computation on. Defaults to 'cpu'.
- `moves` (list, optional): A list of moves to apply to the template before matching. Defaults to [].
- `batch_size` (int, optional): The batch size to use for the computation. Defaults to -1.
- `save_memory` (bool, optional): Whether to use half-precision floating point numbers to save memory. Defaults to False.
- `max_workers` (int, optional): The maximum number of worker threads to use for the computation. Defaults to 4.

## Returns
- `numpy.ndarray`: The cross-correlation between the template and the image.

## License

## Reference
