Getting a shape out of edges Canny algorithm
Hi there, i'm extracting an img from a file ( then i will be doing this from a capture ) and i'm using canny algorithms in order to get its edges. this works fine but i guess i'm stuck here because it doesn't seem obvious how to use this result:
i would like to get something like a shape that would fit the best way as possible the edge of the result. How would you do this?
for instance: getting the edges of a building, how would you actually get the rectangular shape out of it?
NB: cvtColor (image,imageGray,CV_BGR2GRAY); blur(imageGray,edge,Size(3,3)); Canny(edge,edge,edgeThresh,edgeThresh*3,3); Cedge = Scalar::all(0); // important image.copyTo(Cedge,edge);
i'm converting to Gray then processing the canny algorithm. Do you think rather converting to black&white would give better result?