2

I have several thousand drawings of small parts and blueprints for which I need to be able to iterate through and search. The goal is be able to give the software an example image, then have the software search the thousands of images in a directory for anything similar, and return 20 or so matches.

I'm not looking for something which find exact image matches, but instead can find similarly shaped objects.

3 Answers 3

1

AllDup allows you to find similar images.

The documentation can be found over at https://www.alldup.de/alldup_help/search_similar_pictures.php

It is freeware.

0

Depending upon how enthusiastic you are at writing your own - you can use the image analysis features built into the Wolfram Language.

This is used in the Image Identification Project which aims to improve machine vision and learning, although that project won't help in your use case.

There is a StackExchange site dedicated to the use of Wolfram. They already have questions about using the image analysis features.

I repeat my initial comment - this isn't an off-the-shelf solution but it should be suitable for your needs.

0

You can use LEADTOOLS Imaging Pro SDK technology in your application. https://www.leadtools.com/sdk/products/imaging-pro

Imaging Pro SDK - $795 (Price for Developer Seat (08/2021))

You can leverage the CorrelationCommand class, which allows you to match an image containing a portion of the source image to the source image according to the measure of correlation.

DISCLOSURE: I am an employee of the company offering this toolkit.

Here is some sample code:

List<string> files = Directory.EnumerateFiles(@"DIRECTORY_CONTAINING_IMAGES_THAT_COULD_MATCH_TO_PART_OF_SOURCE_IMAGE").ToList();

using (RasterCodecs _codecs = new RasterCodecs())
using (RasterImage _srcImage = _codecs.Load(@"FILE_PATH_TO_MAIN_SOURCE_IMAGE"))
{
    foreach (string file in files)
    {
        using (RasterImage _dstImage = _codecs.Load(file))
        {
            CorrelationCommand command = new CorrelationCommand();
            // Set the CorrelationImage equal to the thousands of small image parts you are iterating through
            command.CorrelationImage = _dstImage;
            // The threshold indicates the measure of association required to consider the two images/areas to be correlated
            command.Threshold = 70;
            // Value that represents the step size in the X direction (along image width), in pixels. For best results, use 1
            command.XStep = 1;
            // Value that represents the step size in the Y direction (along image height), in pixels. For best results, use 1
            command.YStep = 1;
            command.Points = new LeadPoint[90];
            // Pass in the example source image
            command.Run(_srcImage);

            // If correlation is found export image to matched images directory
            if (command.NumberOfPoints > 0)
            {
                string _fileName = Path.GetFileNameWithoutExtension(file);
                string _outDir = @"DIRECTORY_TO_SAVE_MATCHED_IMAGES";
                if (!Directory.Exists(_outDir))
                    Directory.CreateDirectory(_outDir);
                string _outFile = Path.Combine(_outDir, $"{_fileName}.tif");

                _codecs.Save(_dstImage, _outFile, RasterImageFormat.Tif, _dstImage.BitsPerPixel);
            }
        }
    }
}

You can also take the correlation LeadPoint and create a LeadRect, which can be used to draw a bounding rectangle on the source image showcasing where the correlation image(s) is located (See the below screenshot). enter image description here

Also, note that we have a C# .NET tutorial that uses various LEADTOOLS image processing commands to compare two images to determine how similar they are (See in link below). https://www.leadtools.com/help/sdk/v21/tutorials/dotnet-console-compare-image-data-for-similarities.html

5
  • Hi Kip! Please make sure you have read softwarerecs.meta.stackexchange.com/questions/2933/… Thanks! Commented Aug 17, 2021 at 0:36
  • Hello RockPaperLz, thank you. I read through this page. I believe my answer on this post is appropriate and that the tools recommended here meet the requirements of the question. If you believe otherwise, please let me know and I will take down this answer. Commented Aug 19, 2021 at 14:50
  • I agree. Overall I find most (perhaps all... I just haven't read them all recently) of the posts from the good people at LEADTOOLS to be very high quality. The only issue is that I think (IIRC) all the posts from LEADTOOLS employees are only recommending LEADTOOLS. Our community frowns rather strongly on this because the idea is to not just use this community to promote products from one specific company. So perhaps you and others at LEADTOOLS can take a look at more questions posted by our community members and recommend other (non-LEADTOOLS) products you find helpful. Commented Aug 20, 2021 at 4:19
  • Another recommendation is to be sure to include the current price of any non-gratis products you recommend (and, of course, only recommend for-profit products when the OP hasn't selected the gratis tag). Since prices do sometimes change, you include the current date next to the price to avoid any confusion. Commented Aug 20, 2021 at 4:20
  • Thank you for the response and advice. I have updated my answer to include the current price and will continue to do so on my non-gratis recommendations from now on. I will also attempt to contribute on other questions as well. Commented Aug 23, 2021 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.