Closed syncle closed 7 years ago
Looks like libjpeg supports ppm (see line 142 External/libjpeg/jconfig.h
)
Very good. Yes, we need to support these file formats. However, we have two viable solutions.
If ppm is natively supported by libjpeg, then the solution is simple, just copy FileJPG.h/cpp
to FilePPM.h/cpp
and edit the interface.
If option 1 is too complicated, we don't need to introduce new libraries for parsing image. py3d
supports creating an Image
from a numpy array. E.g.
print("Convet a numpy image to Image and show it with DrawGeomtries().")
y = mpimg.imread("../TestData/lena_color.jpg")
print(y.shape)
yy = Image(y)
print(yy)
DrawGeometries([yy])
So for the NYU data, we don't even need to write a parser for ppm. Just in our python tutorial, we read the image using this method. This is actually the benefit of using Python. Open3D need not to support everything. We just write 3D algorithms in C++, and Python can take care of the auxiliary functionalities.
I agree. I also thought the same thing, and I was working on option 2. Actually it turns out that even mathploblib.image
is not friendly toward NYU pgm depth format, and I had to write a python function for this. You will check this issue from new commit.
Addressed in #42
Looks like the current image IO can handle jpg and png image format. However, some of RGBD dataset (such as NYU dataset) is captured with ppm/pgm format. Do we need to extend OpenCV support for these formats as well?