GithubHelp home page GithubHelp logo

Comments (4)

LambertWM avatar LambertWM commented on June 17, 2024

Not sure what you mean, the interface uses an image that is "in memory", so it is completely up to you to decide where the image originates from.

namespace CoenM.ImageHash
{
    public interface IImageHash
    {
        ulong Hash(Image<Rgba32> image);
    }
}

from imagehash.

developervariety avatar developervariety commented on June 17, 2024

I believe they want to create a hash out of a Bitmap so they can save it in a database perhaps. This removes the need to save all images that you already know are "good", just need to find similar ones.

I am in need of this too, but I will keep looking.

from imagehash.

developervariety avatar developervariety commented on June 17, 2024

It just slapped me in the face, you save the ulong from the "good" images in a database for later use.

@leonpotgieter I hope this solves your issue.

from imagehash.

coenm avatar coenm commented on June 17, 2024

You can take a look at this test code from ImageSharp where a Bitmap is converted to an Image<Rgba32> inmemory.

After obtaining such Image<Rgb32> you can call the Hash(Image<Rgb32> image) method as @LambertWM described.

You can also try to save the Bitmap to a MemoryStream and use the following extension method.

        public static ulong Hash(this IImageHash hashImplementation, Stream stream)
        {
            if (hashImplementation == null)
                throw new ArgumentNullException(nameof(hashImplementation));
            if (stream == null)
                throw new ArgumentNullException(nameof(stream));

            using (var image = Image.Load<Rgba32>(stream))
                return hashImplementation.Hash(image);
        }

from imagehash.

Related Issues (12)

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.