jp.digitalmuseum.mr.service
クラス MarkerDetector

java.lang.Object
  上位を拡張 jp.digitalmuseum.mr.service.ServiceAbstractImpl
      上位を拡張 jp.digitalmuseum.mr.service.ScreenLocationProviderAbstractImpl
          上位を拡張 jp.digitalmuseum.mr.service.MarkerDetector
すべての実装されたインタフェース:
java.io.Serializable, java.lang.Runnable, EventProvider, EntityInformationProvider, LocationProvider, ScreenLocationProvider, Service, NapMarkerDetector

public class MarkerDetector
extends ScreenLocationProviderAbstractImpl
implements NapMarkerDetector, LocationProvider
Marker detector service using NyARToolkit.
作成者:
Jun KATO
関連項目:
NapMarker, 直列化された形式

フィールドの概要
static java.lang.String SERVICE_NAME
           
static int THRESHOLD_DEFAULT
           
static int THRESHOLD_MAX
           
static int THRESHOLD_MIN
           
 
クラス jp.digitalmuseum.mr.service.ServiceAbstractImpl から継承されたフィールド
DEFAULT_INTERVAL
 
インタフェース jp.digitalmuseum.napkit.NapMarkerDetector から継承されたフィールド
MAX_SQUARE
 
コンストラクタの概要
MarkerDetector()
           
 
メソッドの概要
 boolean addMarker(NapMarker marker)
          Add a marker to detect.
 boolean addMarker(NapMarker marker, Entity e)
           
 boolean addMarkers(java.util.Map<NapMarker,Entity> markersMap)
           
 boolean addMarkers(java.util.Set<NapMarker> markers)
          Add markers to detect.
 boolean calcCameraRelation()
           
 boolean contains(Entity entity)
           
 boolean contains(Entity e, Position position)
           
 Array<NapDetectionResult> detectMarker(java.lang.Object imageData)
          Detect markers in the provided image.
 java.awt.image.BufferedImage getBinarizedImage()
          Get the binarized image used for the last detection.
 double[] getCameraProjectionMatrix()
           
 void getCameraProjectionMatrixOut(double[] cameraProjectionMatrix)
           
 javax.swing.JComponent getConfigurationComponent()
           
 CoordProvider getCoordProvider()
           
 java.util.Set<Entity> getEntities()
           
 Entity getEntity(NapMarker marker)
           
 int getHeight()
           
 ImageProvider getImageProvider()
           
 Array<NapDetectionResult> getLastMarkerDetectionResult()
          推奨されていません。 
 Array<ScreenRectangle> getLastSquareDetectionResult()
          推奨されていません。 
 Location getLocation(Entity e)
           
 void getLocationOut(Entity e, Location location)
           
 java.util.Set<NapMarker> getMarkers()
          Get markers to be detected.
 java.lang.String getName()
           
 Position getPosition(Entity e)
           
 void getPositionOut(Entity e, Position position)
           
 NapDetectionResult getResult(Entity e)
           
 NapDetectionResult getResult(NapMarker marker)
           
 java.util.Map<Entity,NapDetectionResult> getResultMap()
           
 Array<NapDetectionResult> getResults()
           
 double getRotation(Entity e)
          Returns 0 if not able to specify the rotation.
 void getScreenLocationOut(Entity e, ScreenLocation screenLocation)
          Get screen location of the entity.
 Array<ScreenRectangle> getSquares()
           
 ImageProvider getSubCamera()
           
 int getThreshold()
          Get the specified threshold value.
 int getWidth()
           
 double getX(Entity e)
          Returns 0 if not able to specify the position.
 double getY(Entity e)
          Returns 0 if not able to specify the position.
protected  void initialize()
           
 boolean isTransMatEnabled()
           
 boolean loadCameraParameter(java.lang.String fileName)
          Load a camera parameter from a file.
 boolean loadCameraParameter(java.lang.String fileName, int width, int height)
          Load a camera parameter from a file, and specify width and height of the screen.
 void paint(java.awt.Graphics2D g)
          Draw markers in the specified graphics context.
 void paint(java.awt.Graphics2D g, NapDetectionResult result)
          Draw a detection result (marker) in the specified graphics context.
 boolean put(NapMarker marker, Entity e)
          推奨されていません。 
 void remove(NapMarker marker)
          推奨されていません。 
 void removeMarker(NapMarker marker)
          Remove a marker to detect.
 void removeMarkers(java.util.Set<NapMarker> markers)
          Remove markers to detect.
 void run()
           
 void setCoordsProvider(CoordProvider coordProvider)
           
 void setImageProvider(ImageProvider imageProvider)
           
 boolean setPixelReader(java.lang.String readerName)
          Set pixel reader by its name.
Pixel reader is used for reading color of each pixel of the image data in NapMarkerDetector.detectMarker(Object).
 void setSize(int width, int height)
           
 boolean setSubCamera(ImageProvider subImageProvider)
          Camera parameters of the primary camera and the secondary camera must be the same; typically, two cameras must be the same type.
 void setThreshold(int threshold)
          Set threshold to binarize full color/gray scale image.
 void setTransMatEnabled(boolean isTransMatEnabled)
           
 void start(ServiceGroup serviceGroup)
          Start this service on the specified service group.
 
クラス jp.digitalmuseum.mr.service.ScreenLocationProviderAbstractImpl から継承されたメソッド
getScreenLocation, getScreenPosition, getScreenPositionOut, getScreenRotation, getScreenX, getScreenY
 
クラス jp.digitalmuseum.mr.service.ServiceAbstractImpl から継承されたメソッド
addEventListener, dispose, distributeEvent, getAliveTime, getInterval, getServiceGroup, isDisposed, isPaused, isStarted, onPause, onResume, onStart, onStop, pause, removeEventListener, resume, setInterval, setServiceGroup, start, stop, toString
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
インタフェース jp.digitalmuseum.mr.service.Service から継承されたメソッド
dispose, getAliveTime, getInterval, getServiceGroup, isDisposed, isPaused, isStarted, pause, resume, setInterval, setServiceGroup, start, stop
 
インタフェース jp.digitalmuseum.mr.message.EventProvider から継承されたメソッド
addEventListener, removeEventListener
 
フィールドの詳細

SERVICE_NAME

public static final java.lang.String SERVICE_NAME
関連項目:
定数フィールド値

THRESHOLD_MIN

public static final int THRESHOLD_MIN
関連項目:
定数フィールド値

THRESHOLD_MAX

public static final int THRESHOLD_MAX
関連項目:
定数フィールド値

THRESHOLD_DEFAULT

public static final int THRESHOLD_DEFAULT
関連項目:
定数フィールド値
コンストラクタの詳細

MarkerDetector

public MarkerDetector()
メソッドの詳細

getName

public java.lang.String getName()
定義:
インタフェース Service 内の getName
オーバーライド:
クラス ServiceAbstractImpl 内の getName
戻り値:
Returns the name of this service.

initialize

protected void initialize()
オーバーライド:
クラス ServiceAbstractImpl 内の initialize

setImageProvider

public void setImageProvider(ImageProvider imageProvider)

getImageProvider

public ImageProvider getImageProvider()

setSubCamera

public boolean setSubCamera(ImageProvider subImageProvider)
Camera parameters of the primary camera and the secondary camera must be the same; typically, two cameras must be the same type.
パラメータ:
subImageProvider -
戻り値:

getSubCamera

public ImageProvider getSubCamera()

calcCameraRelation

public boolean calcCameraRelation()

setCoordsProvider

public void setCoordsProvider(CoordProvider coordProvider)

getCoordProvider

public CoordProvider getCoordProvider()
定義:
インタフェース LocationProvider 内の getCoordProvider

addMarker

public boolean addMarker(NapMarker marker)
インタフェース NapMarkerDetector の記述:
Add a marker to detect.
定義:
インタフェース NapMarkerDetector 内の addMarker
戻り値:
Returns false if the specified marker has different formats from the existing markers.

addMarker

public boolean addMarker(NapMarker marker,
                         Entity e)

addMarkers

public boolean addMarkers(java.util.Set<NapMarker> markers)
インタフェース NapMarkerDetector の記述:
Add markers to detect.
定義:
インタフェース NapMarkerDetector 内の addMarkers
戻り値:
Returns false if the given set is null or specified markers have mixed formats.

addMarkers

public boolean addMarkers(java.util.Map<NapMarker,Entity> markersMap)

removeMarker

public void removeMarker(NapMarker marker)
インタフェース NapMarkerDetector の記述:
Remove a marker to detect.
定義:
インタフェース NapMarkerDetector 内の removeMarker

removeMarkers

public void removeMarkers(java.util.Set<NapMarker> markers)
インタフェース NapMarkerDetector の記述:
Remove markers to detect.
定義:
インタフェース NapMarkerDetector 内の removeMarkers

getEntity

public Entity getEntity(NapMarker marker)

getResult

public NapDetectionResult getResult(Entity e)

getResultMap

public java.util.Map<Entity,NapDetectionResult> getResultMap()

start

public void start(ServiceGroup serviceGroup)
インタフェース Service の記述:
Start this service on the specified service group. Calling this method is equivalent to calling start() after setServiceGroup(serviceGroup).
定義:
インタフェース Service 内の start
オーバーライド:
クラス ServiceAbstractImpl 内の start
関連項目:
Service.start()

run

public void run()
定義:
インタフェース java.lang.Runnable 内の run

getConfigurationComponent

public javax.swing.JComponent getConfigurationComponent()
定義:
インタフェース Service 内の getConfigurationComponent
オーバーライド:
クラス ServiceAbstractImpl 内の getConfigurationComponent
戻り値:
Returns a Swing component for configuring this service.
関連項目:
JComponent

paint

public void paint(java.awt.Graphics2D g)
Draw markers in the specified graphics context.
パラメータ:
g -

paint

public void paint(java.awt.Graphics2D g,
                  NapDetectionResult result)
Draw a detection result (marker) in the specified graphics context.
パラメータ:
g -
result -

getEntities

public java.util.Set<Entity> getEntities()
定義:
インタフェース EntityInformationProvider 内の getEntities
戻り値:
Returns a set of entities whose information is provided by this instance.

getMarkers

public java.util.Set<NapMarker> getMarkers()
インタフェース NapMarkerDetector の記述:
Get markers to be detected.
定義:
インタフェース NapMarkerDetector 内の getMarkers
戻り値:
Set of markers to be detected.

contains

public boolean contains(Entity entity)
定義:
インタフェース EntityInformationProvider 内の contains
戻り値:
Returns whether this provider provides information about the specified entity or not.

getLocation

public Location getLocation(Entity e)
定義:
インタフェース LocationProvider 内の getLocation

getLocationOut

public void getLocationOut(Entity e,
                           Location location)
定義:
インタフェース LocationProvider 内の getLocationOut

getPosition

public Position getPosition(Entity e)
定義:
インタフェース LocationProvider 内の getPosition

getPositionOut

public void getPositionOut(Entity e,
                           Position position)
定義:
インタフェース LocationProvider 内の getPositionOut

getRotation

public double getRotation(Entity e)
インタフェース LocationProvider の記述:
Returns 0 if not able to specify the rotation.
定義:
インタフェース LocationProvider 内の getRotation
戻り値:

getX

public double getX(Entity e)
インタフェース LocationProvider の記述:
Returns 0 if not able to specify the position.
定義:
インタフェース LocationProvider 内の getX
戻り値:

getY

public double getY(Entity e)
インタフェース LocationProvider の記述:
Returns 0 if not able to specify the position.
定義:
インタフェース LocationProvider 内の getY
戻り値:

contains

public boolean contains(Entity e,
                        Position position)
定義:
インタフェース LocationProvider 内の contains

getScreenLocationOut

public void getScreenLocationOut(Entity e,
                                 ScreenLocation screenLocation)
クラス ScreenLocationProviderAbstractImpl の記述:
Get screen location of the entity.
定義:
インタフェース ScreenLocationProvider 内の getScreenLocationOut
定義:
クラス ScreenLocationProviderAbstractImpl 内の getScreenLocationOut
パラメータ:
e - Entity to get screen location.
screenLocation - Screen location object.

loadCameraParameter

public boolean loadCameraParameter(java.lang.String fileName)
インタフェース NapMarkerDetector の記述:
Load a camera parameter from a file.
定義:
インタフェース NapMarkerDetector 内の loadCameraParameter
パラメータ:
fileName - Name of a camera parameter file.

loadCameraParameter

public boolean loadCameraParameter(java.lang.String fileName,
                                   int width,
                                   int height)
インタフェース NapMarkerDetector の記述:
Load a camera parameter from a file, and specify width and height of the screen.
定義:
インタフェース NapMarkerDetector 内の loadCameraParameter
パラメータ:
fileName - Name of a camera parameter file.
width - Width of the image captured by the camera.
height - Height of the image captured by the camera.

getCameraProjectionMatrix

public double[] getCameraProjectionMatrix()
定義:
インタフェース NapMarkerDetector 内の getCameraProjectionMatrix

getCameraProjectionMatrixOut

public void getCameraProjectionMatrixOut(double[] cameraProjectionMatrix)
定義:
インタフェース NapMarkerDetector 内の getCameraProjectionMatrixOut

setThreshold

public void setThreshold(int threshold)
インタフェース NapMarkerDetector の記述:
Set threshold to binarize full color/gray scale image.
定義:
インタフェース NapMarkerDetector 内の setThreshold

getThreshold

public int getThreshold()
インタフェース NapMarkerDetector の記述:
Get the specified threshold value.
定義:
インタフェース NapMarkerDetector 内の getThreshold
戻り値:

getBinarizedImage

public java.awt.image.BufferedImage getBinarizedImage()
インタフェース NapMarkerDetector の記述:
Get the binarized image used for the last detection.
定義:
インタフェース NapMarkerDetector 内の getBinarizedImage
戻り値:

isTransMatEnabled

public boolean isTransMatEnabled()
定義:
インタフェース NapMarkerDetector 内の isTransMatEnabled

setTransMatEnabled

public void setTransMatEnabled(boolean isTransMatEnabled)
定義:
インタフェース NapMarkerDetector 内の setTransMatEnabled

setPixelReader

public boolean setPixelReader(java.lang.String readerName)
インタフェース NapMarkerDetector の記述:
Set pixel reader by its name.
Pixel reader is used for reading color of each pixel of the image data in NapMarkerDetector.detectMarker(Object).
BYTE1D_B8G8R8_24
Image data is provided as a byte array in BGRBGR... order. (default)
BYTE1D_R8G8B8_24
Image data is provided as a byte array in RGBRGB... order.
BYTE1D_B8G8R8X8_32
Image data is provided as a byte array in BGRXBGRX... order where X means alpha value.
BYTE1D_X8R8G8B8_32
Image data is provided as a byte array in XRGBXRGB... order where X means alpha value.
INT1D_GRAY_8
Image data is provided as an integer array, each of whose element represents gray-scaled value.
INT1D_X8R8G8B8_32
Image data is provided as an integer array, each of whose element represents RGB color with alpha value.
定義:
インタフェース NapMarkerDetector 内の setPixelReader
パラメータ:
readerName - Name of a pixel reader.
戻り値:
Whether specified pixel reader is available or not.

getWidth

public int getWidth()
定義:
インタフェース NapMarkerDetector 内の getWidth

getHeight

public int getHeight()
定義:
インタフェース NapMarkerDetector 内の getHeight

setSize

public void setSize(int width,
                    int height)
定義:
インタフェース NapMarkerDetector 内の setSize

detectMarker

public Array<NapDetectionResult> detectMarker(java.lang.Object imageData)
インタフェース NapMarkerDetector の記述:
Detect markers in the provided image.
定義:
インタフェース NapMarkerDetector 内の detectMarker
パラメータ:
imageData - Image data
戻り値:
Detection results

getResult

public NapDetectionResult getResult(NapMarker marker)
定義:
インタフェース NapMarkerDetector 内の getResult

getResults

public Array<NapDetectionResult> getResults()
定義:
インタフェース NapMarkerDetector 内の getResults

getSquares

public Array<ScreenRectangle> getSquares()
定義:
インタフェース NapMarkerDetector 内の getSquares

put

@Deprecated
public boolean put(NapMarker marker,
                              Entity e)
推奨されていません。 
Use addMarker(NapMarker, Entity) instead.

remove

@Deprecated
public void remove(NapMarker marker)
推奨されていません。 
Use removeMarker(NapMarker) instead.

getLastMarkerDetectionResult

@Deprecated
public Array<NapDetectionResult> getLastMarkerDetectionResult()
推奨されていません。 
インタフェース NapMarkerDetector の記述:
Use NapMarkerDetector.getResults() instead.
定義:
インタフェース NapMarkerDetector 内の getLastMarkerDetectionResult

getLastSquareDetectionResult

@Deprecated
public Array<ScreenRectangle> getLastSquareDetectionResult()
推奨されていません。 
インタフェース NapMarkerDetector の記述:
Use NapMarkerDetector.getSquares() instead.
定義:
インタフェース NapMarkerDetector 内の getLastSquareDetectionResult


Copyright by Jun KATO (arc@dmz) at https://mr.digitalmuseum.jp/