Stable detection of all results screen images, included mod detection, score detection, combo detection

master
Joshua Sigona 5 years ago
parent 982f0a03e9
commit 88b2f2a70b
  1. BIN
      image.png
  2. BIN
      resources/ジターバグ_2.jpg
  3. BIN
      resources/大江戸ジュリアナイト_2.jpg
  4. 72
      src/main/java/com/example/demo/Controller.java
  5. 92
      src/main/java/com/example/demo/DemoApplication.java
  6. 13
      src/main/java/sig/TypeFace.java
  7. 4
      src/main/java/sig/utils/ImageUtils.java
  8. BIN
      temp
  9. 10
      tmp/combo/0.txt
  10. BIN
      tmp/combo/0_0.png
  11. BIN
      tmp/combo/0_1.png
  12. BIN
      tmp/combo/0_2.png
  13. BIN
      tmp/combo/0_3.png
  14. BIN
      tmp/combo/0_4.png
  15. BIN
      tmp/combo/0_5.png
  16. BIN
      tmp/combo/0_6.png
  17. BIN
      tmp/combo/0_7.png
  18. BIN
      tmp/combo/0_8.png
  19. BIN
      tmp/combo/0_9.png
  20. 8
      tmp/combo/1.txt
  21. BIN
      tmp/combo/1_0.png
  22. BIN
      tmp/combo/1_1.png
  23. BIN
      tmp/combo/1_2.png
  24. BIN
      tmp/combo/1_3.png
  25. BIN
      tmp/combo/1_4.png
  26. BIN
      tmp/combo/1_5.png
  27. BIN
      tmp/combo/1_6.png
  28. BIN
      tmp/combo/1_7.png
  29. BIN
      tmp/combo/1_8.png
  30. BIN
      tmp/combo/1_9.png
  31. 10
      tmp/combo/2.txt
  32. BIN
      tmp/combo/2_0.png
  33. BIN
      tmp/combo/2_1.png
  34. BIN
      tmp/combo/2_2.png
  35. BIN
      tmp/combo/2_3.png
  36. BIN
      tmp/combo/2_4.png
  37. BIN
      tmp/combo/2_5.png
  38. BIN
      tmp/combo/2_6.png
  39. BIN
      tmp/combo/2_7.png
  40. BIN
      tmp/combo/2_8.png
  41. BIN
      tmp/combo/2_9.png
  42. BIN
      tmp/combo/img.png
  43. 20
      tmp/cool/0.txt
  44. BIN
      tmp/cool/0_0.png
  45. BIN
      tmp/cool/0_1.png
  46. BIN
      tmp/cool/0_2.png
  47. BIN
      tmp/cool/0_3.png
  48. BIN
      tmp/cool/0_4.png
  49. BIN
      tmp/cool/0_5.png
  50. BIN
      tmp/cool/0_6.png
  51. BIN
      tmp/cool/0_7.png
  52. BIN
      tmp/cool/0_8.png
  53. BIN
      tmp/cool/0_9.png
  54. 20
      tmp/cool/1.txt
  55. BIN
      tmp/cool/1_0.png
  56. BIN
      tmp/cool/1_1.png
  57. BIN
      tmp/cool/1_2.png
  58. BIN
      tmp/cool/1_3.png
  59. BIN
      tmp/cool/1_4.png
  60. BIN
      tmp/cool/1_5.png
  61. BIN
      tmp/cool/1_6.png
  62. BIN
      tmp/cool/1_7.png
  63. BIN
      tmp/cool/1_8.png
  64. BIN
      tmp/cool/1_9.png
  65. 20
      tmp/cool/2.txt
  66. BIN
      tmp/cool/2_0.png
  67. BIN
      tmp/cool/2_1.png
  68. BIN
      tmp/cool/2_2.png
  69. BIN
      tmp/cool/2_3.png
  70. BIN
      tmp/cool/2_4.png
  71. BIN
      tmp/cool/2_5.png
  72. BIN
      tmp/cool/2_6.png
  73. BIN
      tmp/cool/2_7.png
  74. BIN
      tmp/cool/2_8.png
  75. BIN
      tmp/cool/2_9.png
  76. BIN
      tmp/cool/img.png
  77. 20
      tmp/fine/0.txt
  78. BIN
      tmp/fine/0_0.png
  79. BIN
      tmp/fine/0_1.png
  80. BIN
      tmp/fine/0_2.png
  81. BIN
      tmp/fine/0_3.png
  82. BIN
      tmp/fine/0_4.png
  83. BIN
      tmp/fine/0_5.png
  84. BIN
      tmp/fine/0_6.png
  85. BIN
      tmp/fine/0_7.png
  86. BIN
      tmp/fine/0_8.png
  87. BIN
      tmp/fine/0_9.png
  88. 4
      tmp/fine/1.txt
  89. BIN
      tmp/fine/1_0.png
  90. BIN
      tmp/fine/1_1.png
  91. BIN
      tmp/fine/1_2.png
  92. BIN
      tmp/fine/1_3.png
  93. BIN
      tmp/fine/1_4.png
  94. BIN
      tmp/fine/1_5.png
  95. BIN
      tmp/fine/1_6.png
  96. BIN
      tmp/fine/1_7.png
  97. BIN
      tmp/fine/1_8.png
  98. BIN
      tmp/fine/1_9.png
  99. BIN
      tmp/fine/img.png
  100. BIN
      tmp/image.png
  101. Some files were not shown because too many files have changed in this diff Show More

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 MiB

After

Width:  |  Height:  |  Size: 1.8 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

@ -73,14 +73,18 @@ public class Controller {
tmp.mkdir();
}
String song = getSongTitle(img);
int cool = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(790,242,118,26)),new File(tmp,"cool"));
int fine = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,274,118,26)),new File(tmp,"fine"));
int safe = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,308,118,26)),new File(tmp,"safe"));
int sad = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,341,118,26)),new File(tmp,"sad"));
int worst = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,372,118,26)),new File(tmp,"worst"));
float percent = DemoApplication.typeface2.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(986,154,122,31)),new File(tmp,"percent"))/100f;
boolean fail = textFailPixel(ImageUtils.cropImage(img, new Rectangle(514,171,1,1)));
int cool = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(790,242,118,26)),new File(tmp,"cool"),false);
int fine = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,274,118,26)),new File(tmp,"fine"),false);
int safe = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,308,118,26)),new File(tmp,"safe"),false);
int sad = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,341,118,26)),new File(tmp,"sad"),false);
int worst = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,372,118,26)),new File(tmp,"worst"),false);
int combo = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(926,405,122,24)),new File(tmp,"combo"),false);
int score = DemoApplication.typeface3.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(808,537,237,36)),new File(tmp,"score"),false);
float percent = DemoApplication.typeface2.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(986,154,122,31)),new File(tmp,"percent"),false)/100f;
boolean fail = Controller.textFailPixel(ImageUtils.cropImage(img, new Rectangle(514,171,1,1)));
String difficulty = Controller.GetDifficulty(ImageUtils.cropImage(img,new Rectangle(580,94,1,1)));
String getMod = Controller.GetMod(ImageUtils.cropImage(img,new Rectangle(993,70,105,54))); //"","HS","HD","SD"
ImageIO.write(img,"png",new File("tmp/image.png"));
data.put("songname",song);
data.put("cool",Integer.toString(cool));
@ -90,6 +94,10 @@ public class Controller {
data.put("worst",Integer.toString(worst));
data.put("percent",Float.toString(percent));
data.put("fail",Boolean.toString(fail));
data.put("difficulty",difficulty);
data.put("combo",Integer.toString(combo));
data.put("gameScore",Integer.toString(score));
data.put("mod",getMod);
} catch (IOException e) {
e.printStackTrace();
}
@ -107,7 +115,7 @@ public class Controller {
for (int x=0;x<8;x++) {
Color p2 = song.data[(y*8)+x];
Color p1 = new Color(img.getRGB(x+352, y+288));
matching+=Math.sqrt(Math.pow(p2.getRed()-p1.getRed(), 2)+Math.pow(p2.getGreen()-p1.getGreen(), 2)+Math.pow(p2.getBlue()-p1.getBlue(), 2));
matching+=ImageUtils.distanceToColor(p2,p1);
}
}
if (matching<lowestMatching) {
@ -148,4 +156,50 @@ public class Controller {
}
}
public static String GetDifficulty(BufferedImage img) {
final int TOLERANCE = 30;
Color p1 = new Color(169,13,236);
Color p2 = new Color(img.getRGB(0, 0));
if (ImageUtils.distanceToColor(p1, p2)<TOLERANCE) {
return "EXEX";
}
p1 = new Color(253,14,81);
if (ImageUtils.distanceToColor(p1, p2)<TOLERANCE) {
return "EX";
}
p1 = new Color(251,191,0);
if (ImageUtils.distanceToColor(p1, p2)<TOLERANCE) {
return "H";
}
p1 = new Color(20,234,0);
if (ImageUtils.distanceToColor(p1, p2)<TOLERANCE) {
return "N";
}
p1 = new Color(95,243,255);
if (ImageUtils.distanceToColor(p1, p2)<TOLERANCE) {
return "E";
}
return null;
}
public static String GetMod(BufferedImage img) {
final int TOLERANCE = 30;
Color hs = new Color(176,51,55);
Color hd = new Color(201,179,31);
Color sd = new Color(67,144,174);
Color p_hs = new Color(img.getRGB(22, 8));
Color p_hd = new Color(img.getRGB(51, 28));
Color p_sd = new Color(img.getRGB(81, 8));
if (ImageUtils.distanceToColor(p_hs, hs)<TOLERANCE) {
return "HS";
}
if (ImageUtils.distanceToColor(p_hd, hd)<TOLERANCE) {
return "HD";
}
if (ImageUtils.distanceToColor(p_sd, sd)<TOLERANCE) {
return "SD";
}
return "";
}
}

@ -26,6 +26,7 @@ public class DemoApplication {
public static List<SongData> songs = new ArrayList<SongData>();
public static TypeFace typeface1;
public static TypeFace typeface2;
public static TypeFace typeface3;
static Integer totalConfidence = 0;
static TestResult result = null;
static Integer[]controls = new Integer[]{150, 255, 153, 255, 159, 255, 0, 159, 3, 171, 8, 155};
@ -71,6 +72,7 @@ public class DemoApplication {
img1 = ImageUtils.toCompatibleImage(ImageIO.read(new File("typeface1.png")));
img2 = ImageUtils.toCompatibleImage(ImageIO.read(new File("typeface2.png")));
typeface1 = new TypeFace(img1);
typeface3 = new TypeFace(img1);
typeface2 = new TypeFace(img2);
typeface2.green_minthreshold=typeface2.blue_minthreshold=100;
typeface2.green_maxthreshold=typeface2.blue_maxthreshold=200;
@ -83,32 +85,38 @@ public class DemoApplication {
for (String s : str) {
songs.add(new SongData(s));
}
RunTest("16 -out of the gravity-.jpg",554,45,1,0,1,101.36f,false,"EX","HS",339,606780);
RunTest("*ハロー、プラネット。 (I.M.PLSE-EDIT).jpg",336,128,24,6,93,58.85f,true,"EX","",52,308760);
RunTest("*ハロー、プラネット。 (I.M.PLSE-EDIT).jpg",336,128,24,6,93,58.85f,true);
RunTest("16 -out of the gravity-.jpg",554,45,1,0,1,101.36f,false);
RunTest("39.jpg",531,71,2,0,2,97.82f,false);
RunTest("39みゅーじっく!.jpg",573,175,5,0,18,91.22f,false);
RunTest("1925.jpg",510,115,14,7,22,77.79f,false);
RunTest("ACUTE.jpg",478,64,1,1,5,95.76f,false);
RunTest("AFTER BURNER.jpg",370,113,25,16,30,68.76f,true);
RunTest("Blackjack.jpg",415,123,15,7,50,71.22f,false);
RunTest("Catch the Wave.jpg",603,72,0,0,1,100.65f,false);
RunTest("Dear.jpg",402,64,0,0,1,100.90f,false);
RunTest("DECORATOR.jpg",436,100,1,0,6,93.52f,false);
RunTest("Fire◎Flower.jpg",86.79f,false);
RunTest("DYE.jpg",530,106,7,2,13,84.77f,false);
RunTest("erase or zero.jpg",442,70,0,0,2,100.12f,false);
RunTest("FREELY TOMORROW.jpg",367,57,0,0,0,102.84f,false);
RunTest("from Y to Y.jpg",350,49,6,1,8,86.35f,false);
RunTest("Glory 3usi9.jpg",468,43,0,0,2,101.62f,false);
RunTest("Hand in Hand.jpg",401,54,1,0,3,97.58f,false);
RunTest("Hello, Worker.jpg",439,118,7,1,14,89.93f,false);
RunTest("Just Be Friends.jpg",510,107,6,0,12,89.38f,false);
RunTest("Knife.jpg",327,85,14,9,27,51.96f,true);
RunTest("LIKE THE WIND.jpg",330,144,20,9,20,72.06f,false);
RunTest("LOL -lots of laugh-.jpg",489,59,1,2,2,96.36f,false);
RunTest("magnet.jpg",435,101,18,4,35,76.98f,false);
RunTest("No Logic.jpg",491,101,11,5,15,86.32f,false);
RunTest("39.jpg",531,71,2,0,2,97.82f,false,"EXEX","HS",324,832390);
RunTest("39みゅーじっく!.jpg",573,175,5,0,18,91.22f,false,"EX","HS",354,754140);
RunTest("1925.jpg",510,115,14,7,22,77.79f,false,"EX","HS",85,564860);
RunTest("ACUTE.jpg",478,64,1,1,5,95.76f,false,"EX","HS",197,505210);
RunTest("AFTER BURNER.jpg",370,113,25,16,30,68.76f,true,"EX","HS",94,386390);
RunTest("Blackjack.jpg",415,123,15,7,50,71.22f,false,"EX","HS",79,443260);
RunTest("Catch the Wave.jpg",603,72,0,0,1,100.65f,false,"EX","HS",559,773570);
RunTest("Dear.jpg",402,64,0,0,1,100.90f,false,"EXEX","HS",394,587740);
RunTest("DECORATOR.jpg",436,100,1,0,6,93.52f,false,"EX","HS",217,560180);
RunTest("Fire◎Flower.jpg",86.79f,false,"EXEX","HS");
RunTest("DYE.jpg",530,106,7,2,13,84.77f,false,"EX","HS",143,486360);
RunTest("erase or zero.jpg",442,70,0,0,2,100.12f,false,"EX","HS",265,731120);
RunTest("FREELY TOMORROW.jpg",367,57,0,0,0,102.84f,false,"EX","HS",424,498640);
RunTest("from Y to Y.jpg",350,49,6,1,8,86.35f,false,"EXEX","HS",139,427650);
RunTest("Glory 3usi9.jpg",468,43,0,0,2,101.62f,false,"EX","HS",382,549780);
RunTest("Hand in Hand.jpg",401,54,1,0,3,97.58f,false,"EX","HS",176,610040);
RunTest("Hello, Worker.jpg",439,118,7,1,14,89.93f,false,"EXEX","HS",147,930290);
RunTest("Just Be Friends.jpg",510,107,6,0,12,89.38f,false,"EXEX","HS",203,602080);
RunTest("Knife.jpg",327,85,14,9,27,51.96f,true,"EX","HS",124,395170);
RunTest("LIKE THE WIND.jpg",330,144,20,9,20,72.06f,false,"EX","HS",65,425970);
RunTest("LOL -lots of laugh-.jpg",489,59,1,2,2,96.36f,false,"EX","HS",183,641920);
RunTest("magnet.jpg",435,101,18,4,35,76.98f,false,"EXEX","HS",115,480540);
RunTest("No Logic.jpg",491,101,11,5,15,86.32f,false,"EX","HS",186,476910);
RunTest("Nostalogic.jpg",346,70,15,7,16,83.61f,false,"EX","HS",94,486030);
RunTest("WORLD'S END UMBRELLA.jpg",437,136,6,1,3,90.59f,false,"H","",215,475120);
RunTest("ぽっぴっぽー.jpg",350,46,7,6,3,80.39f,false,"N","",175,263630);
RunTest("サマーアイドル.jpg",245,19,4,0,2,87.04f,false,"E","",103,179360);
RunTest("ジターバグ_2.jpg","ジターバグ",0,0,0,0,159,0.00f,true,"EX","SD",0,0);
RunTest("大江戸ジュリアナイト_2.jpg","大江戸ジュリアナイト",0,0,0,0,79,0.08f,true,"EX","HD",0,580);
System.out.println("All Tests passed!");
}
@ -146,7 +154,8 @@ public class DemoApplication {
}
}
static void RunTest(String _img,float _percent,boolean _fail) {
static void RunTest(String _img,float _percent,boolean _fail,String _difficulty,String _mod) {
System.out.println("Running test "+_img);
long startTime = System.currentTimeMillis();
String testdir="resources";
Point offset = new Point(418,204);
@ -166,9 +175,11 @@ public class DemoApplication {
} catch (IOException e) {
e.printStackTrace();
}
String song = Controller.getSongTitle(img);
float percent = DemoApplication.typeface2.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(986,154,122,31)),new File(tmp,"percent"),false)/100f;
String song = Controller.getSongTitle(img);
boolean fail = Controller.textFailPixel(ImageUtils.cropImage(img, new Rectangle(514,171,1,1)));
String difficulty = Controller.GetDifficulty(ImageUtils.cropImage(img,new Rectangle(580,94,1,1)));
String getMod = Controller.GetMod(ImageUtils.cropImage(img,new Rectangle(993,70,105,54))); //"","HS","HD","SD"
String _name = _img.replace(".jpg","");
song = (song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":song;
@ -177,11 +188,14 @@ public class DemoApplication {
Assert.isTrue(song.equalsIgnoreCase(_name),"Expected song name to be "+_name+", got "+song);
Assert.isTrue(percent == _percent,"Expected percent to be "+_percent+", got "+percent);
Assert.isTrue(fail == _fail,"Expected fail to be "+_fail+", got "+fail);
Assert.isTrue(difficulty.equalsIgnoreCase(_difficulty),"Expected difficulty to be "+_difficulty+", got "+difficulty);
Assert.isTrue(_mod.equalsIgnoreCase(getMod),"Expected mod to be "+_mod+", got "+getMod);
System.out.println(" Passed ("+(System.currentTimeMillis()-startTime)+"ms)!");
}
static void RunTest(String _img,int _cool,int _fine, int _safe, int _sad, int _worst, float _percent,boolean _fail) {
//System.out.println("Running test "+_img);
static void RunTest(String _img,String _song,int _cool,int _fine, int _safe, int _sad, int _worst, float _percent,boolean _fail,String _difficulty,String _mod
,int _combo,int _score) {
System.out.println("Running test "+_img);
long startTime = System.currentTimeMillis();
String testdir="resources";
Point offset = new Point(418,204);
@ -207,22 +221,34 @@ public class DemoApplication {
int safe = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,308,118,26)),new File(tmp,"safe"),false);
int sad = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,341,118,26)),new File(tmp,"sad"),false);
int worst = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(792,372,118,26)),new File(tmp,"worst"),false);
int combo = DemoApplication.typeface1.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(926,405,122,24)),new File(tmp,"combo"),false);
int score = DemoApplication.typeface3.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(808,537,237,36)),new File(tmp,"score"),false);
float percent = DemoApplication.typeface2.extractNumbersFromImage(ImageUtils.cropImage(img,new Rectangle(986,154,122,31)),new File(tmp,"percent"),false)/100f;
boolean fail = Controller.textFailPixel(ImageUtils.cropImage(img, new Rectangle(514,171,1,1)));
String difficulty = Controller.GetDifficulty(ImageUtils.cropImage(img,new Rectangle(580,94,1,1)));
String getMod = Controller.GetMod(ImageUtils.cropImage(img,new Rectangle(993,70,105,54))); //"","HS","HD","SD"
String _name = _img.replace(".jpg","");
song = (song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":song;
_name = (_name.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(_name.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":_name;
_song = (_song.equalsIgnoreCase("PIANOGIRL"))?"PIANO*GIRL":(_song.equalsIgnoreCase("16 -out of the gravity-"))?"1/6 -out of the gravity-":_song;
Assert.isTrue(song.equalsIgnoreCase(_name),"Expected song name to be "+_name+", got "+song);
Assert.isTrue(song.equalsIgnoreCase(_song),"Expected song name to be "+_song+", got "+song);
Assert.isTrue(cool == _cool,"Expected cool count to be "+_cool+", got "+cool);
Assert.isTrue(fine == _fine,"Expected fine count to be "+_fine+", got "+fine);
Assert.isTrue(safe == _safe,"Expected safe count to be "+_safe+", got "+safe);
Assert.isTrue(sad == _sad,"Expected sad count to be "+_sad+", got "+sad);
Assert.isTrue(worst == _worst,"Expected worst count to be "+_worst+", got "+worst);
Assert.isTrue(percent == _percent,"Expected percent to be "+_percent+", got "+percent);
Assert.isTrue(combo == _combo,"Expected combo to be "+_combo+", got "+combo);
Assert.isTrue(score == _score,"Expected score to be "+_score+", got "+score);
Assert.isTrue(fail == _fail,"Expected fail to be "+_fail+", got "+fail);
Assert.isTrue(difficulty.equalsIgnoreCase(_difficulty),"Expected difficulty to be "+_difficulty+", got "+difficulty);
Assert.isTrue(_mod.equalsIgnoreCase(getMod),"Expected mod to be "+_mod+", got "+getMod);
System.out.println(" Passed ("+(System.currentTimeMillis()-startTime)+"ms)!");
}
static void RunTest(String _img,int _cool,int _fine, int _safe, int _sad, int _worst, float _percent,boolean _fail,String _difficulty,String _mod
,int _combo, int _score) {
RunTest(_img,_img.replace(".jpg",""),_cool,_fine,_safe,_sad,_worst,_percent,_fail,_difficulty,_mod,_combo,_score);
}
}

@ -13,6 +13,8 @@ import java.util.List;
import javax.imageio.ImageIO;
import com.example.demo.DemoApplication;
import sig.utils.FileUtils;
import sig.utils.ImageUtils;
@ -57,6 +59,15 @@ public class TypeFace {
for (int x=0;x<img.getWidth();x++) {
for (int y=0;y<img.getHeight();y++) {
Color currentCol = new Color(img.getRGB(x, y));
if (this.equals(DemoApplication.typeface3)) {
if ((currentCol.getRed()>=0 && currentCol.getRed()<=50
&& currentCol.getGreen()>=0 && currentCol.getGreen()<=100
&& currentCol.getBlue()>=0 && currentCol.getBlue()<=120)) {
img.setRGB(x, y, new Color(8,114,140).getRGB());
} else {
img.setRGB(x, y, Color.WHITE.getRGB());
}
} else
if ((currentCol.getRed()>=0 && currentCol.getRed()<=100
&& currentCol.getGreen()>=0 && currentCol.getGreen()<=150
&& currentCol.getBlue()>=0 && currentCol.getBlue()<=150) ||
@ -153,7 +164,7 @@ public class TypeFace {
break;
}
X+=i.maxX;
if (numberImg.getHeight()<10 || numberImg.getWidth()<2) {
if (numberImg.getHeight()<10 || numberImg.getWidth()<4) {
//A number should be at least 10 pixels high...This is not satisfactory.
state=4;
break;

@ -1,5 +1,6 @@
package sig.utils;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.GraphicsConfiguration;
import java.awt.GraphicsEnvironment;
@ -87,4 +88,7 @@ public class ImageUtils {
// Return the buffered image
return bimage;
}
public static double distanceToColor(Color p2, Color p1) {
return Math.sqrt(Math.pow(p2.getRed()-p1.getRed(), 2)+Math.pow(p2.getGreen()-p1.getGreen(), 2)+Math.pow(p2.getBlue()-p1.getBlue(), 2));
}
}

BIN
temp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 208 KiB

After

Width:  |  Height:  |  Size: 207 KiB

@ -0,0 +1,10 @@
1:0.751953125
2:0.068359375
3:0.9765625
4:0.037109375
5:0.0810546875
6:0.056640625
7:0.0078125
8:0.05078125
9:0.052734375
0:0.072265625

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 136 B

@ -1,10 +1,10 @@
1:0.7578125
1:0.984375
2:0.0078125
3:0.00390625
4:0.044921875
5:0.0185546875
6:0.2919921875
6:0.7587890625
7:0.00390625
8:0.34375
8:0.85546875
9:0.015625
0:1.0
0:0.3671875

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 105 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 B

@ -0,0 +1,10 @@
1:0.755859375
2:0.005859375
3:0.005859375
4:0.06640625
5:0.861328125
6:0.056640625
7:0.001953125
8:0.056640625
9:0.677734375
0:0.08203125

Binary file not shown.

After

Width:  |  Height:  |  Size: 130 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 127 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

@ -1,10 +1,10 @@
1:0.505859375
2:0.005859375
3:0.005859375
4:0.84765625
5:0.2333984375
6:0.048828125
7:0.001953125
8:0.048828125
9:0.2197265625
0:0.06640625
1:0.751953125
2:0.052734375
3:1.0
4:0.041015625
5:0.0732421875
6:0.041015625
7:0.0078125
8:0.03515625
9:0.044921875
0:0.056640625

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 B

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

After

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 129 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 B

After

Width:  |  Height:  |  Size: 125 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 B

After

Width:  |  Height:  |  Size: 135 B

@ -1,10 +1,10 @@
1:0.80078125
2:0.0078125
3:0.00390625
4:0.044921875
5:0.73828125
6:0.068359375
7:0.00390625
8:0.068359375
9:0.822265625
0:0.09375
1:0.46875
2:0.03515625
3:0.169921875
4:0.037109375
5:0.0517578125
6:0.0234375
7:0.8984375
8:0.0234375
9:0.044921875
0:0.03125

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 114 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 111 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 119 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 B

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 140 B

After

Width:  |  Height:  |  Size: 117 B

@ -1,10 +1,10 @@
1:0.751953125
2:0.068359375
3:0.9765625
4:0.037109375
5:0.0810546875
6:0.056640625
7:0.0078125
8:0.05078125
9:0.052734375
0:0.072265625
1:0.748046875
2:0.0078125
3:0.00390625
4:0.044921875
5:0.861328125
6:0.068359375
7:0.00390625
8:0.068359375
9:0.681640625
0:0.09375

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 127 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 132 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 B

After

Width:  |  Height:  |  Size: 131 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 B

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 221 B

@ -1,10 +1,10 @@
1:0.46484375
2:0.03515625
3:0.169921875
4:0.037109375
5:0.0517578125
6:0.0234375
7:0.90234375
8:0.0234375
9:0.044921875
0:0.03125
1:0.76171875
2:0.0078125
3:0.00390625
4:0.044921875
5:0.857421875
6:0.068359375
7:0.00390625
8:0.068359375
9:0.677734375
0:0.09375

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 B

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

After

Width:  |  Height:  |  Size: 124 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 121 B

After

Width:  |  Height:  |  Size: 134 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 B

After

Width:  |  Height:  |  Size: 121 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 B

After

Width:  |  Height:  |  Size: 123 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 B

After

Width:  |  Height:  |  Size: 149 B

@ -1,4 +1,4 @@
1:0.748046875
1:0.740234375
2:0.0078125
3:0.00390625
4:0.04296875
@ -6,5 +6,5 @@
6:0.064453125
7:0.00390625
8:0.064453125
9:0.677734375
9:0.681640625
0:0.08984375

Binary file not shown.

Before

Width:  |  Height:  |  Size: 131 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 138 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 141 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

After

Width:  |  Height:  |  Size: 140 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 150 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 B

After

Width:  |  Height:  |  Size: 136 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 B

After

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 198 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.7 MiB

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save