Project

rubix-api

0.0
No commit activity in last 3 years
No release in over 3 years
Wrapper for Rubix Api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

>= 0
 Project Readme

Rubix::Api

Ruby wrapper for Rubix api.

Installation

Add this line to your application's Gemfile:

gem 'rubix-api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install rubix-api

Usage

First you need to require the gem and you initialize the client by instantiating the Rubix class. To do this you need your access token and you can optionally specify api version and domain.

require 'rubix-api'

client = Rubix.new(access_token, version, domain) # Version and domain are optional

To list categories. client.list_categories

To list patterns you need to pass page_number as the only parameter.

client.list_patterns(2) #where "2" means the page number

To delete patterns you need to pass the pattern_id as the only parameter.

client.delete_pattern(100) #where "100" means the pattern_id

To add a matching pattern you need to pass the file itself or an file url for it, a label, and the category name to which the pattern belongs.

client.add_pattern({file: FIle, remote_file_url: "http://example.com/path/to/scene", label: 'uid', category_name: 'matching'})

To use feature matching, a file or file url is needed, as well as a minimum ratio and a minimum matches amount.

client.feature_matching({file, remote_file_url, mr: 0.9, mma: 150}) 

For OCR, Rubix needs the path to image or the file itself, and optionally, the area to be scanned.

client.ocr({file, remote_file_url, rectangles: [[x1,y1.x2,y2],..,[x1,y1,x2,y2]]}

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request