-
Notifications
You must be signed in to change notification settings - Fork 13
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
How to store a scalar function of a mesh as an image? #38
Comments
Please correct me if I am wrong. I don't think you actually need a rasterized image (with fixed pixels etc.), instead, you are sampling in a square region, without the need of pixel-level information, then project them back to the surface. Just FYI, interacting with images can be done through this tutorial http://libigl.github.io/libigl/tutorial/tutorial.html#screencapture |
The paper does the rasterization and use error diffusion to do the re-sampling. Are you suggesting that I could complete this step without using error diffusion? In that case, is there efficient sampling technique for a scalar function defined on a mesh? |
Sorry I wasn't reading it carefully. In this case, I am not aware of cpu-side rasterization functions in libigl, probably you can implement it. Or you can also consider grabbing the opengl buffer. |
@jiangzhongshi Thank you for your suggestion, but I'm not sure if these could be done in less than two weeks... If there any alternative sampling techniques (preferably can work on the mesh directly)? Basically I just want a sampling algorithm that could distribute the vertices according to the control map (a scalar function defined on the mesh). |
I see it in the paper, they were using OpenGL. This involves calling the API |
Hi, you can use libigl for doing the rasterization, take a look at: For the half-toning, it is not in libigl: you will have to implement that part. |
Thank you for your suggestions! |
@danielepanozzo Hi professor, I tried to use the example you mentioned, and I want to save the buffer into a png file. My program can be built successfully but won't run. It shows the following error message:
I did enabled using PNG module in my CMakeLists.txt and add igl::png in target_link_libraries. Is this a bug in libigl or I didn't do the right configuration? |
Does the tutorial work with a vanilla libigl build? If it doesn't, then it's likely to be a bug in libigl's CMake configurations. |
@jiangzhongshi Same error. It is likely to be a libigl bug now. I will report it in libigl repository. |
As a temporary workaround, if you are playing around with matrices RGB, you don't need to export it. If you do, maybe you can use this https://github.com/danielepanozzo/cg/blob/master/Assignment_1/src/stb_image_write.h |
Thank you for your suggestion! A fix is also given in libigl/libigl#758 |
I'm doing the remeshing project, and in this project it requires to store the "control map" as a 2D image and applying error diffusion technique to do the resampling. After that, it requires to read the result image and recover it as a point cloud. I'm wondering is there a corresponding function in libigl or its external libraries?
The text was updated successfully, but these errors were encountered: