Skip to content

Commit

Permalink
improve brush tool
Browse files Browse the repository at this point in the history
  • Loading branch information
carlosuc3m committed Sep 7, 2024
1 parent 0a52666 commit 3d12691
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/main/java/ai/nets/samj/ij/ui/IJ1PromptsProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,26 @@ public void mouseReleased(MouseEvent e) {
java.awt.Point p = it.next();
collectedPoints.add(new Point(p.x,p.y));
}
// TODO move this logic to SAMJ into the masks option
if (collectedPoints.size() > 1 && collectedPoints.size() < 6)
collectedPoints = Arrays.asList(new Localizable[] {collectedPoints.get(1)});
else if (collectedPoints.size() > 1 && collectedPoints.size() < 50) {
List<Localizable> newCollectedPoints = new ArrayList<Localizable>();
while (newCollectedPoints.size() == 0) {
for (Localizable pp : collectedPoints) {
if (Math.random() < 0.2) newCollectedPoints.add(pp);
}
}
collectedPoints = newCollectedPoints;
} else if (collectedPoints.size() > 50) {
List<Localizable> newCollectedPoints = new ArrayList<Localizable>();
while (newCollectedPoints.size() > 0) {
for (Localizable pp : collectedPoints) {
if (Math.random() < 0.1) newCollectedPoints.add(pp);
}
}
collectedPoints = newCollectedPoints;
}
submitAndClearPoints();
}
//TODO log.info("Image window: line... from "+p1+" to "+p2);
Expand Down

0 comments on commit 3d12691

Please sign in to comment.