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

PPM/PGM file support #43

Closed
syncle opened this issue Jun 15, 2017 · 4 comments
Closed

PPM/PGM file support #43

syncle opened this issue Jun 15, 2017 · 4 comments
Assignees

Comments

@syncle
Copy link
Contributor

syncle commented Jun 15, 2017

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?

@syncle syncle self-assigned this Jun 15, 2017
@syncle
Copy link
Contributor Author

syncle commented Jun 15, 2017

Looks like libjpeg supports ppm (see line 142 External/libjpeg/jconfig.h)

@qianyizh
Copy link
Collaborator

Very good. Yes, we need to support these file formats. However, we have two viable solutions.

  1. 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.

  2. 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.

@syncle
Copy link
Contributor Author

syncle commented Jun 15, 2017

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.

@qianyizh
Copy link
Collaborator

Addressed in #42

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

2 participants