-2

Mat drawing = Mat::zeros( canny_output.size(), CV_8UC3 ); this is a part of code what this really does is making a object in Mat structure called drawing i don't really understand what is with Mat::Zeros please help me i am new to open cv and c++..

Shamane Siriwardhana
  • 3,951
  • 6
  • 33
  • 73

2 Answers2

3

It creates a Mat object filled with zeros (i.e a black image), that has the same size as canny_output, 8 bits depth and 3 channels.

For more information Mat::zeros

nmud
  • 175
  • 14
  • but my problem is in the opencv documentation it says mat objects doesn't only save the image as it is but it just store many information and with in that information it has the path(pointer) to the location which image is really stored ? – Shamane Siriwardhana Feb 18 '16 at 10:13
  • I don't understand what you mean here. You are just creating a new Mat object called drawing, and all its values are zeros. If you are confused by canny_output, Mat drawing doesn't share anything with it. – nmud Feb 18 '16 at 10:39
1

As it say in the official documentation : here.

This line create a Mat filled with zeros of the same size as your canny_ouput mat with type CV_8UC3.

For more explanation of the datatype : here

RossierFl
  • 78
  • 7