13

Here is the effect I am trying to achieve - Imagine a user submits an image, then a python script to cycle through each JPEG/PNG for a similar image in the current working directory.

Close to how Google image search works (when you submit your image and it returns similar ones). Should I use PIL or OpenCV?

Preferably using Python3.4 by the way, but Python 2.7 is fine.

Wilson

Dustin
  • 6,783
  • 4
  • 36
  • 53
WilsonKoder111
  • 282
  • 1
  • 4
  • 12

2 Answers2

1

I mean, why not use both? It's trivial to convert PIL images into OpenCV images and vice-versa, and both have niche functions that can make your life easier. Pair them up with sklearn and numpy, and you're cooking with gas.

v0rtex20k
  • 1,041
  • 10
  • 20
0

I created the undouble library in Python which seems a match for your issue.

It uses Hash functions to detect (near-)identical images in for example a directory. It works using a multi-step process of pre-processing the images (grayscaling, normalizing, and scaling), computing the image hash, and the grouping of images based on a threshold value.

erdogant
  • 1,544
  • 14
  • 23