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

Implement image hash modules #688

Merged
merged 143 commits into from
Jun 21, 2017
Merged

Conversation

stereomatchingkiss
Copy link
Contributor

@stereomatchingkiss stereomatchingkiss commented May 29, 2016

I intend to implement different image hashing algorithms and port the image hashing algorithms of PHash library to opencv. there are three algorithms already implemented by this pull request, they are "average hash", "phash" and "Marr-Hildreth Operator Based Hash".

Test case of average mean and phash are based on golden models(calculated by hand), test case of Marr-Hildreth Operator is based on the golden model compare with origin implementation(I make sure the steps of fillBlocks and createHash generate same value as PHash did).

In the future, I will port another algorithms from PHash library, like Radial Variance based Hash and block Mean Value Based Hash.

@mshabunin
Copy link
Contributor

@stereomatchingkiss , I've refactored interfaces and simplified the documentation. Please take a look: master...mshabunin:img_hash

If you like it you can pull this commit to your branch:

opencv_contrib> git checkout img_hash
opencv_contrib> git pull https://github.com/mshabunin/opencv_contrib img_hash

@stereomatchingkiss
Copy link
Contributor Author

stereomatchingkiss commented May 25, 2017 via email

@stereomatchingkiss
Copy link
Contributor Author

stereomatchingkiss commented Jun 4, 2017 via email

@mshabunin
Copy link
Contributor

@stereomatchingkiss , I've updated my branch.

@stereomatchingkiss
Copy link
Contributor Author

stereomatchingkiss commented Jun 12, 2017 via email

2 : use static cast to replace dynamic cast because class hierarchy of
img_hash is very straightforward
@stereomatchingkiss
Copy link
Contributor Author

stereomatchingkiss commented Jun 20, 2017

@mshabunin Thanks for your contribute, I merge the pull request and change something, please inform me if I break something.

ps : By the way, I think this branch is ready to merge into opencv_contrib.

Copy link
Contributor

@mshabunin mshabunin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stereomatchingkiss , looks good to me, thank you!

There is a compilation issue with scoped class declaration and I have one more comment related to the documentation.

class CV_EXPORTS_W ImgHashBase : public Algorithm
{
public:
class ImgHashImpl;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This declaration should be moved back to the top level, on line 15. Otherwise the compilation would be broken.

Copy link
Contributor Author

@stereomatchingkiss stereomatchingkiss Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the trouble, this problem is solved, I forgot to commit one file, that is why it cannot compiled


### Performance under different attacks

![Performance chart](https://3.bp.blogspot.com/-Li-zoGXC6-I/V3Wnp5tbFwI/AAAAAAAAA1Y/iVQkZmI6wWQcpxynuzW4FngJYVdXw3AtgCLcB/s1600/overall_result.JPG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add this image and two in the next section to the img_hash/doc folder.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, will upload it on tomorrow

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link should be changed to use local image:

![Performance chart](img_hash/doc/attack_performance.JPG)

### Speed comparison with PHash library (100 images from ukbench)

![Hash Computation chart](https://3.bp.blogspot.com/-XIs-olyuK9Q/V3NKRDRzUiI/AAAAAAAAAwU/k99xuDGlCBYwO3ZDZNHcLweuaAt_cpHtwCLcB/s1600/Capture.JPG)
![Hash comparison chart](https://1.bp.blogspot.com/-anqfh2Awky4/V3NOOKvrQKI/AAAAAAAAAwo/pZjGDDnAPKooOZCCVnzGO4lJjKo7-KjlACLcB/s1600/Capture.JPG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add these two images too.


### Performance under different attacks

![Performance chart](https://3.bp.blogspot.com/-Li-zoGXC6-I/V3Wnp5tbFwI/AAAAAAAAA1Y/iVQkZmI6wWQcpxynuzW4FngJYVdXw3AtgCLcB/s1600/overall_result.JPG)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link should be changed to use local image:

![Performance chart](img_hash/doc/attack_performance.JPG)

@mshabunin mshabunin self-assigned this Jun 21, 2017
@mshabunin
Copy link
Contributor

👍

@mshabunin mshabunin merged commit a4a8b84 into opencv:master Jun 21, 2017
allnes pushed a commit to allnes/opencv_contrib that referenced this pull request Jun 9, 2024
* remove ovms

* update README

* update root README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants