OpenCV is a library of programming functions mainly aimed at real-time computer vision.
NumPy is a library for the Python programming language, adding support for large, multi-dimensional arrays and matrices, along with a large collection of high-level mathematical functions to operate on these arrays.
Matplotlib is a plotting library for the Python programming language and its numerical mathematics extension NumPy.
Shallow Wave Tank
The wave tank I am using is long and narrow, which works just fine for this small project
** I am going to merge two of my projects together: CV on wave pattern and Mini Wave Tank Micro-controller. The reason for that is I am thinking about comparing data from these two systems and try to find some correlations. Next week I will talk more about what I am planning to compare.
So ... Here's an update on my Micro Controller Data Collection System:
(If you don't like hardware or circuits, don't worry, the project is still mainly about computer vision.)
Controller: Arduino UNO R3
1 Inverting Op-Amp circuit:
(I'm too lazy to add another power supply to the op-amp so I ended up using lots of resistors to produce the appropriate voltage)
1 Wave Probe
Sample Output (find my Python and Arduino programs in the Files section):
(I will keep updating my programs, adding more functions and simplifying the algorithm)
Week 2 of the project focuses on learning edge detection, optical motion detection, and the application of Kalman Filter on object tracking. Some of them are not necessarily related to this project but it's always good to learn more because someday these knowledge will come in handy :)
1. Application of Kalman Filter:
In this video you can see at least 9 times, the predicted position (using Kalman Filter) went far away from the actual position, this phenomenon actually shows the idea behind Kalman Filter - predicting the next move by looking at previous moves. This algorithm gives the predicted position 'inertia'. To improve this, we can use video with higher frame rates so this algorithm can have more information and more opportunities to correct itself.
2. Edge Detection (with Gaussian Blur treatment):
Canny algorithm is pretty good at separating larger objects and detecting their edges, like this lego man, however, when it comes to detecting the edge of tiny water patterns, Canny algorithm just isn't that good. (Canny often produces all black image when detecting water patterns.)
Sobel(along the horizontal axis):
Sobel algorithm did an OK job detecting the lego man and when it comes to wave patterns, this algorithm also provides us with some information rather than a black image (like what Canny often does).
Although it's very noisy but you can still see a ripple-like pattern (this specific algorithm includes Gaussian Blur treatment before the picture is processed for edge detection, which improves Sobel's result).
3. Dense Optical Flow (DOF) Motion Detection
Different from last week's colour based detection, DOF algorithm detects motion vectors of pixels and marks moving area with different colour. It is very useful when you have no control over the colour of the background and the object, but a stationary camera or background is necessary.
(In the second video, you can see when the mouse is gone, it became very noisy, that's because the algorithm starts picking up very tiny movement of pixels after the large moving object is gone.)
Conclusion & Lesson:
Canny is not the best algorithm at detecting small wave patterns, however, when the lighting and camera angle are perfect, you can pick up decent images like this one:
Gaussian Blur is not always good for edge detection depending on your choice of algorithm and environment.
So, the next step is to create a wave tank environment that's perfect for Canny algorithm to pick up wave patters.
Hello everyone, welcome to my first project log! I have been learning computer vision in the past week (I did't know anything about computer vision before this project) and tried different programs related to object tracking and feature detection. Most of the material and code can be found on OpenCV's website so if you happen to be interested in learning computer vision, that's a great place to start!
Here are some of the cool things I learned in the past week: (I will post some of the code to Github in the future so if you want to try them yourself but don't want to go through all the details and errors, stay tuned!)
1. Object tracking based on colour:
Colour separation using Python and OpenCV 4
CamShift object tracking using Python and OpenCV 4
2. Corner detection and feature matching:
ORB algorithm corner detection:
Feature matching using ORB algorithm:
(It matches similar features but not always what you want, as you can see in the third picture, this algorithm drew lots of connections from the original photo to the desk.)