Reached stable test suite with proper results checking.
This commit is contained in:
parent
c8af68b140
commit
ba8e1fff90
@ -68,8 +68,10 @@ public class TypeFace2 {
|
|||||||
Rectangle r = ranges[i];
|
Rectangle r = ranges[i];
|
||||||
|
|
||||||
//System.out.println("Image "+i+":");
|
//System.out.println("Image "+i+":");
|
||||||
|
if (debug) {
|
||||||
File temp = new File("rectangle"+i+".png");
|
File temp = new File("rectangle"+i+".png");
|
||||||
ImageIO.write(img2.getSubimage(r.x,r.y,r.width,r.height),"png",temp);
|
ImageIO.write(img2.getSubimage(r.x,r.y,r.width,r.height),"png",temp);
|
||||||
|
}
|
||||||
|
|
||||||
finalNumbers[i]=extractNumbersFromImage(img2.getSubimage(
|
finalNumbers[i]=extractNumbersFromImage(img2.getSubimage(
|
||||||
r.x,r.y,r.width,r.height),debug);
|
r.x,r.y,r.width,r.height),debug);
|
||||||
@ -88,8 +90,16 @@ public class TypeFace2 {
|
|||||||
|
|
||||||
|
|
||||||
//489,197
|
//489,197
|
||||||
Color failPixel = new Color(img2.getRGB(489, 197));
|
|
||||||
result.fail = failPixel.getRed()<100&&failPixel.getGreen()<100&&failPixel.getBlue()<100;
|
Color failPixel = null;
|
||||||
|
result.fail = false;
|
||||||
|
for (int i=0;i<11;i++) {
|
||||||
|
failPixel=new Color(img2.getRGB(489, 187+i));
|
||||||
|
if (failPixel.getRed()<100&&failPixel.getGreen()<100&&failPixel.getBlue()<100) {
|
||||||
|
result.fail = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Color difficultyPixel = new Color(img2.getRGB(622, 110));
|
Color difficultyPixel = new Color(img2.getRGB(622, 110));
|
||||||
result.difficulty = getDifficulty(difficultyPixel);
|
result.difficulty = getDifficulty(difficultyPixel);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user