2

Here, I want to search am image from MySQL by upload an image. I have tried with hash and rgb and also with hex. But I am not getting the perfect picutres as google. For e.g. If you find Koala.jpg, then you can see only those photos related to Koala.jpg. But I am getting other photos too with above try. Is there any suggestions that I can search image from the database by image upload. Thanks in advance.

Virb
  • 1,639
  • 1
  • 16
  • 25
  • Take a look at perceptual hashing algorithms. You can use [this](https://github.com/jenssegers/imagehash) PHP package for example. – wazelin Sep 12 '16 at 07:46
  • Yeah I saw. But what will be the criteria to match the database images and selected image that will give me the similar images. I have made a demo but it only gives image which I have selected to search. Thanks. – Virb Sep 12 '16 at 08:35
  • **Downvoters please give reason for downvote.** – Virb Sep 14 '16 at 08:38
  • Downvoters are not obliged to give reasons –  Sep 14 '16 at 10:21
  • @Tropiks: Instead giving this type of comment, should give the proper answer if you know. – Virb Sep 14 '16 at 10:26
  • 3
    I do know, but I am waiting for a properly written question –  Sep 14 '16 at 10:27
  • If you already know what question is telling or if you already understood, then I don't think that this question is improper. – Virb Sep 14 '16 at 10:34
  • Finding similar images based on their content is a major, hugely complex undertaking. Voting to close this as too broad - but it's also super unclear, I find it impossible to parse anything from it other than "how to do image search in PHP". Maybe it's worth trying to be more specific about what kind of functionality you are looking for. – Pekka Sep 14 '16 at 10:55
  • It's good to hear from @Pekka웃. – Virb Sep 14 '16 at 11:12
  • 3
    I see people telling @Virb that they can't understand his question, but the question is fairly simple. He wants the same functionality as google image search but for his own website/database. Unless the images are public and crawl-able by Google this is terribly hard to do and a lot of work as well. I suggest you try to find how Google does this. [info](https://www.quora.com/How-does-google-image-search-engine-work) – JordyvD Sep 14 '16 at 13:42
  • @g3mini : You exactly understood what my question is. Thanks for your positive answer. – Virb Sep 15 '16 at 04:58

1 Answers1

6

Introduction

As I understand your question, how can I search for similar image while I am uploading the image?

Before I dig more in details, I would roughly give a little introduction to the topic.

To be able to search or analysis images in computer, we need to go through some processes and convert the image to a numbers representation. This make it possible to do almost every thing.

There are different similarity search Algorithms, and it is a very heat topic a lot researchers working to improve the techniques and developing better ways.

Depending on your requirement, there are a lot of things involved in it, like how big file is, how fast you expecting the results, is it while the person is upload, how many images should be processed at the time etc.

Google has a lot powerful servers and a lot of machine learning that makes it very smooth to compare images almost with no delays.

IMO you need gather some theoretical information that will help you a lot understanding the process around it.

Some links with information regarding my explanation:

I am pretty sure with a bit more google search you can find a lot of theoretical resources.

Now back to your question,

The following lib/class IMO will solve your problem.

I will leave some link that might enlighten you as well, that said you have few steps to reach your goal:

  1. Start test one of these libraries and see which one fits you best
  2. Then try to test by uploading and comparing image

Few more links:

Community
  • 1
  • 1
Maytham Fahmi
  • 31,138
  • 14
  • 118
  • 137
  • Thanks for your answer. I will deeply see of your given links. As far as I researched, may be it will work with texture, shape and colors. As I mentioned in question, I have implemented with `rgb`, `hex` and `hash` functionality. But the thing is I am searching similar images from the database that I have to be more specific and perfection about the code. By the way, thanks for your co-operation that will really help me in my project. – Virb Sep 15 '16 at 04:54
  • @Virb you are welcome, it is important to say that you have 2 ways to go, using existing lib/class or develop and code an algorithm unique to your requirement. the latter would a project for its own. another solution could be that you use library like opencv, it is available for python, java and c#, then you need to have a web server that support one of those languages, – Maytham Fahmi Sep 15 '16 at 07:30
  • opencv is a powerful tool for image processing, and it can help you reaching such goal with much better performance see this for inspiration http://stackoverflow.com/questions/11541154/checking-images-for-similarity-with-opencv and http://stackoverflow.com/questions/4196453/simple-and-fast-method-to-compare-images-for-similarity and much more to be found online. it also need the understanding of image analysis – Maytham Fahmi Sep 15 '16 at 07:30
  • 1
    Thanks dud..I really appreciate with these texts and this is because I can hope for the solutions. – Virb Sep 15 '16 at 08:36