The type list is not generic; it cannot be parameterized with arguments <matofpoint>
I am following samples that use the line …
List<MatOfPoint> contours = new ArrayList<MatOfPoint>();
Example …
List<MatOfPoint> contours = new ArrayList<MatOfPoint>();
Mat notused;
Imgproc.findContours(dilateImg,contours,notused,Imgproc.RETR_LIST,Imgproc.CHAIN_APPROX_SIMPLE);
for(MatOfPoint cont : contours)
The samples claim to be correct but, they in fact do not compile. What am I missing?
Actral code not running ....
vid.read(mat);
if (!mat.empty()){
Mat mono = new Mat();
Imgproc.cvtColor(mat, mat, Imgproc.COLOR_BGR2GRAY);
Mat blur = new Mat();
Imgproc.GaussianBlur(mono, blur, new Size(9, 9), 2, 2);
Mat thresh = new Mat();
Imgproc.threshold(blur, thresh, 0, 255, Imgproc.THRESH_BINARY_INV|Imgproc.THRESH_OTSU);
Mat erodeImg = new Mat();
Mat erode = new Mat();
Imgproc.erode(thresh, erodeImg, erode);
Mat dilateImg = new Mat();
Mat dilate = new Mat();
Imgproc.dilate(erodeImg, dilateImg, dilate);
List<MatOfPoint> contours = new ArrayList<MatOfPoint>(); // This line creates an error!