answered 2017-02-07 06:27:00 -0600
check image size :
cout<<img.size();
and don't forget
waitKey(0);
updated 2017-02-07 06:27:43 -0600
and don't forget after imshow()