当前位置:网站首页>Cmake project under vs2019: calculating binocular parallax using elas method
Cmake project under vs2019: calculating binocular parallax using elas method
2022-04-23 20:37:00 【Zhongai0049】
ELAS Method to calculate binocular parallax
Due to the need for high-precision binocular parallax algorithm , Found this algorithm , To prevent myself from forgetting , Put its use process , Specially recorded here . It would be better if it was helpful to everyone , Hey ..
ELAS By Andreas Geiger On 2010 A novel stereo matching algorithm proposed in , Its full name is 《Efficient Large Scale Stereo Matching》. The advantage of this algorithm is for high-resolution images , It can give consideration to high matching speed and matching accuracy , In many public data sets ELAS The average matching accuracy is very close to SGM, But faster than SGM faster .
ELAS The basic flow of the algorithm is :
(1) The left and right images are sobel wave filtering , Generate sobel Characteristics of figure ;
(2) be based on sobel Feature matching , Select the matching points with high confidence , As "support points", Support point ;
(3) Build support points Delaunay Triangular grid ;
(4) Build the probability generation model of stereo matching ;
(5) Based on the maximum a posteriori probability density estimation (MAP) Dense stereo matching , Get the initial parallax map ;
(6) Parallax post-processing : Invalid hole interpolation 、( The adaptive ) median filtering 、 Connected domain noise elimination 、 Left and right consistency test .
Here are my specific Using process :
The code download address of the algorithm is :ELAS Download address
After the download , You can use matlab and vs Joint programming , It can also be used directly VS function .
use VS The operation process is as follows :
- I'm using VS2019, Select open local file , Select the file from CMakeLists.txt Root directory of the file , Add :
2. After loading successfully , choice main.cpp File run :
I'm in the process of running , The following problems have been encountered :
After inquiry , It is found that the statement with the problem in the file is changed to typedef signed __int8 int8_t;
( Add... In the middle signed And it works ).
3. because ELAS The algorithm can only be used for pgm Format the image for processing , So I took advantage of opencv Read JPG Format image , It's transforming into PGM The format of .
A. First attempt ( No success , You can jump directly to B. A second try )
1) stay CMake Use... In documents opencv, Need to be right CMakeLists.txt Make changes :
a. add to OpenCV The header file
b. add to OpenCV Link library path
c. stay cmake Specify the referenced library file name in the configuration file
2) After configuration , After recompilation cmake Still can't find opencv.
B. A second try :
Refer to the fourth article at the end of the article , Make the following corrections :
# project
cmake_minimum_required (VERSION 2.6)
project (libelas)
find_package(OpenCV REQUIRED)
# directories
set (LIBELAS_SRC_DIR src)
# include directory
include_directories("${LIBELAS_SRC_DIR}/${OpenCV_INCLUE_DIR}")
include_directories("E:/opencv4.3.0/opencv/build/include")
# use sse3 instruction set
SET(CMAKE_CXX_FLAGS "-msse3")
# sources
FILE(GLOB LIBELAS_SRC_FILES "src/*.cpp")
# make release version
set(CMAKE_BUILD_TYPE Release)
# build demo program
add_executable(elas ${
LIBELAS_SRC_FILES})
link_directories("E:/opencv4.3.0/opencv/build/x64/vc15/lib")
target_link_libraries(elas opencv_world430 opencv_world430d)
There are the following issues to note :
On every CMakeLists.txt When you edit your file , Press down CTRL+S That is, the key to save the file , Automatic triggering CMake Project configuration process , This time finally succeeded ,cmake Found in the OpenCV, You can start writing your own program !!!
4. Programming in the main function , Will have JPG Batch conversion of image files in format into PGM File format , utilize ELAS The algorithm calculates binocular parallax , The results are as follows :
original image :( On the left )
Parallax map :
*** The joint programming process attempts as follows : ***( unsuccessful , But skip and don't look )
1. Start by opening MATLAB, Configure your MATLAB MEX C++ compiler ( If not already configured )(mex -setup) See my other article for the specific process :
Matlab2016 Use mex Command to find the editor Visual Studio2019
2. When the configuration is complete , Switch to libelas/matlab Catalog , Run... Run “make.m” after , Get one called “elasMex” Of MEX file , Then try to run “demo.m”, It will open a GUI And display some results of the included test images .
unfortunately , I run here , There was a mistake ( I don't know how to change )
PS: If someone knows what the problem is , Ask for advice , Thank you very much !!!
The operation results are as follows :
If there is a mistake , Welcome to correct , Thank you very much
Above reference : Explain the binocular stereo matching algorithm in detail ELAS
use vs2017 Of cmake Tools add... To other projects OpenCV library
utilize opencv take JPG And other formats into PGM Function of
Visual Studio 2019 cmake To configure opencv development environment
CMake Specific content of , See below , Speak more clearly :
VS2019 C++ Cross platform development of ——Cmake project ( One )
版权声明
本文为[Zhongai0049]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210547163065.html
边栏推荐
- Go language development Daily Fresh Project Day 3 Case - Press Release System II
- Go zero framework database avoidance Guide
- Mathematical modeling column | Part 5: MATLAB optimization model solving method (Part I): Standard Model
- BMP JPEG picture to vector image contourtrace
- [graph theory brush question-5] Li Kou 1971 Find out if there is a path in the graph
- star
- How to protect ECs from hacker attacks?
- DNS cloud school rising posture! Three advanced uses of authoritative DNS
- Zdns was invited to attend the annual conference of Tencent cloud basic resources and share the 2020 domain name industry development report
- Solution: NPM err! code ELIFECYCLE npm ERR! errno 1
猜你喜欢
內網滲透之DOS命令
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
【栈和队列专题】—— 滑动窗口
Go zero framework database avoidance Guide
上海回应“面粉官网是非法网站”:疏于运维被“黑”,警方已立案
DNS cloud school | analysis of hidden tunnel attacks in the hidden corner of DNS
Unity Odin ProgressBar add value column
Imitation Baidu map realizes the three buttons to switch the map mode by automatically shrinking the bottom
"Meta function" of tidb 6.0: what is placement rules in SQL?
Plato farm is one of the four largest online IEOS in metauniverse, and the transaction on the chain is quite high
随机推荐
I JS deep copy and shallow copy
Unity animation creates sequence frame code and generates animationclip
Recognition of high-speed road signs by Matlab using alexnet
内网渗透之DOS命令
Leetcode 1337. Row K with the weakest combat effectiveness in the matrix
【SQL】字符串系列2:将一个字符串根据特定字符分拆成多行
Syntaxerror: unexpected token r in JSON at position 0
Modeling based on catiav6
Devaxpress report replay: complete the drawing of conventional two-dimensional report + histogram + pie chart
GO語言開發天天生鮮項目第三天 案例-新聞發布系統二
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
Matlab analytic hierarchy process to quickly calculate the weight
打新债中签以后怎么办,网上开户安全吗
Analysis of the relationship between generalized Bim and CAD under the current background
Leetcode 1351. Negative numbers in statistical ordered matrices
LeetCode 116. 填充每个节点的下一个右侧节点指针
MySQL 存储过程和函数
JS arrow function user and processing method of converting arrow function into ordinary function
GO语言开发天天生鲜项目第三天 案例-新闻发布系统二
"Meta function" of tidb 6.0: what is placement rules in SQL?