Skip to content

Instantly share code, notes, and snippets.

View zhangzhensong's full-sized avatar

Jason zhangzhensong

View GitHub Profile

Probably the most straight forward way to start generating Point Clouds from a set of pictures.

VisualSFM is a GUI application for 3D reconstruction using structure from motion (SFM). The reconstruction system integrates several of my previous projects: SIFT on GPU(SiftGPU), Multicore Bundle Adjustment, and Towards Linear-time Incremental Structure from Motion. VisualSFM runs fast by exploiting multicore parallelism for feature detection, feature matching, and bundle adjustment.

For dense reconstruction, this program supports Yasutaka Furukawa's PMVS/CMVS tool chain, and can prepare data for Michal Jancosek's CMP-MVS. In addition, the output of VisualSFM is natively supported by Mathias Rothermel and Konrad Wenzel's [SURE]

@zhangzhensong
zhangzhensong / cvgltexture.cpp
Last active October 11, 2022 20:52
Converting OpenCV Mat to OpenGL texture
// don't forget to include related head files
void BindCVMat2GLTexture(cv::Mat& image, GLuint& imageTexture)
{
if(image.empty()){
std::cout << "image empty" << std::endl;
}else{
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glGenTextures(1, &imageTexture1);
glBindTexture(GL_TEXTURE_2D, imageTexture1);
@zhangzhensong
zhangzhensong / meanvaluecoordinates.cpp
Last active August 29, 2015 14:17
mean value coordinates
#include <Eigen/Dense>
typedef Vector2d v2d;
int mean_value_coordinates( const vector<v2d> &cageCoords, const v2d &queryCoord, vector<double> &baryCoords)
{
//////////////////////////////////////////////////////////////////////////////////
// Input :
// 1. polyCoords : Coordinates of closed polygon in the Counter
// clockwise direction. The input is not tested inside.
//