net.aerith.misao.pixy.star_detection
Class DefaultStarDetector

java.lang.Object
  |
  +--net.aerith.misao.util.OperationObservable
        |
        +--net.aerith.misao.util.Operation
              |
              +--net.aerith.misao.pixy.star_detection.DefaultStarDetector

public class DefaultStarDetector
extends Operation

The DefaultStarDetector is a class to detect stars from an image.


Field Summary
protected  boolean correct_blooming_position
          True when to correct the positions of blooming stars.
protected  MonoImage image
          The image where to detect stars.
protected  int inner_aperture_size
          The aperture size of a star.
protected  boolean keep_sky_image
          True if the sky image is kept in the buffer even after operation.
protected  StarImageList list
          The list of detected stars.
protected  int mode
          The mode.
static int MODE_APERTURE
          The mode number which indicates to regard the amount of pixel values within the specified aperture.
static int MODE_PEAK
          The mode number which indicates to regard the peak value as brightness of stars.
static int MODE_PIXEL_AMOUNT_OVER_THRESHOLD
          The mode number which indicates to regard the amount of pixel values over the threshold as brightness of stars.
protected  int outer_aperture_size
          The aperture size of sky around a star.
protected  MonoImage sky_image
          The buffer of sky image.
protected  double threshold
          The threshold value.
protected  double threshold_coefficient
          The threshold coefficient to detect stars.
 
Fields inherited from class net.aerith.misao.util.Operation
monitor_set, stopped
 
Fields inherited from class net.aerith.misao.util.OperationObservable
observer_list
 
Constructor Summary
DefaultStarDetector(MonoImage image)
          Constructs a DefaultStarDetector with a image object where to detect stars.
 
Method Summary
 MonoImage getSkyImage()
          Gets the sky image.
 StarImageList getStarList()
          Gets the list of detected stars.
 void keepSkyImage()
          Sets a flag to keep sky image in the buffer even after operation.
 void operate()
          Operates.
 boolean ready()
          Returns true if the operation is ready to start.
 void setApertureSize(int inner_size, int outer_size)
          Sets the aperture sizes.
 void setCorrectBloomingPosition()
          Sets the flag to correct the positions of blooming stars.
 void setMode(int mode)
          Sets the mode.
 void setThresholdCoefficient(double new_coef)
          Sets the threshold coefficient to detect stars.
 
Methods inherited from class net.aerith.misao.util.Operation
addMonitor, isStopped, perform, run, stop
 
Methods inherited from class net.aerith.misao.util.OperationObservable
addObserver, deleteObserver, notifyEnd, notifyFailed, notifyStart, notifySucceeded, notifyWarned
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

image

protected MonoImage image
The image where to detect stars.

sky_image

protected MonoImage sky_image
The buffer of sky image.

keep_sky_image

protected boolean keep_sky_image
True if the sky image is kept in the buffer even after operation.

threshold

protected double threshold
The threshold value.

list

protected StarImageList list
The list of detected stars.

threshold_coefficient

protected double threshold_coefficient
The threshold coefficient to detect stars.

correct_blooming_position

protected boolean correct_blooming_position
True when to correct the positions of blooming stars.

mode

protected int mode
The mode.

MODE_PIXEL_AMOUNT_OVER_THRESHOLD

public static final int MODE_PIXEL_AMOUNT_OVER_THRESHOLD
The mode number which indicates to regard the amount of pixel values over the threshold as brightness of stars.

MODE_PEAK

public static final int MODE_PEAK
The mode number which indicates to regard the peak value as brightness of stars.

MODE_APERTURE

public static final int MODE_APERTURE
The mode number which indicates to regard the amount of pixel values within the specified aperture.

inner_aperture_size

protected int inner_aperture_size
The aperture size of a star. For example, 4 means 4x4 pixels around the star position.

outer_aperture_size

protected int outer_aperture_size
The aperture size of sky around a star. For example, 4 means 4x4 pixels around the star position.
Constructor Detail

DefaultStarDetector

public DefaultStarDetector(MonoImage image)
Constructs a DefaultStarDetector with a image object where to detect stars.
Parameters:
image - the image where to detect stars.
Method Detail

keepSkyImage

public void keepSkyImage()
Sets a flag to keep sky image in the buffer even after operation.

getSkyImage

public MonoImage getSkyImage()
Gets the sky image. In the case the flag is not set true, it returns null.
Returns:
the sky image.

getStarList

public StarImageList getStarList()
Gets the list of detected stars.
Returns:
the list of detected stars.

setThresholdCoefficient

public void setThresholdCoefficient(double new_coef)
Sets the threshold coefficient to detect stars.
Parameters:
new_coef - the new threshold coefficient.

setCorrectBloomingPosition

public void setCorrectBloomingPosition()
Sets the flag to correct the positions of blooming stars.

setMode

public void setMode(int mode)
Sets the mode.
Parameters:
mode - the mode number.

setApertureSize

public void setApertureSize(int inner_size,
                            int outer_size)
Sets the aperture sizes. For example, 4 means 4x4 pixels around the star position.
Parameters:
inner_size - the aperture size of a star.
outer_size - the aperture size of sky around a star.

ready

public boolean ready()
Returns true if the operation is ready to start.
Overrides:
ready in class Operation
Returns:
true if the operation is ready to start.

operate

public void operate()
             throws java.lang.Exception
Operates.
Overrides:
operate in class Operation
Throws:
java.lang.Exception - if an error occurs.