Class: Wildfire::Converter::PageCutter
- Defined in:
- lib/wildfire/converter/page_cutter.rb
Constant Summary
Constants inherited from Core
Instance Attribute Summary collapse
-
#page ⇒ Object
readonly
Returns the value of attribute page.
Instance Method Summary collapse
- #cut_page(coords) ⇒ Object
-
#initialize(big_cvmat) ⇒ PageCutter
constructor
A new instance of PageCutter.
- #small_coords ⇒ Object
Methods inherited from Core
#generate_path, #quick_save, #save, #temp_mat
Constructor Details
#initialize(big_cvmat) ⇒ PageCutter
Returns a new instance of PageCutter.
6 7 8 9 10 |
# File 'lib/wildfire/converter/page_cutter.rb', line 6 def initialize(big_cvmat) @big_cvmat = big_cvmat @analizer = Analizer.new(@big_cvmat) @resizer = Resizer.new(@big_cvmat) end |
Instance Attribute Details
#page ⇒ Object (readonly)
Returns the value of attribute page.
4 5 6 |
# File 'lib/wildfire/converter/page_cutter.rb', line 4 def page @page end |
Instance Method Details
#cut_page(coords) ⇒ Object
16 17 18 19 |
# File 'lib/wildfire/converter/page_cutter.rb', line 16 def cut_page(coords) @page = Transformer.four_point_transform(@big_cvmat, @resizer.to_big_coords(coords)) end |
#small_coords ⇒ Object
12 13 14 |
# File 'lib/wildfire/converter/page_cutter.rb', line 12 def small_coords @analizer.page_contour end |