Ask Your Question

zenty's profile - activity

2017-05-10 10:26:01 -0600 received badge  Supporter (source)
2017-05-10 10:26:00 -0600 received badge  Scholar (source)
2017-05-10 00:35:01 -0600 asked a question Rectangle Issues

So I am trying to draw rectangles from contours and then save them as an image but whenever i use Imgproc.rectangle() the resulting Mat always comes out empty, my code is basically just...

       private Mat rectOut = new Mat();
       for(MatOfPoint contour : contours){
        Rect rect = Imgproc.boundingRect(contour);
        Imgproc.rectangle(rectOut, rect.tl(), rect.br(), new Scalar(50,50,50));
       }

The rect seems to be fine and has the points I want but the result always leaves me with an Empty mat, does anyone know what I am doing wrong?