Git Product home page Git Product logo

imagesearch's Introduction

##imageSearch

Python image search for brain images

Adapted from pyimagesearch. See "example.py" for how to run the script. Credits go to @jrosebr1

1)

We first generate a "mask" from which we will extract features. Each square in the grid will have a complete color histogram extracted, and empty squares will not be used. For example, here are the areas for a grid of size 20:

grid.gif

This spatial mask could be anything that is desired for the image. For brain images, we could (possibly) improve our method by using regional masks.

2)

We generate a database of such histrogram features for all of the images in the "img" folder. A reasonable grid size of 60 will generate 6048 features.

  mask="/home/vanessa/Documents/Dropbox/Code/Python/imageSearch/img/empty.png"
  dataset="img/"

  python index.py --dataset $dataset --mask $mask --index index.csv --gridsize 60

3)

We the take a query image (one of the images from the set) and run a search:

  python search.py --index index.csv --mask $mask --query "img/0755.png" --result-path $dataset --gridsize 60

  Similar image 0 is 0755.png, score: 5.01683098279e-12
  Similar image 1 is 0758.png, score: 0.753928549838
  Similar image 2 is 0735.png, score: 1.49185219648
  Similar image 3 is 0575.png, score: 1.57747888024
  Similar image 4 is 2531.png, score: 1.58183379819
  Similar image 5 is 2577.png, score: 1.65715516378
  Similar image 6 is 1102.png, score: 1.69818982149
  Similar image 7 is 0573.png, score: 1.82857227454
  Similar image 8 is 1100.png, score: 1.83202124991
  Similar image 9 is 0090.png, score: 1.86576392466
Query image

1

Top 5 Most Similar

1 2 3 4 5

A score of (essentially) zero == the same image, and increasing from that == less similar. This could be streamlined for feature extraction and easily integrated into a python module with a better visualization output, django, etc. Compared to an image search using the actual brain map, we have 2 overlapping results (images 758 and 735) in the top 10. It's not great, but it's impressive given that 1) we are using such a drasticly reduced image, 2) our features are also pretty rough, and 3) there are now over 6000 images in the actual NeuroVault database Very cool! :O)

imagesearch's People

Contributors

vsoch avatar

Watchers

James Cloos avatar  avatar  avatar

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.