xiaoyu258 / DocProj

Document Rectification and Illumination Correction using a Patch-based CNN
MIT License
339 stars 86 forks source link

Generate dataset with Blender #3

Closed IceSuger closed 4 years ago

IceSuger commented 4 years ago

Hello, I'm trying to generate dataset for my own images, but got stuck on extracting the texture coordinates when given camera view coordinates. So I wonder if you are planning to open source your scripts for dataset generating? If not, could you please give some hints on how to transform the pixel coordinates in rendered image to the UV coordinates? Thank you !

xiaoyu258 commented 4 years ago

In the note editor of Blender, you can connect the UV of Texture Coordinate to the Image of Separate RGB like this. image

IceSuger commented 4 years ago

EXCELLENT ! Thanks ! Way much easier and more elegant than casting rays from the camera and transform the world 3d coords back to UV coords, which is the way I was working on. Just one more question making me a little confused: will the strength of the Emission affect the result ? I haven't take a look at the numeric values of each pixels, but by seeing the rendered image under different Emission strength, I guess the results are different.

Thanks !

xiaoyu258 commented 4 years ago

Thanks, yes, you need to remove all the lighting and only keep the emission or the image will be total black. And set it to 1 is also important.

IceSuger commented 4 years ago

Thank you !