hahnec / depthy Goto Github PK
View Code? Open in Web Editor NEWdepth map computation
Home Page: https://hahnec.github.io/depthy/
depth map computation
Home Page: https://hahnec.github.io/depthy/
I would like to generate depth map using my png file. But it always show error like this. Could you please help in this issue? Many thanks
(depth_map) C:\Workplace\02work>depthy -s D:\PNG\flood
depthy v0.4.0
Using epi method
Load light-field images
Traceback (most recent call last):
File "c:\users\anaconda3\envs\depth_map\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\users\anaconda3\envs\depth_map\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Users\anaconda3\envs\depth_map\Scripts\depthy.exe_main.py", line 7, in
File "c:\users\anaconda3\envs\depth_map\lib\site-packages\depthy\bin\cli.py", line 138, in main
lf_img_arr = load_lf_arr(filenames)
File "c:\users\anaconda3\envs\depth_map\lib\site-packages\depthy\misc\io_functions.py", line 53, in load_lf_arr
fnames = sorted(fnames, key=lambda x: int(re.sub("[^0-9]", "", os.path.basename(x).split(".")[0])))
File "c:\users\anaconda3\envs\depth_map\lib\site-packages\depthy\misc\io_functions.py", line 53, in
fnames = sorted(fnames, key=lambda x: int(re.sub("[^0-9]", "", os.path.basename(x).split(".")[0])))
ValueError: invalid literal for int() with base 10: ''
HI , can you give sample code ideas how to make stereo pair from depthmap in python , I have searched ,but not found that , could you please guide me .
Thanks in advanced .
Hi, I got that result message while running command:
depthy -s './examples/data/pens/'
Was I using the wrong method?
With recent version of numpy line 89 in depthy/stereo/cost_aggregation.py
throws an error
AttributeError: module 'numpy' has no attribute 'float'. np.float was a deprecated alias for the builtin float.
Changing np.float
to float
fixes the error.
Hello @hahnec,
I couldn't create depth map with your program: depthy v0.3.0 installed via pip3.
When trying with the default test images, I get the following error:
load light-field images
Traceback (most recent call last):
File "/usr/local/bin/depthy", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/depthy/bin/cli.py", line 113, in main
lf_img_arr = load_lf_arr(filenames)
File "/usr/local/lib/python3.7/site-packages/depthy/misc/io_functions.py", line 53, in load_lf_arr
fnames = sorted(fnames, key=lambda x: int(re.sub("[^0-9]", "", os.path.basename(x).split(".")[0])))
File "/usr/local/lib/python3.7/site-packages/depthy/misc/io_functions.py", line 53, in <lambda>
fnames = sorted(fnames, key=lambda x: int(re.sub("[^0-9]", "", os.path.basename(x).split(".")[0])))
ValueError: invalid literal for int() with base 10: ''
When trying with one of my image (a .png), it stops relatively early after ~2s, I get the following:
load light-field images
compute depth from epipolar images
/usr/local/lib/python3.7/site-packages/depthy/lightfield/epi_depth.py:107: RuntimeWarning: invalid value encountered in
true_divide
disparity = np.mean(disp_arr*reli_arr**2, axis=-1) / confidence
export depth as ply and pfm file
finished
The _epi.pfm =~ 1.3mb
And with another image (a .png), it stops after ~1min and I get:
load light-field images
compute depth from epipolar images
export depth as ply and pfm file
/usr/local/lib/python3.7/site-packages/depthy/misc/pfm_handler.py:62: RuntimeWarning: invalid value encountered in true_divide
img_arr = (img_arr-np.min(img_arr))/(np.max(img_arr)-np.min(img_arr))
finished
_epi.pfm =~ 100mb
Tried also with a .jpg, I get:
load light-field images
Traceback (most recent call last):
File "/usr/local/bin/depthy", line 8, in <module>
sys.exit(main())
File "/usr/local/lib/python3.7/site-packages/depthy/bin/cli.py", line 113, in main
lf_img_arr = load_lf_arr(filenames)
File "/usr/local/lib/python3.7/site-packages/depthy/misc/io_functions.py", line 60, in load_lf_arr
assert lf_dim % 2 == 1, 'Reshaping image list to light-field array failed due to size %s.' % len(img_list)
AssertionError: Reshaping image list to light-field array failed due to size 0.
Any idea?
It stills generate _epi.ply and _epi.pfm files, but no output image, is it normal or just because it errors out at some point?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.