Fixed bug in cv::detail::waveCorrect

The function cv::detail::waveCorrect makes wave correction of a stitched panorama.
Earlier it gave wrong results for panorama made from 1 frame.