# Codes_Shape_from_shading
Matlab codes for shape-from-shading. Several variants are implemented:
- ADMM-based variational shape from shading with general camera (orthographic or perspective) and lighting (spherical harmonics), see [1]
- Lax-Friedriechs solving of the eikonal case (orthographic camera, frontal directional lighting), cf. Equation (8) in [2]
- Semi-Lagrangian solver for the eikonal case (orthographic camera, frontal directional lighting), see [3]
- Semi-Lagrangian solver for the perspective eikonal case (perspective camera, frontal directional lighting), see [4]
## Introduction
These codes can be used to solve the shape-from-shading (SfS) problem (estimate shape, given a single image). Main features:
- possibility to add a shape prior in order to guide the solution (useful for instance in RGB-D sensing)
- minimal surface regularization to smooth out the residual noise
- handles second-order spherical harmonics lighting
- handles orthographic or perspective camera
- handles grey or RGB images
Note: the classic eikonal SfS can also be achieved as a special case.
## Demos
The following two demo files accompanying [1] are provided:
- `demo_1_lena_eikonal.m` : classic SfS (greylevel image, orthographic camera, frontal lighting) applied to the standard Lena image
- `demo_2_vase_SH2.m` : refinement of the depth map obtained with a RGB-D sensor. Source of the dataset: https://github.com/pengsongyou/SRmeetsPS
The three other demo files illustrate alternative PDE-based methods based semi-Lagrangian schemes, when lighting is frontal and directional, see [2,3,4] for details.
## Contents
The main fuctions for ref [1] are in the Toolbox/ folder:
- `generic_sfs.m`: main SfS code
- `theta_fun.m`: cost function with respect to the surface gradient values
- `estimate_lighting.m`: can be used to estimate spherical harmonics lighting, given an image and a shape estimate
- `make_gradient.m`: finite differences stencils on a non-rectangular grid
- `export_obj2.m`: to produce a .obj file readable with meshlab
## Dependencies
- minFunc: need first be compiled: go to Toolbox/minFunc and run mexAll.m script
(source: https://www.cs.ubc.ca/~schmidtm/Software/minFunc.html)
- CMG (recommended for faster results): http://www.cs.cmu.edu/~jkoutis/cmg.html
## References
[1] "A Variational Approach to Shape-from-shading Under Natural Illumination", Y. Quéau et al., EMMCVPR 2017
[2] "A comprehensive introduction to photometric 3D-reconstruction", J.-D. Durou et al., 2020
[3] "An algorithm for the global solution of the Shape-fromShading model", M. Falcone and M. Sagona, ICIAP 1997
[4] "Some remarks on perspective shape-from-shading models", E. Cristiani et al., SSVM 2007
没有合适的资源?快使用搜索试试~ 我知道了~
Matlab codes for shape from shading.zip
共89个文件
m:49个
attr:8个
mexw64:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 1 下载量 138 浏览量
2023-07-22
17:38:24
上传
评论 1
收藏 1.59MB ZIP 举报
温馨提示
Matlab codes for shape from shading.zip
资源推荐
资源详情
资源评论
收起资源包目录
Matlab codes for shape from shading.zip (89个子文件)
新建文件夹
shape_from_shading-master
Toolbox
eikonal_lf.m 3KB
simulate_image_ortho.m 1KB
simulate_image.m 1KB
export_obj2.m 11KB
theta_fun.m 2KB
make_gradient.m 4KB
minFunc
rosenbrock.m 812B
example_derivativeCheck.m 1KB
autoDif
autoHv.m 371B
autoGrad.m 1KB
fastDerivativeCheck.m 2KB
.dropbox.attr 2B
autoTensor.m 1KB
derivativeCheck.m 1KB
autoHess.m 1KB
minFunc
lbfgs.m 924B
minFunc_processInputOptions.m 4KB
precondTriu.m 51B
ArmijoBacktrack.m 4KB
mcholinc.m 564B
WolfeLineSearch.m 10KB
isLegal.m 107B
mex
lbfgsC.c 2KB
lbfgsProdC.c 2KB
.dropbox.attr 2B
lbfgsAddC.c 802B
mcholC.c 4KB
precondTriuDiag.m 60B
lbfgsUpdate.m 614B
compiled
mcholC.mexglx 13KB
mcholC.mexw32 8KB
lbfgsProdC.mexmaci64 9KB
lbfgsAddC.mexmaci64 9KB
mcholC.mexmaci64 13KB
lbfgsC.mexw64 9KB
lbfgsC.mexmaci 12KB
lbfgsAddC.mexa64 8KB
lbfgsC.mexa64 8KB
lbfgsC.mexw32 7KB
mcholC.mexmac 10KB
lbfgsProdC.mexw64 11KB
lbfgsC.mexmac 9KB
.dropbox.attr 2B
lbfgsAddC.mexw64 8KB
lbfgsC.mexglx 8KB
mcholC.mexw64 12KB
lbfgsProdC.mexa64 12KB
mcholC.mexa64 13KB
lbfgsC.mexmaci64 9KB
taylorModel.m 677B
precondDiag.m 42B
.dropbox.attr 2B
conjGrad.m 2KB
lbfgsAdd.m 679B
lbfgsProd.m 696B
dampedUpdate.m 995B
minFunc.m 42KB
mchol.m 1KB
polyinterp.m 4KB
example_minFunc.m 2KB
.dropbox.attr 2B
mexAll.m 266B
logisticExample
LogisticHv.m 216B
LogisticDiagPrecond.m 417B
.dropbox.attr 2B
LogisticLoss.m 709B
mylogsumexp.m 228B
example_minFunc_LR.m 2KB
eikonal_sl_perspective.m 5KB
.dropbox.attr 2B
generic_sfs.m 10KB
estimate_lighting.m 1KB
eikonal_sl.m 4KB
render_SH.m 932B
demo_1_lena_eikonal.m 5KB
demo_5_perspective_eikonal_sl.m 4KB
LICENSE 34KB
demo_3_eikonal_sfs_lax_friedriechs.m 4KB
demo_4_eikonal_sfs_sl.m 4KB
demo_2_vase_SH2.m 5KB
README.md 3KB
Data
vase_mask.png 4KB
vase.png 449KB
lena.png 464KB
face_depth.mat 331KB
vase_depth.mat 48KB
bunny.mat 214KB
.dropbox.attr 2B
vase_K.mat 195B
共 89 条
- 1
资源评论
- lfjia1262023-08-30这个资源内容超赞,对我来说很有价值,很实用,感谢大佬分享~
AbelZ_01
- 粉丝: 875
- 资源: 5441
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功