Following were the errors in the digits_video.py
1 ) The code was not working because data type of x was float however in "cv2.rectangle" we require integer .
2 ) After pressing the "esc" button the image windows did not destroy
So I amended following things:
1 ) ~converted data type of x to int.~ Used Python integer division (//)
2 ) used cv2.destroyAllWindows() to close all windows after the press of "esc" by user.
This makes arguments of type InputOutputArray required in python unless they
have a default value in C++.
As result following python functions changes signatures in non-trivial way:
* calcOpticalFlowFarneback
* calcOpticalFlowPyrLK
* calibrateCamera
* findContours
* findTransformECC
* floodFill
* kmeans
* PCACompute
* stereoCalibrate
And the following functions become return their modified inputs as a return
value:
* accumulate
* accumulateProduct
* accumulateSquare
* accumulateWeighted
* circle
* completeSymm
* cornerSubPix
* drawChessboardCorners
* drawContours
* drawDataMatrixCodes
* ellipse
* fillConvexPoly
* fillPoly
* filterSpeckles
* grabCut
* insertChannel
* line
* patchNaNs
* polylines
* randn
* randShuffle
* randu
* rectangle
* setIdentity
* updateMotionHistory
* validateDisparity
* watershed