|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectsoftware.scanner.ScannedBallot
public class ScannedBallot
Each ballot has two alignment marks. One close to the upper left corner and
the other close of the lower right corner.
Each alignment mark is a non-white circle = two black circles.
For starter, we assume that the the width of the image is the width of the ballot.
We can compute the dpi having this assumption.
How to correct for alignment:
Stept1:
| Field Summary | |
|---|---|
static boolean |
debug
|
| Constructor Summary | |
|---|---|
ScannedBallot(BallotGeometry geom,
org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es)
Initialises the scanned ballot with the Geometry and the ELection Spec |
|
| Method Summary | |
|---|---|
void |
detect(java.awt.image.BufferedImage img)
Given a scanned ballot, detects the votes and the serial number |
void |
detect(java.lang.String pdfFile)
Deprecated. (the intention is to convert a pdf to an image) |
void |
detectFromPerfectImage(java.awt.image.BufferedImage img,
double dpi)
|
void |
detectMarksFormPerfectImage(java.awt.image.BufferedImage img,
double dpi)
|
void |
detectSerialFromPerfectImage(java.awt.image.BufferedImage img,
double dpi)
Tries to read the serial from whre it should on the top page, if unssucesful, tries to read the serial number from where it should be on the bottom page |
java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.Integer,software.scanner.ScannedBallot.TypeOfVotes>>> |
getAllContests()
|
BallotGeometryMap |
getBallotGeometryMap()
|
java.lang.String |
getCompactRepresentation()
[T|B]serial space separated marked possitions. |
double |
getDpi()
|
java.util.Vector<Cluster> |
getFullVotes()
|
java.util.Vector<Cluster> |
getOverVotes()
|
java.awt.image.BufferedImage |
getPerfectImage()
|
Prow.ChosenPage |
getSelectedPage()
|
java.lang.String |
getSerial()
|
java.util.Vector<Cluster> |
getUnderVotes()
|
java.util.Vector<Cluster> |
getVotes(software.scanner.ScannedBallot.TypeOfVotes vote)
|
boolean |
isMailIn()
|
static void |
main(java.lang.String[] args)
|
void |
setMailIn(boolean mailIn)
|
Prow |
toProw()
|
byte[] |
toXMLString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static boolean debug
| Constructor Detail |
|---|
public ScannedBallot(BallotGeometry geom,
org.gwu.voting.standardFormat.electionSpecification.ElectionSpecification es)
geom - es - | Method Detail |
|---|
public void detectFromPerfectImage(java.awt.image.BufferedImage img,
double dpi)
throws java.lang.Exception
img - a perfectly aligned imagedpi - - the dpi of the image
java.lang.Exception - - no Exception is caugth and no Exception is Explicitly thrown
public void detectMarksFormPerfectImage(java.awt.image.BufferedImage img,
double dpi)
public void detectSerialFromPerfectImage(java.awt.image.BufferedImage img,
double dpi)
throws java.lang.Exception
img - dpi -
java.lang.Exceptionpublic void detect(java.lang.String pdfFile)
pdfFile -
public void detect(java.awt.image.BufferedImage img)
throws java.lang.Exception
ScannedBallotInterface
detect in interface ScannedBallotInterfacejava.lang.Exception - - if the serial number cannot be properly readpublic byte[] toXMLString()
toXMLString in interface ScannedBallotInterfacepublic java.lang.String getCompactRepresentation()
ScannedBallotInterface
getCompactRepresentation in interface ScannedBallotInterfacepublic Prow toProw()
toProw in interface ScannedBallotInterfacepublic java.lang.String getSerial()
getSerial in interface ScannedBallotInterfacepublic java.util.Vector<Cluster> getFullVotes()
getFullVotes in interface ScannedBallotInterfacepublic java.util.Vector<Cluster> getOverVotes()
getOverVotes in interface ScannedBallotInterfacepublic java.util.Vector<Cluster> getUnderVotes()
getUnderVotes in interface ScannedBallotInterfacepublic java.util.Vector<Cluster> getVotes(software.scanner.ScannedBallot.TypeOfVotes vote)
public Prow.ChosenPage getSelectedPage()
getSelectedPage in interface ScannedBallotInterfacepublic java.awt.image.BufferedImage getPerfectImage()
getPerfectImage in interface ScannedBallotInterfacepublic double getDpi()
getDpi in interface ScannedBallotInterfacepublic BallotGeometryMap getBallotGeometryMap()
getBallotGeometryMap in interface ScannedBallotInterfacepublic java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.Integer,java.util.TreeMap<java.lang.Integer,software.scanner.ScannedBallot.TypeOfVotes>>> getAllContests()
getAllContests in interface ScannedBallotInterfacepublic boolean isMailIn()
isMailIn in interface ScannedBallotInterfacepublic void setMailIn(boolean mailIn)
setMailIn in interface ScannedBallotInterfacemailIn - if a ballot is mailed in, the other page is marked as scanned
(i.e. the the top page is scanned, bottom is recorded).
This can be done because only the possitions are retained
public static void main(java.lang.String[] args)
throws java.lang.Exception
java.lang.Exception
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||