kolhizin / bujo

Proof of concepts and sharedlib for bujo app
0 stars 0 forks source link

Detect local-orientation (radon-transform) #19

Closed kolhizin closed 5 years ago

kolhizin commented 5 years ago

Create map of local angle for skewed line detection as best possible direction.

Algorithm:

  1. Setup angles and unit vectors
  2. Create 3d tensor (angle, h, w) with value of projection
  3. For each of grid points do the following
  4. Select local subgrid and subtract value of local grid center
  5. Round values
  6. Collect into array (angle, value) with count of occurance of specified value
  7. (optional) convert to common value-range and augment with zeros
  8. For each angle calculate std dev
  9. Select angle with maximal std dev. As confidence score take its std dev to median std dev

DoD:

kolhizin commented 5 years ago

Stable results, quite fast -- around 1-2 seconds