OpenCV binarization test : threshold, adaptive threshold, otzu



< gist >

< /gist >



And refer to below site :
Otzu :
http://cvlecture.marearts.com/2017/04/opencv-lecture-5-4-otzu.html

adaptive threshold :
http://cvlecture.marearts.com/2017/04/opencv-lecture-5-3-adaptivethreshold.html

threshold :
http://cvlecture.marearts.com/2017/04/opencv-lecture-5-3-adaptivethreshold.html

OpenCV Background subtraction 3.2 version example (for MOG, MOG2, GMG, KNN)

This is example for background subtraction on opencv 3.2 version

previously, I post 2.7 version example on here.
http://study.marearts.com/2014/04/opencv-study-background-subtractor-mog.html

But some usage is changed, and knn subtraction method is added.

Many people ask that example based on opencv 3.2

refer to below source code

Thank you.

< gist code >

< /gist code >


floodFill opencv function example

floodFill function example


< gist >

< /gist >






#tags
CallBackFunc, EVENT_LBUTTONDOWN, setMouseCallback, rectangle, floodFill,

video show and write keeping original fps


When the video write, we can set parameter in following function..

outVideo.open(".\\outVideo.avi", askFileTypeBox, capture.get(CV_CAP_PROP_FPS), S, Color);

And we can control play speed by waitKey.

double fps = capture.get(CV_CAP_PROP_FPS);
delay Per Second = 1/fps
in milliseconds = 1/fps * 1000

so we delay, waitKey( 1/fps * 1000 )

by the way, it is not exact fps. because it is delayed including other processing in the loop.
for example, data copy, sobel, imshow ...

< gist code >

< /gist code >




#tags

CV_CAP_PROP_FRAME_WIDTH, CV_CAP_PROP_FRAME_HEIGHT, VideoCapture, VideoWriter, waitKey

Otzu binary simple example


< gist code >

< /gist code >




#Tags
AdaptiveThreshold, Threshold, OTZU, GaussianBlur