Uses computer vision to cut objects from images.
Something like this.
Installation
Add this line to your application's Gemfile:
gem 'wildfire'
And then execute:
$ bundle
Or install it yourself as:
$ gem install wildfire
Usage
Use it from command line:
bin/wildfire a4 spec/support/printed-iphones-on-a4.jpg
# => The page was cut and placed at spec/support/big_page.jpg
bin/wildfire printed_screens spec/support/printed-iphones-on-a4.jpg
# => The screens were cut and placed at spec/support/screen_0.jpg,
# spec/support/screen_1.jpg, spec/support/screen_2.jpg, spec/support/screen_3.jpg
Use it from Ruby code:
manager = Wildfire::Manager.new(image_path)
manager.predicted_page_coords
# => [[0,0], [0, 50], [50, 0], [50, 50]]
manager.cut_page!(manager.predicted_page_coords)
# => cut_page_path.jpg
Wildfire::ScreenCutter.new('cut_page_path.jpg').paths
# => ['screen_1.jpg', 'screen_2.jpg', ...]
Contributing
- Fork it ( https://github.com/[my-github-username]/wildfire/fork )
- 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 a new Pull Request