Skip to content

Commit

Permalink
BinarizationAdjustBoard is promoted as the standard BinarizationBoard
Browse files Browse the repository at this point in the history
  • Loading branch information
hbitteur committed Nov 28, 2024
1 parent 41f3d19 commit af6b6cc
Show file tree
Hide file tree
Showing 7 changed files with 797 additions and 776 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class AdaptiveDescriptor

//~ Constructors -------------------------------------------------------------------------------

/** No-arg constructor meant for JAXB. */
/** No-argument constructor meant for JAXB. */
private AdaptiveDescriptor ()
{
meanCoeff = 0;
Expand Down Expand Up @@ -128,7 +128,7 @@ public AdaptiveDescriptor (double meanCoeff,
public boolean equals (Object obj)
{
if ((obj instanceof AdaptiveDescriptor) && super.equals(obj)) {
AdaptiveDescriptor that = (AdaptiveDescriptor) obj;
final AdaptiveDescriptor that = (AdaptiveDescriptor) obj;
final double epsilon = 0.00001;

return (Math.abs(this.meanCoeff - that.meanCoeff) < epsilon) && (Math.abs(
Expand Down
33 changes: 14 additions & 19 deletions app/src/main/java/org/audiveris/omr/sheet/Sheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
import org.audiveris.omr.score.ScoreExporter;
import org.audiveris.omr.score.ScoreReduction;
import org.audiveris.omr.score.ui.BookPdfOutput;
import org.audiveris.omr.sheet.ui.BinarizationAdjustBoard;
import org.audiveris.omr.sheet.ui.BinarizationBoard;
import org.audiveris.omr.sheet.ui.BinaryBoard;
import org.audiveris.omr.sheet.ui.PictureView;
import org.audiveris.omr.sheet.ui.PixelBoard;
import org.audiveris.omr.sheet.ui.SheetAssembly;
Expand Down Expand Up @@ -153,8 +153,8 @@ public class Sheet
public static final String INTERNALS_RADIX = "sheet#";

/** Events that can be published on sheet location service. */
private static final Class<?>[] eventsAllowed = new Class<?>[]
{ LocationEvent.class, PixelEvent.class };
private static final Class<?>[] eventsAllowed = new Class<?>[] { LocationEvent.class,
PixelEvent.class };

/** Un/marshalling context for use with JAXB. */
private static volatile JAXBContext jaxbContext;
Expand Down Expand Up @@ -480,8 +480,7 @@ public void annotate (Path sheetFolder)
try {
os.flush();
os.close();
} catch (IOException ignored) {
}
} catch (IOException ignored) {}
}
}
}
Expand Down Expand Up @@ -592,21 +591,20 @@ public void createBinaryView ()
locationService.subscribeStrongly(LocationEvent.class, picture);

// Display sheet binary
PictureView pictureView = new PictureView(this, tab);
BinarizationAdjustBoard baBoard = new BinarizationAdjustBoard(this);
final PictureView pictureView = new PictureView(this, tab);
final BinarizationBoard binarizationBoard = new BinarizationBoard(this);

if (this.getPicture().getSource(Picture.SourceKey.GRAY) != null) {
baBoard.setSelected(true);
if (getPicture().getSource(Picture.SourceKey.GRAY) != null) {
binarizationBoard.setSelected(true);
}

assembly.addViewTab(
tab,
pictureView,
new BoardsPane(
new PixelBoard(this),
new BinarizationBoard(this),
baBoard
));
new PixelBoard(this),
binarizationBoard,
new BinaryBoard(this)));
} else {
assembly.selectViewTab(tab);
}
Expand All @@ -633,13 +631,10 @@ public void createGrayView ()
locationService.subscribeStrongly(LocationEvent.class, picture);

// Display sheet picture
final PictureView pictureView = new PictureView(this, SheetTab.GRAY_TAB);
final BinarizationBoard bb = new BinarizationBoard(this);
bb.setSelected(true);
stub.getAssembly().addViewTab(
SheetTab.GRAY_TAB,
pictureView,
new BoardsPane(new PixelBoard(this), bb));
new PictureView(this, SheetTab.GRAY_TAB),
new BoardsPane(new PixelBoard(this), new BinaryBoard(this)));
}

//----------------//
Expand Down
Loading

0 comments on commit af6b6cc

Please sign in to comment.