ameingast / cocoaimagehashing Goto Github PK
View Code? Open in Web Editor NEWPerceptual Image Hashing for macOS, iOS, tvOS and watchOS
License: Other
Perceptual Image Hashing for macOS, iOS, tvOS and watchOS
License: Other
We're using this library as part of our own and we have to integrate it in the podspec:
s.dependency 'CocoaImageHashing', '1.9.0'
but there are only 1.7.0 in the Cocoapods repo available.
Please, push the latest build to the Cocoapods repo.
Really appreciative of your efforts, thank you!
The Python ImageHash library outputs pHash values like: bfbcf072c260d0c3
How does one get a similar value from this API? Or: How should I convert that sort of pHash value to this library’s format?
If possible, I'm trying to:
Possible? Thanks again
Has anyone had a problem with Cocoapods 1.5 when using
#import <CocoaImageHashing/CocoaImageHashing.h>
getting a file not found when building? I tried all the usual tricks of cleaning, deleting derived data, updating, reinstalling the pod - to no avail.
UPDATE: This comment on a a closed issue solved my problem - even though I'm using Objective-C. I'm also using Cocoapods 1.5 and XCode 9.3. Perhaps a new issue that has creeped in to Cocoapod installation?
Great looking library - I think it would solve a problem I have very well.
I'm trying to use it from Swift and I can't get it to link. (I normally program in another language so I don't know what I'm doing here.) I followed the instructions to install CocoaPods and add this library. I also added CocoaImageHashing to the Linked Frameworks and Libraries.
When I attempt to run the default Hello World swift I get
dyld: Library not loaded: @rpath/CocoaImageHashing.framework/Versions/A/CocoaImageHashing
Referenced from: /Users/sarge/Library/Developer/Xcode/DerivedData/PHashTest-cdongczzcrynrfclysczwalanrlq/Build/Products/Debug/PHashTest
Reason: image not found
(lldb)
If I remove the use_frameworks! from the Podfile I get
Framework not found CocoaImageHashing
My Podfile
platform :osx, '10.12'
target 'PHashTest' do
use_frameworks!
pod 'CocoaImageHashing', :git => 'https://github.com/ameingast/cocoaimagehashing.git'```
end
Many thanks for any help or documentation updates you might provide.
This library is super useful!
Was wondering if there are any plans to support SwiftPM ?
Hi,
I was testing out this pod but i realize that it gives different phash for the same image if we are using original phash on OSX and then using this pod on the iOS.
Using the arquitecture1.bmp:
original phash:
"101000000110001100011000111100100011100111011110100110101110110"
Pod Phash:
"110001000001000101100100111100000011010100110101110100000000000"
Giving a distance of 29.
The implementation of + [NSBitmapImageRep(CocoaImageHashing) imageRepFrom:scaledToWidth:scaledToHeight:usingInterpolation:]
calls - [NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:]
passing 0 to bytesPerRow
. From NSBitmapImageRep
's documentation:
If you pass in a rowBytes value of 0, the bitmap data allocated may be padded to fall on long word or larger boundaries for performance.
The 36 bytes scan line of a 9 x 9 image does not fall on these boundaries, so it is zero-padded to apparently 64 bytes. The dHash implementation, however, assumes data to be contiguous. In consequence, out of 324 bytes or 81 pixels of image data, only the first 176 bytes or 44 pixels are currently really used to calculate the hash.
Possible fixes:
bytesPerRow
, i. e. width * 4
(same approach as in the iOS version, but possibly also aligning image data less optimally).bytesPerRow
to 64 bytes and skip the padding in the hash calculation.Implementations for 2 and 3 are here and here.
Is there any experience regarding dHash accuracy on 8 x 8 images vs. 9 x 8/9?
If I have a png w/ an alpha channel (eg: periphery pixels would like to ignore)
for DCT phash, is it better to leave alpha, convert to white, or convert to black?
(for example, a bunch of "circular" imagery, where are trying to "best match")
Or, due to DCT transform, does it not matter because there are contiguous groups of pixels the same?
thanks for this awesome code, BTW!
I'm evolving an AR iOS app to match camera image to pre-photographed clay statues and send the user the best match.
In testing, pHash DCT is beating dHash and more brute force/simpler MAE, MSE and RMSE comparisons, too :)
I want to use Concurrent, stream-based similarity search for finding similar images from all images in the phone gallery but I cannot understand how to do that. I have tried to use an array-based method but that takes too long to get all the image data in an array and causes memory management issues.
If anyone knows this please help me.
I am having trouble in understanding Obj c code. If you can make this code available in swift it'll be so helpful.
i am using "[[OSImageHashing sharedInstance] similarImagesWithHashingQuality:" to find similar images in photo library but it work only for copies of images. If images slightly different it will never find them. Maybe you can help how to setup accuracy?
I am requesting 100x100 imgage from PHImageManager, convert it to Data by "pngData" and apply "medium quality" from OSImageHashing
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.