/**************************************************************************************
GCO_MATLAB - a Matlab wrapper for Olga Veksler's C++ graph-cut optimization library
GCO_MATLAB Author(s):
Andrew Delong <firstname.lastname@gmail.com>
Anton Osokin <lastname.firstname@gmail.com>
We're especially grateful to Lena Gorelick for helpful suggestions and for
tracking down so many bugs!
GCoptimization Author(s):
Olga Veksler <firstname@csd.uwo.ca>
Description:
This download provides a Matlab wrapper for the latest version of 'GCoptimization',
Olga Veksler's multi-label optimization library written in C++.
Note: A wrapper for an earlier version GCoptimization was authored by Shai Bagon and
is available at http://www.wisdom.weizmann.ac.il/~bagon/matlab.html
Revision History:
Oct 14, 2014; - Added GCO_ENERGYTERM and GCO_ENERGYTERMTYPE macros to make
float/double terms easier. Please note that float/double energy terms
can cause expansion/swap steps to report a very small increase in energy
due to accumulated rounding error inside the maxflow library.
If Inf or NaN values appear in the energy terms, behaviour is undefined.
May 18, 2014; - Support Matlab R2014a by removing use of mxCreateReference
Jan 15, 2014; - Compiles with gcc 4.6+ even without -fpermissive
Apr 12, 2011; - Fixed bug when sparse data costs had a dense bucket (thanks Joseph Tighe!)
Nov 25, 2010; - Detect MACI64 correctly (thanks Francis Lauzon)
Aug 31, 2010; - Compiles with gcc 4.4.1 on opensuse 11.2 (thanks Wei Liu)
Aug 7, 2010; - Fixed bug when data costs are computed in a callback (thanks Evan Herbst!)
- Fixed bug where setAllNeighbours didn't apply neighbourhood (Evan Herbst again)
Jul 22, 2010; - Compiles with gcc 4.4.1 (thanks Julius Ziegler for the patch!)
Jul 8, 2010; - Fixed crash in greedy code path when all labels get added (thanks Yangyan Li!)
Apr 25, 2010; - Faster code path for sparse data costs; fixed related bug in higher-order labels
Apr 21, 2010; - Added basic "verbose" mode (print cycle, energy, timings etc)
- Expansion cycles now focus on labels for which the energy decreased (faster)
Apr 19, 2010; - Added sparse datacost support
- Allow GCO_SetLabelOrder to specify exact label order
Apr 13, 2010; - Potts model is now the default if SetNeighbors is called without SetSmoothCost
- Fixed bug in higher-order label costs
- Expansion is now interruptable from MATLAB; temporary memory is freed
- Added GCO_ListHandles and allow GCO_Delete to accept multiple handles
- Better error message if a bad handle is passed to GCO_*
Nov 17, 2009; - Fixed integer overflow in label-cost construction
- Fixed bug where greedy algorithm would sometimes skip a label
Nov 6, 2009; - Fixed bug in re-setting label costs after Expansion
- Fixed bug in GCO_LoadLib
Oct 27, 2009; - Removed support for arbitrary smoothcost (too slow, hard to maintain)
- Added support for re-setting data, smooth, and label costs after Expansion
- Added support for label subset costs
- Changed build process to directly use MEX command
- Added integer overflow checks into GCoptimization
- GCoptimization now uses maxflow-3.0 library
Sep 12, 2009; - Added support for arbitrary smoothcost from Matlab via a function_handle
- Added GCO_UnitTest
- Build script now handles spaces in paths properly
Aug 23, 2009; - First version for internal testing
***************************************************************************************/
0. System Requirements
- Matlab 7.4.0 (R2007a) or above for 32-bit.
Matlab 7.6.0 (R2008) or above for 64-bit.
- Mex must be pre-configured to use a C++ compiler. (Run "mex -setup" if you have
not already.) The C++ code requires at least Visual C++ 2005 (VC8).
----------------------------------------------------------------------------------------
1. Installation
- The package should contain the following files:
GCO_MATLAB files:
gco\matlab\GCO_*.m ; the Matlab commands that you can run
gco\matlab\gco_matlab.cpp ; the library that links Matlab to GCoptimization
GCoptimization files:
gco\*.{h,cpp} ; the GCoptimization C++ library
- Start Matlab, and make gco\matlab your working directory or add it to your path.
- To test your installation of GCO_MATLAB, run the GCO_UnitTest command.
You should hopefully see output like below.
>> GCO_UnitTest
BuildLib PASSED
LoadLib PASSED
Create/Delete PASSED
...
>>
-
----------------------------------------------------------------------------------------
2. Getting Started -- A basic example, and important usage notes
Once GCO_UnitTest passes, you should be able run the example sequence of commands below.
>> h = GCO_Create(4,3); % Create new object with NumSites=4, NumLabels=3
>> GCO_SetDataCost(h,[
0 9 2 0; % Sites 1,4 prefer label 1
3 0 3 3; % Site 2 prefers label 2 (strongly)
5 9 0 5; % Site 3 prefers label 3
]);
>> GCO_SetSmoothCost(h,[
0 1 2; %
1 0 1; % Linear (Total Variation) pairwise cost
2 1 0; %
]);
>> GCO_SetNeighbors(h,[
0 1 0 0; % Sites 1 and 2 connected with weight 1
0 0 1 0; % Sites 2 and 3 connected with weight 1
0 0 0 2; % Sites 3 and 4 connected with weight 2
0 0 0 0;
]);
>> GCO_Expansion(h); % Compute optimal labeling via alpha-expansion
>> GCO_GetLabeling(h)
ans =
1 % Optimal labeling is (1,2,1,1)
2
1
1
>> [E D S] = GCO_ComputeEnergy(h) % Energy = Data Energy + Smooth Energy
E =
4
D =
2
S =
2
>> GCO_Delete(h); % Delete the GCoptimization object when finished
*** Before using the MATLAB wrapper, please note the following: ***
- Sites and labels are identified with 1-based indices (i.e. 1..N and *not* 0..N-1)
- By default, all numeric costs should be int32, not single or double!
To use single/double energy terms with the library, please type "help GCO_BuildLib"
at the MATLAB command prompt.
You'll receive a conversion warning if you pass in a large matrix of the wrong type.
The only function that accepts double is GCO_SetNeighbors, because it needs a sparse matrix
and sparse matrices only support double in MATLAB.
** The weights themselves must still be integer valued!! ** (1.0, 17.0, 42.0 etc)
----------------------------------------------------------------------------------------
3. GCO_MATLAB functions
Run 'help' in MATLAB to see the documentation of each function, e.g.
>> help GCO_SetSmoothCost
Most of the GCO_MATLAB functions are one-to-one with the C++ methods in the
GCoptimization library.
For more detailed documentation, please refer to the C++ library itself.
Relevant files are:
GCO_README.TXT
example.cpp
GCoptimization.h
没有合适的资源?快使用搜索试试~ 我知道了~
深蓝基于图像的三维重建代码C++源码+文档说明(高分项目)
共918个文件
js:456个
h:160个
cc:94个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 23 浏览量
2024-08-12
02:11:46
上传
评论
收藏 207.08MB ZIP 举报
温馨提示
<项目介绍> 架构 该工程主要包含core, math, util, features, sfm, mvs, surface, texturing等主要模块,其中: core—提供了工程项目需要的所有的基础数据结构,包括image, depthmap, mesh, view,以及数据的输入输出等结构和功能; math—提供矩阵,向量,四元数等基本的数学运算操作; - 不懂运行,下载完可以私聊问,可远程教学 该资源内项目源码是个人的毕设,代码都测试ok,都是运行成功后才上传资源,答辩评审平均分达到96分,放心下载使用! 1、该资源内项目代码都经过测试运行成功,功能ok的情况下才上传的,请放心下载使用! 2、本项目适合计算机相关专业(如计科、人工智能、通信工程、自动化、电子信息等)的在校学生、老师或者企业员工下载学习,也适合小白学习进阶,当然也可作为毕设项目、课程设计、作业、项目初期立项演示等。 3、如果基础还行,也可在此代码基础上进行修改,以实现其他功能,也可用于毕设、课设、作业等。 下载后请首先打开README.md文件(如有),仅供学习参考, 切勿用于商业用途。 --------
资源推荐
资源详情
资源评论
收起资源包目录
深蓝基于图像的三维重建代码C++源码+文档说明(高分项目) (918个子文件)
exif.blob 24KB
exif.blob 23KB
exif.blob 23KB
exif.blob 23KB
exif.blob 23KB
exif.blob 23KB
exif.blob 23KB
tritri.c 10KB
iso_surface.cc 45KB
camera_database.cc 41KB
mesh_io_ply.cc 39KB
task2-3_test_lm_optimize.cc 35KB
sift.cc 34KB
image_io.cc 33KB
view.cc 31KB
bundle_adjustment.cc 27KB
bundler_incremental.cc 27KB
surf.cc 26KB
marching.cc 20KB
image_exif.cc 18KB
depthmap.cc 18KB
dmrecon.cc 17KB
file_system.cc 16KB
sample_io.cc 15KB
task3-1_test_incremental_sfm.cc 15KB
bundle_io.cc 15KB
octree.cc 14KB
task2-5_test_bundle_adjustment.cc 14KB
patch_sampler.cc 13KB
task4-1_scene2pset_single_view.cc 13KB
bundler_init_pair.cc 13KB
task2-2_test_p3p_kneip.cc 13KB
patch_optimization.cc 13KB
ba_linear_solver.cc 11KB
mesh_io_obj.cc 11KB
nearest_neighbor.cc 11KB
arguments.cc 11KB
mesh_tools.cc 10KB
task1-6_test_matching.cc 9KB
mvs_tools.cc 9KB
task1-4_test_fundamental_ransac.cc 9KB
mesh_clean.cc 9KB
camera.cc 9KB
mesh.cc 9KB
iso_octree.cc 9KB
bundler_common.cc 8KB
pose_p3p.cc 8KB
task1-5_test_pose_from_fundamental.cc 8KB
task6-1_surface_reconstruction.cc 8KB
fundamental.cc 8KB
cascade_hashing.cc 8KB
bundler_tracks.cc 7KB
visualizer.cc 7KB
triangulate.cc 7KB
bundler_matching.cc 7KB
task8_1_3d_shapes.cc 7KB
task2-4_test_jacobian.cc 6KB
task6-2_meshclean.cc 6KB
task7_1_meshclean.cc 6KB
local_view_selection.cc 6KB
task1-3_test_fundamental_8_point.cc 6KB
task4-2_scene2pset_multi_views.cc 6KB
scene.cc 6KB
mesh_io_off.cc 6KB
mesh_info.cc 5KB
image_tools.cc 5KB
exhaustive_matching.cc 5KB
task8_3_texturing.cc 5KB
hermite.cc 5KB
image_pyramid.cc 5KB
task8_2_VBO.cc 5KB
volume.cc 5KB
bundler_intrinsics.cc 5KB
single_view.cc 5KB
ransac_pose_p3p.cc 4KB
global_view_selection.cc 4KB
functions.cc 4KB
task2-1_test_triangle.cc 4KB
feature_set.cc 3KB
task4-2_dmrecon_multi_views.cc 3KB
ransac_fundamental.cc 3KB
task1-2_test_camera.cc 3KB
bundler_features.cc 3KB
ini_parser.cc 3KB
matching.cc 3KB
ransac_homography.cc 3KB
mesh_io_smf.cc 3KB
mesh_io_npts.cc 3KB
task1-7_test_features.cc 3KB
bundle.cc 3KB
basis_function.cc 3KB
homography.cc 3KB
triangulation.cc 3KB
task4-1_dmrecon_single_view.cc 3KB
mesh_io_pbrt.cc 2KB
mesh_io.cc 2KB
voxel.cc 2KB
task2-2_test_p3p_ransac.cc 2KB
system.cc 2KB
extract_focal_length.cc 2KB
共 918 条
- 1
- 2
- 3
- 4
- 5
- 6
- 10
资源评论
机智的程序员zero
- 粉丝: 2434
- 资源: 4847
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功