Class: Wildfire::Converter::PageCutter

Inherits:
Core
  • Object
show all
Defined in:
lib/wildfire/converter/page_cutter.rb

Constant Summary

Constants inherited from Core

Core::RED

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pageObject (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_coordsObject



12
13
14
# File 'lib/wildfire/converter/page_cutter.rb', line 12

def small_coords
  @analizer.page_contour
end