LaneDetection

From BITPlan Wiki
Revision as of 08:11, 14 March 2020 by Wf (talk | contribs)
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

Show7141511869219163446.jpg Show6147902249785399207.jpg

 @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); 
    }
  }