|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--java.awt.Window | +--java.awt.Frame | +--javax.swing.JFrame | +--HorizontalLineRemovalSettingsDialogBox
A dialog box that allows the user to select thresholds that control which pixels are to be selected as belonging to horizontal lines of some specified colour or combination of colour.
Parameters are chosen to set the RGB colour channel intervals that candidate pixels that could belong to the horizontal lines must fall within (including absolute 8 bit values, fraction of total level per channel and average brightness). The user may also choose to set thresholds based on maximum vertical run length and minimum horizontal run length. The Filter Pixels By checkboxes enable the user to control which of these options are used, and the text boxes allow the users to set the parameters. The filtering is performed in the same order that the Filter Pixels By options are listed, with only the pixels surviving one stage serving as candidates to the next.
Users can use the Test Thresholds button to restore the image to that of the file that was most recently loaded or saved and then cause those pixels that survive various thresholds to be superimposed on the image. Only the last n layers, as set by the Max Layers To Display text area are displayed. The pixels surviving the last stage of filtering are set to bright green, those surviving the second to last stage are set to bright orange, those surviving the third to last stage are set to blue, those survivng the fourth to last stage are set to magenta and those surviving the first stage are set to magenta. The Restore Defaults button restores the values of the settings to their hard coded values.
The Done button hides this dialogbox.
The following parameters can be set:
Min Absolute Red: the minimum red RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be lower than the Max Absolute Red.
Max Absolute Red: the maximum red RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be higher than the Min Absolute Red.
Min Absolute Green: the minimum green RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be lower than the Max Absolute Green.
Max Absolute Green: the maximum green RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be higher than the Min Absolute Green.
Min Absolute Blue: the minimum blue RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be lower than the Max Absolute Blue.
Max Absolute Blue: the maximum blue RGB channel level that a
pixel must have in order to be selected as a candidate. Value must be between 0
and 255 and must be higher than the Min Absolute Blue.
Min Red Percentage: the minimum percentage of the total RGB levels
represented by the red channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be lower
than the Red Blue Percentage.
Max Red Percentage: the maximum percentage of the total RGB levels
represented by the red channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be higher
than the Min Red Percentage.
Min Green Percentage: the minimum percentage of the total RGB levels
represented by the green channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be lower
than the Green Blue Percentage.
Max Green Percentage: the maximum percentage of the total RGB levels
represented by the green channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be higher
than the Min Green Percentage.
Min Blue Percentage: the minimum percentage of the total RGB levels
represented by the blue channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be lower
than the Max Blue Percentage.
Max Blue Percentage: the maximum percentage of the total RGB levels
represented by the blue channel level that a pixel must have in order to be
selected as a candidate. Value must be between 0.0 and 100.0 and must be higher
than the Min Blue Percentage.
Min Brightness: the minimum average level of the three RGB channels
that a pixel must have in order to be selected as a candidate. Value must be
between 0.0 and 255.0 and must be lower than the Max Brightness.
Max Brightness: the maximum average level of the three RGB channels
that a pixel may have in order to be selected as a candidate. Value must be
between 0.0 and 255.0 and must be higher than the Min Brightness.
Max Vertical Run Length: the maximum number of consecutive vertical
pixels selected by the previous threshold filtering that are acceptable in order
for pixels to be considered part of a horizontal line.
Min Horizontal Run Length: the minimum number of consecutive horizontal
pixels selected by the previous threshold filtering that are acceptable in order
for pixels to be considered part of a horizontal line.
Filter Pixels By: which types of threshold filtering to apply.
Max Layers To Display: the maximum number of filtering layers that
are to be displayed when the Test Threshold button is pressed. If more
than this number of layers are selected with the Filter Pixels By
checkbox, then only the last one(s) are displayed.
These parameters can be accessed by other objects through this class' get methods.
Field Summary |
Fields inherited from class javax.swing.JFrame |
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
HorizontalLineRemovalSettingsDialogBox(MainFrame parent)
Basic constructor. |
Method Summary | |
void |
actionPerformed(ActionEvent event)
Calls the appropriate methods when the buttons are pressed. |
boolean[] |
getFiltersToUse()
Returns a boolean array whose: |
int |
getHighBlueThreshold()
Returns the value of high blue detection threshold, as entered in the text field. |
int |
getHighGreenThreshold()
Returns the value of high green detection threshold, as entered in the text field. |
int |
getHighRedThreshold()
Returns the value of high red detection threshold, as entered in the text field. |
int |
getHorizontalRunLengthThreshold()
Returns the value of horizontal run length threshold, as entered in the text field. |
int |
getLayersToDisplay()
Returns the maximum number of layers to display when the Test Thresholds button is pressed, as entered in the text field. |
int |
getLowBlueThreshold()
Returns the value of low blue detection threshold, as entered in the text field. |
int |
getLowGreenThreshold()
Returns the value of low green detection threshold, as entered in the text field. |
int |
getLowRedThreshold()
Returns the value of low red detection threshold, as entered in the text field. |
double |
getMaxBluePercentageThreshold()
Returns the value of maximum blue percentage threshold, as entered in the text field. |
double |
getMaxBrightnessThreshold()
Returns the value of maximum brightness threshold, as entered in the text field. |
double |
getMaxGreenPercentageThreshold()
Returns the value of maximum green percentage threshold, as entered in the text field. |
double |
getMaxRedPercentageThreshold()
Returns the value of maximum red percentage threshold, as entered in the text field. |
double |
getMinBluePercentageThreshold()
Returns the value of minimum blue percentage threshold, as entered in the text field. |
double |
getMinBrightnessThreshold()
Returns the value of minimum brightness threshold, as entered in the text field. |
double |
getMinGreenPercentageThreshold()
Returns the value of minimum green percentage threshold, as entered in the text field. |
double |
getMinRedPercentageThreshold()
Returns the value of minimum red percentage threshold, as entered in the text field. |
int |
getVerticalRunLengthThreshold()
Returns the value of vertical run length threshold, as entered in the text field. |
Methods inherited from class java.awt.Frame |
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setIconImage, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
getFont, postEvent |
Constructor Detail |
public HorizontalLineRemovalSettingsDialogBox(MainFrame parent)
parent
- Name of the MainFrame
window that spawned this dialog box.Method Detail |
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
event
- The event that is to be reacted to.public int getLowRedThreshold()
public int getHighRedThreshold()
public int getLowGreenThreshold()
public int getHighGreenThreshold()
public int getLowBlueThreshold()
public int getHighBlueThreshold()
public double getMinRedPercentageThreshold()
public double getMaxRedPercentageThreshold()
public double getMinGreenPercentageThreshold()
public double getMaxGreenPercentageThreshold()
public double getMinBluePercentageThreshold()
public double getMaxBluePercentageThreshold()
public double getMinBrightnessThreshold()
public double getMaxBrightnessThreshold()
public int getVerticalRunLengthThreshold()
public int getHorizontalRunLengthThreshold()
public boolean[] getFiltersToUse()
- first element indicates whether or not pixels that do meet the absolute
RGB channel value thresholds are to be filtered
- second element indicates whether or not pixels that do not meet the RGB channel
percentage thresholds are to be filtered
- third element indicates whether or not pixels that do not meet the average
brightness thresholds are to be filtered
- fourth element indicates whether or not pixels that do meet the maximum
vertical run length threshold are to be filtered
- fifth element indicates whether or not pixels that do meet the minimum
horizontal run length are to be filtered
These settings are determined by the the Filter Pixels By checkboxes.
public int getLayersToDisplay()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |