Code Monkey home page Code Monkey logo

Comments (15)

holynski avatar holynski commented on June 12, 2024 1

Found it at the end of the DensifyFrame function, when copying the solver disparities back into the depth map.

            depth[col,row] = 1.0 / x[col + row * w]

Will push a fix shortly.

from ar-depth.

meder411 avatar meder411 commented on June 12, 2024

After looking further into the problem, I haven't come up with a solution yet, but I've diagnosed the source. it appears the issue arises when applying the TemporalMedian function. For frame 14, the input and outputs are below.

INPUT
000014

UNFILTERED DEPTH
000014

FILTERED DEPTH (after applying TemporalMedian)
000014 png_filtered

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Thanks for bringing this to my attention. I'm looking into this now...

from ar-depth.

holynski avatar holynski commented on June 12, 2024

I'm not able to reproduce your error. Running the code as-is produces the following filtered depth map for frame 14:

000014

Have you changed the code somehow in your version? If so, can you share the specific changes you've made?

from ar-depth.

meder411 avatar meder411 commented on June 12, 2024

Hm. Interesting. The only thing I did was to copy the code from an Jupyter notebook to a Python script. I am also running it in a conda environment too. Perhaps one of those two factors is playing a role? I will take a further look as well and report back too.

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Are you able to produce the correct output from within the Jupyter notebook?

from ar-depth.

meder411 avatar meder411 commented on June 12, 2024

No, I can't. It must be something to do with the conda environment I guess? It runs with no errors, but the filtered depth is still empty for some reason (when running in a Jupyter notebook). I am using opencv 4.1, opencv-contrib-python 4.1.0.25, and pyquaternion 0.9.5, running on a Ubuntu 18.04 server with Python 3.7.3.

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Here's my setup:

OSX 10.14.3
Python 3.7.2 (via conda)
OpenCV 4.0.0
SciPy 1.2.1
PyQuaternion 0.9.5
NumPy 1.15.4

To open and run the code, I start a Python kernel with jupyter notebook, and then navigate to the notebook, and press "Run All".

If indeed there is an issue within the TemporalMedian function, I'm not sure what would cause it, apart from a change in the np.median function. Could you tell me the size of the array (depth_maps) passed to the TemporalMedian function?

Just to double check -- you do mean frame 000014.png, and not the 14th frame which is saved, correct? This is first frame which is saved if skip_frames is set to 0.

Also, for sanity -- you haven't modified the COLMAP files, right?

from ar-depth.

meder411 avatar meder411 commented on June 12, 2024

I do mean frame00014 and I haven't modified the COLMAP files at all. It is odd though, because you're right, TemporalMedian is basically just a numpy function and that's a fairly boilerplate operation that's unlike to be the cause. Interestingly, the subsequent solver initialization images all look great. I'm thinking there's a visualization issue somewhere for me.

Solver initialization of frame000015.png after frame000014.png's output was blank
image

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Ah, that's definitely possible. Let me look into that code.

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Can you inspect the min/max values of the filtered depth map, and compare it to that of the solver initialization?

It could be an issue with the automatic scaling.

from ar-depth.

meder411 avatar meder411 commented on June 12, 2024

Hm, results below:

==>Processing frame000014.png
Initialization min: 0.5802239
Initialization max: 1.266863
Raw depth min: 0.80136484
Raw depth max: Inf
Filtered depth min: 0.80136484
Filtered depth max: Inf
==>Processing frame000015.png
Initialization min: 0.5802239
Initialization max: 1.266863
Raw depth min: 0.80864733
Raw depth max: Inf
Filtered depth min: 0.81061256
Filtered depth max: Inf

I believe you are right. It's the Inf's that are screwing it up it seems--throwing off the scale. I haven't found the specific source of those yet, but it's I'm fairly sure there's a divide-by-zero error somewhere.

from ar-depth.

holynski avatar holynski commented on June 12, 2024

Yep - very likely a divide-by-zero. I've actually seen debug warnings on my end for a while, but never had the time to investigate. Let's see if I can find it now.

from ar-depth.

HeCraneChen avatar HeCraneChen commented on June 12, 2024

Found it at the end of the DensifyFrame function, when copying the solver disparities back into the depth map.

            depth[col,row] = 1.0 / x[col + row * w]

Will push a fix shortly.

Did you have time to fix this yet? I ran into the exact same problem as described in this issue.

from ar-depth.

HeCraneChen avatar HeCraneChen commented on June 12, 2024

Found it at the end of the DensifyFrame function, when copying the solver disparities back into the depth map.

            depth[col,row] = 1.0 / x[col + row * w]

Will push a fix shortly.

Did you have time to fix this yet? I ran into the exact same problem as described in this issue.

NVM, can be fixed by simply adding a condition if x[col + row * w] != 0.0

from ar-depth.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.