Source Code for Shape Recovery of Endoscopic Videos by Shape from Shading Using Mesh Regularization
OpenCV Version:2.4.11
This is my very first project that I worked on during my junior Year. So here is my applogy if the code is not neat for you. The project aims to recover 3D surfaces from endoscopic videos using the simple Shape from Shading method. The raw results from Shape from Shading are noisy and unacceptable. We propose to utilize mesh regularizations to boost the Shape from Shading results. We also use OpenGL
to visualize the final 3D reconstruction results, where we can change view angles and zoom in&out.
- Make sure you have OpenCV and OpenGL environments set up.
- We utilized Matlab Engine for bilinear regression via sparse matrices. So make sure you set up Matlab engine as well.
- If you have trouble extracting required data points, you can download here. (rowpoints,testpoints)
Since this is my first project, I did not have much experience in coding. I manually assigned several property parameters, such as the resolution of the video, and the number of frames. So you may need to change those parameters accoding to different videos.
In main.cpp
:
- The texture container variable declaration.
- The
for
loop inRead3DPoints()
.
In Viewer.cpp
:
- The texture container variable declaration in
MyDisplay()
. - The texture container variable declaration in
Texinit()
.
In Viewer.h
:
- The number of frames,
N
.
In Draw.cpp
:
- The denominator in
DrawTriangles(int n)
should bemax(width,height)
.
For further questions, feel free to contact me at albuspeter.rzh@gmail.com
.
If you find this useful in your research, please cite our paper "Shape Recovery of Endoscopic Videos by Shape from Shading Using Mesh Regularization" (PDF):
@inproceedings{ren2017shape,
title={Shape Recovery of Endoscopic Videos by Shape from Shading Using Mesh Regularization},
author={Ren, Zhihang and He, Tong and Peng, Lingbing and Liu, Shuaicheng and Zhu, Shuyuan and Zeng, Bing},
booktitle={International Conference on Image and Graphics},
pages={204--213},
year={2017},
organization={Springer}
}