-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
430 additions
and
345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Pytest | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: 3.9 | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install numpy scipy pywavelets fpdf pillow simplejpeg scikit-image tifffile | ||
pip install pytest | ||
- name: Run tests | ||
run: | | ||
pytest tests/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.pyc | ||
**/__pycache__/*.pyc | ||
tests/results/* |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file removed
BIN
-4.12 MB
_test_with_sample_image/test results/Ambadekar2019/Ambadekar2019.w=0.015625.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-3.73 MB
_test_with_sample_image/test results/Ambadekar2019/Ambadekar2019.w=0.015625.pdf
Binary file not shown.
Binary file removed
BIN
-4.27 MB
_test_with_sample_image/test results/Chandra2002/Chandra2002.w=0.0625.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-3.98 MB
_test_with_sample_image/test results/Chandra2002/Chandra2002.w=0.0625.pdf
Binary file not shown.
Binary file removed
BIN
-2.36 MB
_test_with_sample_image/test results/Chang2005/Chang2005.w=0.012.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-2.35 MB
_test_with_sample_image/test results/Chang2005/Chang2005.w=0.012.pdf
Binary file not shown.
Binary file removed
BIN
-3.7 MB
_test_with_sample_image/test results/Ganic2004/Ganic2004.w=0.05.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-3.74 MB
_test_with_sample_image/test results/Ganic2004/Ganic2004.w=0.05.pdf
Binary file not shown.
Binary file removed
BIN
-2.39 MB
_test_with_sample_image/test results/Guo2014/Guo2014.w=0.01.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-3.18 MB
_test_with_sample_image/test results/Gupta2012/Gupta2012.w=0.02.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-2.79 MB
_test_with_sample_image/test results/Gupta2012/Gupta2012.w=0.02.pdf
Binary file not shown.
Binary file removed
BIN
-4.46 MB
_test_with_sample_image/test results/Jain2008/Jain2008.w=0.02.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.95 MB
_test_with_sample_image/test results/Jane2014/Jane2014.w=0.05.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.95 MB
_test_with_sample_image/test results/Lai2010/Lai2010.w=0.01.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.78 MB
_test_with_sample_image/test results/Liu2019/Liu2019.w=0.0625.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.46 MB
_test_with_sample_image/test results/Mohammad2008/Mohammad2008.w=0.02.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-4.44 MB
_test_with_sample_image/test results/Mohammad2008/Mohammad2008.w=0.02.pdf
Binary file not shown.
Binary file removed
BIN
-2.78 MB
_test_with_sample_image/test results/Niu2016/Niu2016.w=0.0625.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-4.07 MB
_test_with_sample_image/test results/Run2012/Run2012.w=0.05.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.37 MB
_test_with_sample_image/test results/Sun2002/Sun2002.w=0.0625.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.47 MB
_test_with_sample_image/test results/Xing2007/Xing2007.w=0.0625.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.3 MB
_test_with_sample_image/test results/Yavuz2006/Yavuz2006.w=0.0625.k=5.pdf
Binary file not shown.
Binary file removed
BIN
-2.3 MB
_test_with_sample_image/test results/Yavuz2006/Yavuz2006.w=0.0625.pdf
Binary file not shown.
Binary file removed
BIN
-2.36 MB
_test_with_sample_image/test results/Yavuz2007/Yavuz2007.w=0.1.k=5.pdf
Binary file not shown.
Binary file not shown.
Binary file removed
BIN
-2.31 MB
_test_with_sample_image/test results/Zhu2022/Zhu2022.w=0.0625.k=5.pdf
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,6 @@ | ||
## Welcome to GitHub Pages | ||
[![DOI](https://zenodo.org/badge/444999271.svg)](https://zenodo.org/badge/latestdoi/444999271) | ||
|
||
You can use the [editor on GitHub](https://github.com/naaci/Digital-Image-Watermarking/edit/PhD/docs/index.md) to maintain and preview the content for your website in Markdown files. | ||
# watermarking | ||
Implementations of some digital image watermarking schemes for grayscale images proposed by various authors. | ||
|
||
Whenever you commit to this repository, GitHub Pages will run [Jekyll](https://jekyllrb.com/) to rebuild the pages in your site, from the content in your Markdown files. | ||
|
||
### Markdown | ||
|
||
Markdown is a lightweight and easy-to-use syntax for styling your writing. It includes conventions for | ||
|
||
```markdown | ||
Syntax highlighted code block | ||
|
||
# Header 1 | ||
## Header 2 | ||
### Header 3 | ||
|
||
- Bulleted | ||
- List | ||
|
||
1. Numbered | ||
2. List | ||
|
||
**Bold** and _Italic_ and `Code` text | ||
|
||
[Link](url) and ![Image](src) | ||
``` | ||
|
||
For more details see [Basic writing and formatting syntax](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax). | ||
|
||
### Jekyll Themes | ||
|
||
Your Pages site will use the layout and styles from the Jekyll theme you have selected in your [repository settings](https://github.com/naaci/Digital-Image-Watermarking/settings/pages). The name of this theme is saved in the Jekyll `_config.yml` configuration file. | ||
|
||
### Support or Contact | ||
|
||
Having trouble with Pages? Check out our [documentation](https://docs.github.com/categories/github-pages-basics/) or [contact support](https://support.github.com/contact) and we’ll help you sort it out. | ||
Each module defines a class named `watermarking` with two methods namely `add_watermark` and `extract_watermark`. Some modules `watermarking` class has additional method `extract_watermarks`. |
Empty file.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import sys | ||
from importlib import import_module | ||
from pathlib import Path | ||
|
||
from numpy import asarray, isclose, random | ||
|
||
cwd = Path(__file__).parent.parent / "watermarking" | ||
sys.path.append(str(cwd)) | ||
|
||
|
||
def _test_watermark(watermarker): | ||
if hasattr(watermarker, "SQUARE_IMAGE_ONLY"): | ||
host = random.random((64, 64)) | ||
else: | ||
host = random.random((64, 512)) | ||
|
||
watermark = random.random( | ||
asarray(host.shape) // watermarker.IMAGE_TO_WATERMARK_RATIO | ||
) | ||
|
||
if hasattr(watermarker, "BINARY_WATERMARK"): | ||
watermark[watermark >= 0.5] = 1 | ||
watermark[watermark < 0.5] = 0 | ||
|
||
watermarked = watermarker.add_watermark(host, watermark) | ||
watermark_ = watermarker.extract_watermark(watermarked) | ||
assert isclose(watermark, watermark_).all(), watermarker.__module__ | ||
|
||
# c = isclose(watermark, watermark_) | ||
# print("Watermarking Test result:") | ||
# print("method:".ljust(10), Watermarker.__module__) | ||
# print("max err:".ljust(10), abs(watermark - watermark_).max()) | ||
# print("isclose:".ljust(10), f"{watermark[c].size / watermark.size:>.2%}") | ||
|
||
|
||
def test_watermarks(): | ||
for module in cwd.iterdir(): | ||
if ( | ||
module.name.startswith(".") | ||
or module.name.startswith("_") | ||
or module.is_dir() | ||
or not module.name.endswith(".py") | ||
): | ||
continue | ||
module = module.name.removesuffix(".py") | ||
print(module) | ||
|
||
watermarker = import_module(module).Watermarker(0.01) | ||
_test_watermark(watermarker) | ||
|
||
|
||
if __name__ == "__main__": | ||
test_watermarks() |
Oops, something went wrong.