-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
Conversation
2 : add overload functions
2 : forgot to include iostream
1 : Fix wrong branch 2 : Add another solution to download img_hash
@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 |
Thanks for your contribution :), please give me some times to study your
codes.
2017-05-25 16:21 GMT+08:00 Maksim Shabunin <notifications@github.com>:
… @stereomatchingkiss <https://github.com/stereomatchingkiss> , I've
refactored interfaces and simplified the documentation. Please take a look:
master...mshabunin:img_hash
<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
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#688 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABt-up--UrRicwNyaBQycorjCIc8YySKks5r9TnvgaJpZM4IpP2u>
.
|
Sorry for my late reply, I study your codes and I have one request
Instead of using void* to implement pimpl, could you instead use type safe
solution to it?
I think this is safer and also easier to understand, I do not find much
benefits to implement pimpl
by void*.
class something
{
private:
struct pimpl;
cv::Ptr<pimpl> impl_; //I like unique_ptr better, but opencv still
using c++98
};
C++ pimpl avoiding void*
<https://stackoverflow.com/questions/35307934/c-pimpl-avoiding-void>
2017-05-26 7:57 GMT+08:00 ngap wei Tham <thamngapwei@gmail.com>:
… Thanks for your contribution :), please give me some times to study your
codes.
2017-05-25 16:21 GMT+08:00 Maksim Shabunin ***@***.***>:
> @stereomatchingkiss <https://github.com/stereomatchingkiss> , I've
> refactored interfaces and simplified the documentation. Please take a look:
> master...mshabunin:img_hash
> <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
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#688 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ABt-up--UrRicwNyaBQycorjCIc8YySKks5r9TnvgaJpZM4IpP2u>
> .
>
|
@stereomatchingkiss , I've updated my branch. |
Sorry for my late reply and thanks for your contribution :), I will try to
finish codes review on this weekend.
2017-06-05 17:46 GMT+08:00 Maksim Shabunin <notifications@github.com>:
… @stereomatchingkiss <https://github.com/stereomatchingkiss> , I've
updated my branch.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#688 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABt-ulH6OPCjkZ3BicH7IBNqKX06NMPuks5sA85wgaJpZM4IpP2u>
.
|
2 : use static cast to replace dynamic cast because class hierarchy of img_hash is very straightforward
@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. |
… this increase chance of breaking ABI
There was a problem hiding this 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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)
… this increase chance of breaking ABI
…ber. pimpl only accessable by the class itself, therefore I think declare everything as public is quite safe
### 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) |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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)
👍 |
* remove ovms * update README * update root README
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.