Coder Social home page Coder Social logo

cocoaimagehashing's People

Contributors

ameingast avatar chrisdanford avatar plumbojumbo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cocoaimagehashing's Issues

Different phash same image

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.

[Question] Cross-library capable?

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:

  1. Use the iPhone camera to ingest image data
  2. Calculate a pHash value (using this library)
  3. Calculate distance between the pHash value from #2 and the pHash value computed by ImageHash, provided separately.

Possible? Thanks again

Can this library be used from Swift on macOS?

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.

Cocoapods version is outdated

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.

dHash underflow on OS X

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:

  1. Pass the exact width of the scan line to bytesPerRow, i. e. width * 4 (same approach as in the iOS version, but possibly also aligning image data less optimally).
  2. Align bytesPerRow to 64 bytes and skip the padding in the hash calculation.
  3. Instead of 9 x 9, use a 8 x 8 image for the hash calculation, wrapping each row's last comparison.

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?

alpha channel

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 :)

Get similar images

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

Cocoapods 1.5 and CocoaImageHashing.h not found

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.