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
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request