add banchmark image alignment 2
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// Created by root on 8/5/21.
|
||||
//
|
||||
|
||||
#include <iostream>
|
||||
#include "cl_class.h"
|
||||
#include <opencv2/opencv.hpp>
|
||||
#include <opencv2/core.hpp>
|
||||
#include <opencv2/core/mat.hpp>
|
||||
#include <sparse_img_align_gpu.h>
|
||||
// Maximum number of corners.
|
||||
#define FAST_COUNT (1 << 18)
|
||||
|
||||
int main() {
|
||||
opencl gpu;
|
||||
gpu.make_kernel("compute_residual");
|
||||
cv::Mat img=cv::Mat(cv::Size(700, 500),CV_8UC1);
|
||||
gpu.write_buf(0,0,img);
|
||||
gpu.write_buf(0,1,img);
|
||||
cl_float3 pose[1]={0.0};
|
||||
gpu.write_buf(0,2,1,pose);
|
||||
gpu.write_buf(0,3,1,pose);
|
||||
cl_float3 f[300]={0};
|
||||
gpu.write_buf(0,4,300,f);
|
||||
cl_float2 px[300]={0};
|
||||
gpu.write_buf(0,5,300,px);
|
||||
float e[300]={0};
|
||||
gpu.write_buf(0,7,300,e);
|
||||
float H[300*9]={0};
|
||||
gpu.write_buf(0,8,9*300,H);
|
||||
cl_float3 J[300];
|
||||
gpu.write_buf(0,9,300,J);
|
||||
float chi2[300]={0.01};
|
||||
gpu.write_buf(0,10,300,chi2);
|
||||
for(int i=0;i<10;++i){
|
||||
vio::SparseImgAlignGpu img_align(4, 2,30, vio::SparseImgAlignGpu::GaussNewton, true,&gpu);
|
||||
img_align.run();
|
||||
}
|
||||
gpu.clear_buf();
|
||||
std::cerr<<"finished\n";
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user