LaneDetection
Jump to navigation
Jump to search
Click here to comment see Self Driving RC Car
see https://github.com/naokishibuya/car-finding-lane-lines
Color Filter
@Test
public void testColorFilter() throws Exception {
ColorFilter cf=new ColorFilter();
cf.setMinColorRGB( 65, 85, 85);
cf.setMaxColorRGB(140, 140, 140);
Mat frame = getTestImage();
Mat gray=new Mat();
Imgproc.cvtColor(frame, gray, Imgproc.COLOR_BGR2GRAY);
assertEquals(2458261,Core.countNonZero(gray));
Mat colorFiltered = cf.filter(frame);
assertEquals(colorFiltered.width(), frame.width());
Mat cfGray=new Mat();
Imgproc.cvtColor(colorFiltered, cfGray, Imgproc.COLOR_BGR2GRAY);
assertEquals(173768,Core.countNonZero(cfGray));
if (show) {
ImageUtils.show(getTestImage());
ImageUtils.show(gray);
ImageUtils.show(colorFiltered);
}
}