ashawkey / kiuikit

A toolkit for 3D computer vision tasks.
https://kit.kiui.moe/
Apache License 2.0
187 stars 13 forks source link

Difference in normal image with other method #18

Open KhanhNgoDuy opened 4 days ago

KhanhNgoDuy commented 4 days ago

Hi, I'm using kiuikit to render normal images from 3D files (2nd image). But when I use other methods (3rd image) (MiDaS, Omnidata, DSINE), the estimated normal maps from them looks quite different in the main region of the image (excluding the background).

Is there a difference in the definition of the normal map rendered from kiuikit, and those from these methods? If yes, do you have any suggestions so that the rendered normal image is in the same format as in the other methods? Thank you!!

rgb kiuikit dsine

ashawkey commented 3 days ago

@KhanhNgoDuy Hi, which tool are you using, kiui.cli.blender_render or kire? Normal image are visualization of the normal vectors, so it will be affected by the coordinate convention. You may try to switch RGB channels or invert the signal (assume in [-1, 1]) to match these two images.

KhanhNgoDuy commented 3 days ago

Hi, I'm based on this script, with --mode = normal and --force_cuda_rast enabled

ashawkey commented 3 days ago

image kire follows the OpenGL convention (https://kit.kiui.moe/camera/). It seems the normal in the second image has x/y axes direction inverted, you may try to negate them and compare.

KhanhNgoDuy commented 1 day ago

is there a convenient way to achieve this?

ashawkey commented 7 hours ago

Unfortunately no automatic way. You can check the pixel value at the same location and compare them to see if it should be negated or switched with another axis.