Class: Sqed::BoundaryFinder::CrossFinder

Inherits:
Sqed::BoundaryFinder show all
Defined in:
lib/sqed/boundary_finder/cross_finder.rb

Overview

Return four equal quadrants, no parsing through the image

Constant Summary

Constants inherited from Sqed::BoundaryFinder

COLOR_DELTA, THUMB_SIZE

Instance Attribute Summary

Attributes inherited from Sqed::BoundaryFinder

#boundaries, #image, #layout, #original_image, #use_thumbnail

Instance Method Summary collapse

Methods inherited from Sqed::BoundaryFinder

color_boundary_finder, derivative, derivative_signs, frequency_stats, get_subdivision_size, #height_factor, is_black?, is_blue?, is_green?, is_red?, #longest_thumbnail_axis, max_difference, max_pairwise_difference, sample_border, #thumbnail, #thumbnail_height, #thumbnail_width, #width_factor, #zoom_boundaries

Constructor Details

#initialize(**opts) ⇒ CrossFinder

Returns a new instance of CrossFinder.



7
8
9
10
# File 'lib/sqed/boundary_finder/cross_finder.rb', line 7

def initialize(**opts)
  @image = opts[:image]
  find_edges
end

Instance Method Details

#find_edgesObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/sqed/boundary_finder/cross_finder.rb', line 12

def find_edges
  width = image.columns / 2
  height = image.rows / 2

  boundaries.coordinates[0] = [0, 0, width, height] 
  boundaries.coordinates[1] = [width, 0, width, height] 
  boundaries.coordinates[2] = [width, height, width, height] 
  boundaries.coordinates[3] = [0, height, width, height] 
  boundaries.complete = true
end