yan99033 / monodepth-cpp

Tensorflow C++ implementation for single-image depth estimation (Monodepth)
MIT License
105 stars 33 forks source link

monodepth weird results #16

Closed naserpiltan closed 4 years ago

naserpiltan commented 4 years ago

Hello @yan99033 and thank you for sharing this usefull repo. I am working on a depth estimation project. I searched a lot an found your amazing repo. I built tensorflow from source and can ran your code on my local systems successfully.

Systen information : OS : ubutnu 18.04 LTS Tensorflow version : 1.15.0 Protobuf version : 3.8.0 Bazel : 0.25.0 OpenCV : 4.3.0 Used model : model_city2kitti.pb Testing dataset : kitti dataset

When i run the inference_monodepth on my command , i have this picture as result :

full

The result is disappointing and i dont know why i have this result. What i can to do to solve this problem ? Thanks in advance.

yan99033 commented 4 years ago

I am almost certain that this has to do with the invalid access to the memory buffer. Can you just visualize the imshow the depth_visual variable? Just want to make sure that the error doesn't occur in the image stacking.

naserpiltan commented 4 years ago

@yan99033 thank you so much for your answer . I visualized the depth_visual and have this result :

depth

Seems the program is working well and i have the true output . thank you so much for your solution. Is my previous problem due to opencv issue ?

yan99033 commented 4 years ago

It might be due to the difference in opencv version.

Try to change depthmap_visual.convertTo(depthmap_visual, CV_8U); to depthmap_visual.convertTo(depthmap_visual, CV_8UC3);

Normally when you do applyColorMap(), it should give you 3 channels. I suspect that's the problem.

naserpiltan commented 4 years ago

It might be due to the difference in opencv version.

Try to change depthmap_visual.convertTo(depthmap_visual, CV_8U); to depthmap_visual.convertTo(depthmap_visual, CV_8UC3);

Normally when you do applyColorMap(), it should give you 3 channels. I suspect that's the problem.

@yan99033 Thank you I did depthmap_visual.convertTo(depthmap_visual, CV_8UC3); but no thing changed. I have the old issue yet. I think like you that the problem is in opencv version.

naserpiltan commented 4 years ago

@yan99033 i resized depthmap_visual to image size and the problem is solved. Now the code is working very well.