Package org.opensourcephysics.media.core
Class BaselineFilter
java.lang.Object
org.opensourcephysics.display.OSPRuntime.Supported
org.opensourcephysics.media.core.Filter
org.opensourcephysics.media.core.BaselineFilter
This is a Filter that subtracts a baseline image from the source image.
- Version:
- 1.0
- Author:
- Douglas Brown
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opensourcephysics.media.core.Filter
Filter.InspectorDlg
-
Field Summary
Fields inherited from class org.opensourcephysics.media.core.Filter
ableButton, autoScale720x480, changed, clearButton, closeButton, copyItem, deleteItem, doCreateOutput, enabledAction, enabledItem, frame, h, hasInspector, haveGUI, heightFactor, input, inspectorDlg, inspectorVisible, inspectorX, inspectorY, nPixelsIn, output, pixelsIn, pixelsOut, previousState, propertiesItem, PROPERTY_FILTER_BRIGHTNESS, PROPERTY_FILTER_COLOR, PROPERTY_FILTER_ENABLED, PROPERTY_FILTER_FILTER, PROPERTY_FILTER_IMAGE, PROPERTY_FILTER_MEAN, PROPERTY_FILTER_RESET, PROPERTY_FILTER_TAB, PROPERTY_FILTER_VISIBLE, ROTATE_180, ROTATE_CCW_90, ROTATE_CW_90, ROTATE_NONE, rotationType, source, stack, vidPanel, w, widthFactor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
capture()
Captures the current video frame to use as baseline image.void
clear()
Clears this filterGets the baseline image being subtracted.static XML.ObjectLoader
Returns an XML.ObjectLoader to save and load filter data.protected void
Creates new input, output and baseline images.protected Filter.InspectorDlg
void
load()
Loads an image with a file chooser.void
Loads a baseline image from the specified path.protected Filter.InspectorDlg
Implements abstract Filter method.void
refresh()
Refreshes this filter's GUIvoid
Used to resize thumbnanil image when font size is changed.void
save()
Saves the current baseline image.boolean
setBaselineImage
(BufferedImage image) Sets the baseline image.protected void
Sets the output to an image-subtracted version of the input.Methods inherited from class org.opensourcephysics.media.core.Filter
addLocation, copy, dispose, finalize, getFilteredImage, getFrame, getInspector, getMenu, getPixels, getPixelsIn, getPixelsOut, getRaster, initializeSource, isChanged, isEnabled, setEnabled, setVideoPanel
Methods inherited from class org.opensourcephysics.display.OSPRuntime.Supported
addListeners, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListenerSafely, dispose, firePropertyChange, firePropertyChange, removeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
BaselineFilter
public BaselineFilter()Constructs a default BaselineFilter.
-
-
Method Details
-
capture
public void capture()Captures the current video frame to use as baseline image. -
save
public void save()Saves the current baseline image. -
load
Loads a baseline image from the specified path.- Parameters:
path
- the image path
-
load
public void load()Loads an image with a file chooser. -
setBaselineImage
Sets the baseline image.- Parameters:
image
- the image- Returns:
- true if the image was accepted
-
getBaselineImage
Gets the baseline image being subtracted.- Returns:
- the image
-
resizeThumbnail
public void resizeThumbnail()Used to resize thumbnanil image when font size is changed. -
newInspector
Implements abstract Filter method.- Specified by:
newInspector
in classFilter
- Returns:
- the inspector
-
initInspector
- Specified by:
initInspector
in classFilter
-
clear
public void clear()Clears this filter -
refresh
public void refresh()Refreshes this filter's GUI -
initializeSubclass
protected void initializeSubclass()Creates new input, output and baseline images.- Specified by:
initializeSubclass
in classFilter
- Parameters:
image
- a new source image
-
setOutputPixels
protected void setOutputPixels()Sets the output to an image-subtracted version of the input.- Specified by:
setOutputPixels
in classFilter
-
getLoader
Returns an XML.ObjectLoader to save and load filter data.- Returns:
- the object loader
-