Theory
Assignment1.pdf
Source Code (Netbeans)
Out1.jpt is for the first configuration and out2.jpg for the second provideed configuration.
It can be open in netBeans directly.
Or there is a main.cpp which can be compiled individually like any other openCV code
Code