Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: updated package functions usage in README.md #20

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 49 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,57 @@ $ pip install sharpedge

## Usage

- TODO
To harness the image processing magic of SharpEdge, follow these steps:

1. Import the required functions from the package:

```python
from sharpedge.frame_image import frame_image
from sharpedge.modulate_image import modulate_image
from sharpedge.pca_compression import pca_compression
from sharpedge.pooling_image import pooling_image
from sharpedge.seam_carving import seam_carve
```

2. Load your image as a NumPy array.
3. Process your images using the available functions:
- Add a decorative frame around the image with customizable color:

```python
# Add a frame around your image
framed_img = frame_image(img, h_border=30, w_border=30, inside=True, color=255)
```

- Convert or manipulate image color channels:

```python
# Convert an RGB image to grayscale
grayscale_image = modulate_image(rgb_image, mode='gray')
```

- Compress the input image using Principal Component Analysis (PCA):

```python
# Compress a grayscale image by retaining 80% of the variance
compressed_img = pca_compression(grayscale_img, preservation_rate=0.8)
```

- Perform pooling on an image using a specified window size and pooling function:

```python
# Perform pooling on an image with mean pooling function
pooled_img = pooling_image(img, window_size=10, func=np.mean)
```

- Resize the image using seam carving to the target dimensions:

```python
# Seam carve an image to resize it to the target dimensions
resized_img = seam_carve(img, target_height=300, target_width=400)
```

## Contributors

Archer Liu, Inder Khera, Hankun Xiao, Jenny Zhang (ordered alphabetically)

## Contributing
Expand Down
Loading