npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-orbidx

v1.0.20

Published

Image Indexer Based on Pastec

Downloads

8

Readme

Node ORB Image Indexer

Introduction

This is a naive implementation of the Pastec ORB based image indexer, the words indexing class has been slightly remodelled, but it's pretty much the same logic and code as the implementation from Pastec GitHub Repository.

What this implementation is missing is the database/search part - this is because we believe that there are many other backends that can be used - and easily scaled, once the need hits you - without having to implement one from scratch.

Currently this code is more usable for research and experimenting purposes rather than real life usage in a production environment; don't say you have not been warned!

A bit of theory

The indexer will take the image you have given to it and create a list of Visual Words that describe that image. In this implementation this list of words is nothing more than a list of IDs of words as listed in a Dictionary of Visual Words. You can then use this list of words either for indexing your image in your favorite DB or to search the DB for a similar image.

The way the list of words is generated is by first extracting the features of the image that has been passed and then by looking in the dictionary for features that are similar to the ones we extracted from the image.

You have two options in terms of what dictionary to use:

  • Use the pre-trained visual words that comes with PASTEC;

  • Create your own dictionary by using our very simple trainer and feeding it your images to create the dictionary.

Our implementation of the trainer is (also) pretty naive - and may not scale well, especially in terms of performance, as your image dataset grows.

What the trainer does is extract features from each image and then add to the dictionary of visual words only those features that are not within a specific distance from existing words.

And now for some practical examples

"Code speaks louder than words!", Mark Twain, Circa 1972

Installing

Installing this node module requires that you have already installed OpenCV on your system; this has been tested with OpenCV version 2.4.x.

npm install node-orbidx

Initializing the indexer

const OrbIndexer = require('node-orbidx');

var orbIndexer = new OrbIndexer();

This piece of code will create an indexer with all the default settings; that means it will be using the same options for ORB features extraction as PASTEC and the same visual word dictionary.

What makes this a great tool for experimenting with ORB based visual search is that you can pass a set of options that will allow you to use any customized set of options for ORB features extraction and your very own visual words dictionary.

When using the original PASTEC words dictionary you may see better results by sticking to the PASTEC options for ORB features extraction.

Indexer options

See the API for a detailed description of the options that can be passed to the constructor of the indexer.

More Documentation

A simple example of usage

Create your own visual words dictionary

API Documentation