A sub in water is similar to the navigation of a quadcopter. Allot of work has been acomplished in the Quad comunity.
http://diydrones.com/ is a good source of info. Go to the DIY DRONES store page look at sensors and you will find this.
http://store.3drobotics.com/products/px4flow
Follow the link to the open source code on Github. There you will find all the code needed for the type of optic flow algorithm that you are looking for. The meat is at
https://github.com/PX4/Flow/blob/master/src/flow.c
Notice in this code they take the gyro and correct for body rotation. In my other post I mentioned the problem of 2 solutions to a set of x and y's. Look at how they handle this. The algorithm used may not be the best as it is getting a dense feature matrix from the camera in a quad app. As Jared mentioned your pool bottom is most likely going to give a sparse feature Matrix. Have you shared some of your pool bottom video? Could you post a link to some? People on this forum could help if they saw what you have to work with. This is all dealing with a captured digitized frame. To get really good results you may need to clean the image up optically first. A polarizing filter comes to mind but camera people have a whole arsenal of devices to play with optics. I don't know were to get a hold of this knowledge. Today every one wants to do the clean up digitally. It is not always the best way.
All this is not going to work if your sub platform is not stable. I mean rock solid stable. If the the sub is oscillating pitching and rolling the errors will accumulate real fast. How stable is this years sub? When it is accelerated do you get rotation? Physically the sub has to be rock solid and this comes from sound physical design. The mechanical team has to get this right or all your work will only lead to frustration.
Quaternion. You will have to learn how to work with rotations using them and as mention some of the best sensor fusion algorithms use extended state kalman filters. Allot of math to master. This is not easy but if you master it save it for your senior college project. Its at that level or high .