UnrealImageCapture
UnrealImageCapture copied to clipboard
Rendering PNG not working
Hi there, I've tried rendering PNGs in the sample project and it doesn't generate anything. It first the image taking flow but then the folder remains empty... Do you have any idea where to start looking to fix it?
Hey, does this issue remain for you? I just tested color image generation for .jpeg and .png settings, also in sequence. and I could not reproduce. I also checked the git to make sure I did not forget to push anything lately, because I remembered that I indeed had this issue a while back.
I have a similar problem. If i generate a float it doesnt create any file. If i generate a PNG it creates a file but its all transparent
Ok, I will certainly take another good look at this, however, it might take some days as I am currently away from my workstation. I will come back to you though
Thanks! I have seen that if i use the plugins happens what i said, but if i use the project from the repo it creates exr files. Dunno how to open them in a correct format tho
Oh thank you for that hint! That will be useful. You need a format like exr because you cannot save float values in uint8 encoded png by default. You can take a look at the openexr library for python. Thats what I use
Okay, sorry. Now i created another empty project. Imported the UE5 plugin. Added a Blueprint of type CameraCaptureManager and attached a scenecapture. Now it works, but the JPG and EXR photos are all black.
`pt = Imath.PixelType(Imath.PixelType.FLOAT) img = OpenEXR.InputFile("img_000000.exr") dw = img.header()["dataWindow"] size = (dw.max.x - dw.min.x +1, dw.max.y - dw.min.y +1)
R,G,B = [np.asarray(Image.frombytes("F", size, img.channel(Chan,pt)), dtype=np.uint8) for Chan in ("R", "G", "B") ]
img_rgb = cv2.merge([B, G, R])
print(img_rgb)
cv2.imshow("Hey",img_rgb) cv2.waitKey(0) cv2.destroyAllWindows()`
This is what im using to read the exr file
Yea for some reason I had the same issue with numpy.. You can try openexr lib, but if the jpeg is likewise black something will be off most likely.
Okay, maybe i'm dumb and everything was right on the begining. I was capturing the image on BeginPLay event, and that was the problem. Now the plugin works flawless. Thanks you very much!
Ahh yes.. that will explain the issue. Thank you for sharing this. Great to hear everything is working :) 👍
In UE5, I was also getting black textures, but I found out that it was only occurring on models using Nanite.
Thank you for letting me know! Just to clarify - black textures on Nanite objects in the capture color image? That is definitely odd... I did not yet test with Nanite objects, merely with MetaHuman :/
Forgot to clarify, it was with segmentation capture images that the color was black.
Alright, yes this will be because of Nanite seemingly not supporting a number of features (yet), amongst them - custom depth stencils: https://forums.unrealengine.com/t/solved-vertex-painting-mesh-not-working-for-imported-meshes/267082/2
Sadly those are this project's source of annotation buffer... So I think this is currently not fixable, sorry :/