Skip to content

Instantly share code, notes, and snippets.

View cashiwamochi's full-sized avatar
🐢
Debug -Stay Night-

cashiwamochi cashiwamochi

🐢
Debug -Stay Night-
View GitHub Profile
@cashiwamochi
cashiwamochi / ceres_cost_function.hpp
Created November 16, 2017 07:01
CeresSolverでH行列を計算する.トライアンギュレーションする.
#include <cmath>
#include "ceres/ceres.h"
#include "glog/logging.h"
#include <opencv2/opencv.hpp>
using namespace std;
using ceres::AutoDiffCostFunction;
@cashiwamochi
cashiwamochi / epipolar_keypoints_match.hpp
Last active August 13, 2024 09:04
This function is used to do feature points matching based on epipolar-line search. It does also ratio-cross-check-test.
#include <iostream>
#include <vector>
#include <cmath>
#include <opencv2/opencv.hpp>
using namespace std;
template <typename T>
static float distancePointLine(const cv::Point_<T> point, const cv::Vec<T,3>& line)
@cashiwamochi
cashiwamochi / CMakeListsForSimpleTriangulation.txt
Created September 10, 2017 15:06
CMakeLists for simple_triangulation.cc. (I THINK THAT)PCL viewer is available only if you compiled PCL with pcl_visualization module. In order to do it, i need to build and install VTK8.
# minimum version of CMake
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(triangulation)
set(CMAKE_CXX_COMPILER g++)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMake")
@cashiwamochi
cashiwamochi / simple_triangulation.cc
Last active September 16, 2023 14:19
This code is used for simple triangulation. It uses findEssentialMat, recoverPose, triangulatePoints in OpenCV. For viewer, PCL is used. You can watch 3D points and 2 camera poses. I checked alcatraz2.jpg and alcatraz1.jpg in pcv_data.zip (https://www.oreilly.co.jp/pub/9784873116075/). Perhaps there is something wrong ( actually it looks working…
#include <opencv2/opencv.hpp>
#include <pcl/common/common_headers.h>
#include <pcl/io/pcd_io.h>
#include <pcl/point_types.h>
#include <pcl/point_cloud.h>
#include <pcl/visualization/pcl_visualizer.h>
#include <Eigen/Core>
#include <Eigen/LU>
#include "singleImageCalibration.hpp"
int main(int argc, char* argv[])
{
if(argc != 2){
showUsage();
return -1;
}
string image_name = argv[1];
#include <iostream>
#include <opencv2/opencv.hpp>
#include <vector>
#include <string>
using namespace cv;
using namespace std;
void showUsage() {
cout << "this.out [image name]" << endl;