|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttopcodes.Scanner
public class Scanner
Loads and scans images for TopCodes. The algorithm does a single sweep of an image (scanning one horizontal line at a time) looking for a pattern pattern: WHITE BLACK WHITE BLACK WHITE. If the pattern matches and the black and white regions meet certain ratio constraints, then the pixel is tested as the center of a candidate TopCode.
Constructor Summary | |
---|---|
Scanner()
Default constructor |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getImage()
Returns the original (unaltered) image |
int |
getImageHeight()
Returns the width in pixels of the current image (or zero if no image is loaded). |
int |
getImageWidth()
Returns the width in pixels of the current image (or zero if no image is loaded). |
java.awt.image.BufferedImage |
getPreview()
For debugging purposes, create a black and white image that shows the result of adaptive thresholding. |
java.util.List<TopCode> |
scan(java.awt.image.BufferedImage image)
Scan the given image and return a list of all topcodes found in it. |
java.util.List<TopCode> |
scan(int[] rgb,
int width,
int height)
Scan the image and return a list of all topcodes found in it. |
java.util.List<TopCode> |
scan(java.lang.String filename)
Scan the given image file and return a list of topcodes found in it. |
void |
setMaxCodeDiameter(int diameter)
Sets the maximum allowable diameter (in pixels) for a TopCode identified by the scanner. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Scanner()
Method Detail |
---|
public java.util.List<TopCode> scan(java.lang.String filename) throws java.io.IOException
java.io.IOException
public java.util.List<TopCode> scan(java.awt.image.BufferedImage image)
public java.util.List<TopCode> scan(int[] rgb, int width, int height)
rgb
- an array of pixel data in packed RGB formatwidth
- width of the imageheight
- height of the imagepublic java.awt.image.BufferedImage getImage()
public int getImageWidth()
public int getImageHeight()
public void setMaxCodeDiameter(int diameter)
public java.awt.image.BufferedImage getPreview()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |