-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix lines identification + refactoring
- Loading branch information
Showing
6 changed files
with
245 additions
and
372 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
gs-cv/src/main/java/org/genericsystem/cv/application/HoughTrajectStep.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package org.genericsystem.cv.application; | ||
|
||
public class HoughTrajectStep implements Comparable<HoughTrajectStep> { | ||
final int y; | ||
final double derivative; | ||
final double magnitude; | ||
|
||
public HoughTrajectStep(int y, double derivative, double magnitude) { | ||
this.y = y; | ||
this.derivative = derivative; | ||
this.magnitude = magnitude; | ||
} | ||
|
||
@Override | ||
public int compareTo(HoughTrajectStep step) { | ||
return Double.compare(step.magnitude, magnitude); | ||
} | ||
|
||
public double getTheta() { | ||
return Math.atan(derivative) / Math.PI * 180 + 45; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.