white black

master
yunx li 5 years ago
parent f7eb8822a5
commit f0c4b781bd

@ -98,7 +98,15 @@ public class CharsSegment {
case GREEN:
threshold(input_grey, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY_INV);
break;
case WHITE:
threshold(input_grey, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
break;
case BLACK:
threshold(input_grey, img_threshold, 10, 255, CV_THRESH_OTSU + CV_THRESH_BINARY);
break;
default:
return -3;
}
@ -141,7 +149,7 @@ public class CharsSegment {
}
}
if (vecRect.size() == 0) {
return -3;
return -3;//没有检测到
}
Vector<Rect> sortedRect = new Vector<Rect>();

@ -159,7 +159,11 @@ public class CoreFunc {
return PlateColor.YELLOW;
} else if (plateColorJudge(src, PlateColor.GREEN, adaptive_minsv) == true) {
return PlateColor.GREEN;
} else {
} else if(plateColorJudge(src, PlateColor.WHITE, adaptive_minsv) == true) {
return PlateColor.WHITE;
}else if(plateColorJudge(src, PlateColor.BLACK, adaptive_minsv) == true) {
return PlateColor.BLACK;
}else{
return PlateColor.UNKNOWN;
}
}

@ -11,6 +11,8 @@ public enum PlateColor {
BLUE("BLUE","蓝牌", 100, 130),
GREEN("GREEN","绿牌", 38, 100),
YELLOW("YELLOW","黄牌", 15, 40),
WHITE("WHITE","白牌",230,255),
BLACK("BLACK","黑牌",0,180),
UNKNOWN("UNKNOWN","未知", 0, 0);
public final String code;

Loading…
Cancel
Save