Fix canny segment fault (Bug #3978)

Avoid too large size cause std::vector::resize() failed.
Please refer to http://code.opencv.org/issues/3978.

check_regression=*anny*

here *3/2 scale should be appropriate; otherwise the vector grows too fast