Source code
-----------
-
+ @add_toggle_cpp
You can [download this from here
-](https://github.com/opencv/opencv/tree/3.4/samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp) or find it in the
+](https://github.com/opencv/opencv/tree/master/samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp) or find it in the
`samples/cpp/tutorial_code/core/file_input_output/file_input_output.cpp` of the OpenCV source code
library.
Here's a sample code of how to achieve all the stuff enumerated at the goal list.
@include cpp/tutorial_code/core/file_input_output/file_input_output.cpp
-](https://github.com/opencv/opencv/tree/3.4/samples/python/tutorial_code/core/file_input_output/file_input_output.py) or find it in the
+ @end_toggle
+
+ @add_toggle_python
+ You can [download this from here
++](https://github.com/opencv/opencv/tree/master/samples/python/tutorial_code/core/file_input_output/file_input_output.py) or find it in the
+ `samples/python/tutorial_code/core/file_input_output/file_input_output.py` of the OpenCV source code
+ library.
+
+ Here's a sample code of how to achieve all the stuff enumerated at the goal list.
+
+ @include python/tutorial_code/core/file_input_output/file_input_output.py
+ @end_toggle
Explanation
-----------
@include samples/python/tutorial_code/video/meanshift/meanshift.py
@end_toggle
- [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/video/meanshift/MeanshiftDemo.java)
+ @add_toggle_java
+ - **Downloadable code**: Click
++ [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/video/meanshift/MeanshiftDemo.java)
+
+ - **Code at glance:**
+ @include samples/java/tutorial_code/video/meanshift/MeanshiftDemo.java
+ @end_toggle
+
Three frames in a video I used is given below:
![image](images/meanshift_result.jpg)
@include samples/python/tutorial_code/video/meanshift/camshift.py
@end_toggle
- [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/video/meanshift/CamshiftDemo.java)
+ @add_toggle_java
+ - **Downloadable code**: Click
++ [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/video/meanshift/CamshiftDemo.java)
+
+ - **Code at glance:**
+ @include samples/java/tutorial_code/video/meanshift/CamshiftDemo.java
+ @end_toggle
+
Three frames of the result is shown below:
![image](images/camshift_result.jpg)
@include samples/python/tutorial_code/video/optical_flow/optical_flow.py
@end_toggle
- [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/video/optical_flow/OpticalFlowDemo.java)
+
+ @add_toggle_java
+ - **Downloadable code**: Click
++ [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/video/optical_flow/OpticalFlowDemo.java)
+
+ - **Code at glance:**
+ @include samples/java/tutorial_code/video/optical_flow/OpticalFlowDemo.java
+ @end_toggle
+
(This code doesn't check how correct are the next keypoints. So even if any feature point disappears
in image, there is a chance that optical flow finds the next point which may look close to it. So
actually for a robust tracking, corner points should be detected in particular intervals. OpenCV
@end_toggle
- [here](https://github.com/opencv/opencv/tree/3.4/samples/java/tutorial_code/video/optical_flow/OpticalFlowDenseDemo.java)
+ @add_toggle_java
+ - **Downloadable code**: Click
++ [here](https://github.com/opencv/opencv/tree/master/samples/java/tutorial_code/video/optical_flow/OpticalFlowDenseDemo.java)
+
+ - **Code at glance:**
+ @include samples/java/tutorial_code/video/optical_flow/OpticalFlowDenseDemo.java
+ @end_toggle
+
+
See the result below:
![image](images/opticalfb.jpg)