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

[BUG]: normals are all 0.5 #865

Open
tensorflowi opened this issue Apr 5, 2023 · 1 comment
Open

[BUG]: normals are all 0.5 #865

tensorflowi opened this issue Apr 5, 2023 · 1 comment
Labels
first answer provided question Question, not yet a bug ;)

Comments

@tensorflowi
Copy link

tensorflowi commented Apr 5, 2023

Describe the bug
The normals are all 0.5.

General Information

  1. Which BlenderProc version are you using?
    2.3.0

  2. On which operating system are you?
    ubuntu 22

  3. Have you checked the issue tracker to see if a similar issue has been opened?
    yes

  4. Have you changed BlenderProc in any way besides the config file? If yes, are you sure that this change does not affect the problem you are having?
    yes

To Reproduce
Steps to reproduce the behavior:

bproc.init()

obj = bproc.loader.load_blend("test.blend", obj_types="mesh")

bproc.renderer.enable_depth_output(activate_antialiasing=False,convert_to_distance=False)
bproc.renderer.set_max_amount_of_samples(100)
bproc.renderer.set_light_bounces(transmission_bounces=200, transparent_max_bounces=200, max_bounces=200, glossy_bounces=200, volume_bounces=5, diffuse_bounces=200)
bproc.renderer.set_output_format(enable_transparency=False)
bproc.renderer.enable_normals_output()
bproc.renderer.set_denoiser(None)

data = bproc.renderer.render()
data.update(bproc.renderer.render_segmap(map_by=["class"]))

filename_rgb = filename_base + "color.jpg"
cv2.imwrite(filename_rgb, data["normals"][0])

filename_normals = filename_base + "normals.jpg"
cv2.imwrite(filename_normals, data["normals"][0])

print(normals.min()) # is 0.5
print(normals.max()) # is 0.5

  1. Provide a link to all 3D models you used, if they are from one of the publicly available supported datasets, provide the name or path so that it is possible to reproduce the error.
    https://easyupload.io/dovng0

Screenshots
color:
000004-color
depth:
000004-depth
normals:
000004-normals

Additional context
Any idea why my normals are all 0.5?

@tensorflowi tensorflowi added the bug Something isn't working label Apr 5, 2023
@cornerfarmer
Copy link
Member

Hey @tensorflowi,

your given minimal example is not working, however I suspect that your problem is caused by the fact that you are calling bproc.renderer.enable_normals_output() before adding the camera poses.
The bproc.renderer.enable_normals_output() needs the camera poses, as every normal image should be in camera coords.
Maybe we should add a warning when it is called before creating the camera poses.

Let me know if that solves your issue.

@cornerfarmer cornerfarmer added question Question, not yet a bug ;) first answer provided and removed bug Something isn't working labels Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
first answer provided question Question, not yet a bug ;)
2 participants