简体   繁体   中英

OpenCV - Horizontally Flip a Surface Normal Image

I have a collection of Surface Normal images which are like this:

具有正确着色的表面法线

I want to flip them horizontally but since flipping does not account for the change to Surface Normal, I end up with this flipped surface normals which are wrong:

着色不正确的表面法线

The coloring in the flipped normals is wrong since the surfaces facing left should have a pink coloring and the surfaces faces right should have a blue coloring. ALSO the surfaces facing upwards or downwards should stay the same (green facing upwards and purple facing downwards).

How can I flip the surface normals horizontally correctly? Thanks.

EDIT: it seems I should invert the color but doing so also inverts the upwards and downwards normals making the roofs green and grounds purple (they should stay the same when flipping horizontally). Here's an image of an Inverted Surface Normal (Which seems partly correct and partly incorrect):

在此处输入图片说明

Thanks to a Reddit post I was able to solve it. All you have to do is inverting the Red Color Channel after flipping the image.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM