Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't generate depth map #1

Closed
trompx opened this issue Dec 10, 2020 · 3 comments
Closed

Can't generate depth map #1

trompx opened this issue Dec 10, 2020 · 3 comments

Comments

@trompx
Copy link

trompx commented Dec 10, 2020

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?

@hahnec
Copy link
Owner

hahnec commented Dec 11, 2020

Hi @trompx,

Thanks for pointing this out. I admit that I haven't used this CLI interface much, but rather the API for other projects such as PlenoptiCam. Hence, I assume this issue is related to the CLI interface implementation. I am currently working on improvements for the CLI usage. Meanwhile, could you please provide details on the commands you used and a content list of the respective folders?

Thanks,
Chris

@hahnec
Copy link
Owner

hahnec commented Jan 6, 2021

over the holidays, i have worked on release v0.4.0 with a fix for your issue as i was adding stereo depth capabilities. it also happened that i had to move the CI pipeline to GitHub Action, which is why it took quite some time. The CLI interface has been revised and I added tests for it, which ideally should make things work seamlessly on your side.

you can give it a try with:

pip install depthy==0.4.0

and then run

depthy --win --method='epi'

@hahnec hahnec closed this as completed Jan 6, 2021
@lonngxiang
Copy link

ValueError: invalid literal for int() with base 10: ''

same error:ValueError: invalid literal for int() with base 10: ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants