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

How to improve the quality of captured images #11

Closed
Cyanostorm opened this issue Apr 9, 2021 · 8 comments
Closed

How to improve the quality of captured images #11

Cyanostorm opened this issue Apr 9, 2021 · 8 comments

Comments

@Cyanostorm
Copy link

Hi! I tried to extract visual features from these captured images, but just found that the image quality is not good enough for supporting my algorithm to run through it.

So I really want to know if there is any way to improve the quality of stored images (I don't care whether huge volumn of raw data will slow down my game or not) and forget about the performance, the clearer the images I get the better!

For now, I've tried several ways but none of them have achieved my goal.

  • increase the value of renderTarget2D->SizeX in SetupColorCaptureComponent() does not provide any help
  • change renderTarget2D->InitCustomFormat(640, 480, PF_B8G8R8A8, true); to
    renderTarget2D->InitCustomFormat(640, 480, PF_R32G32B32A32_UINT, true); and
    renderTarget2D->RenderTargetFormat = ETextureRenderTargetFormat::RTF_RGBA32f.
    Of course the same operation will be done in the Tick() function, but this end up to a bad result that AsyncSaveImageToDiskTask cannot cope with TArray<uint32>
  • in SetupColorCaptureComponent(), add captureComponent->GetCaptureComponent2D()->ShowFlags.ScreenPercentage = 200 and
    captureComponent->GetCaptureComponent2D()->ShowFlags.SetScreenPercentage(true)
    this was done since I found that if you increase the "Screen Percentage" value from the menu in viewport, the quality of showing pictures in viewport will become much better and I don't know why. But adding this in C++ codes does not get any improvement either.
@Cyanostorm
Copy link
Author

If you have any idea, just enlighten me please. Thank you so much!

@TimmHess
Copy link
Owner

TimmHess commented Apr 9, 2021

Hey :)

could you define 'image quality", I assume you mean something like bad edges due to poor antialiasing?
If the screen percentage option does not work (which I also found when I tried it) you can of course create the same effect by rendering the images in double or triple the resolution and downscale later in the data loading for your application. (For that matter, please resort to the code in the plugin.. in the project's CaptureManager.cpp the frame width is set every tick to a hardcoded value which is absolutely not desirable! - I will fix that once I am back at my workstation.)

Does that help you in any way? :)

@Cyanostorm
Copy link
Author

Hi ! Thank you so much for your answer.

It really helps me to improve the image quality mostly refers to higher definition and better antialiasing in my purpose of usage. It seems rendering the images to bigger resolution and then downscaling to be the only way to get better pictures.

I've tried rendering 1280x960 and 6400x4800 different resolution later using OpenCV cv::resize() to downscale all of them to 640x480, and I can get clearer pictures. But the aliasing effect does not show much improvement and I found temporalAA performs better than another two methods. Maybe this is an unsolved problem due to the online rendering engine itself I think.

@TimmHess
Copy link
Owner

Hey, glad I could help a little.

TemporalAA is also my method of choice, because I get really bad results for any other AA method. It of course comes with the downside of needing a number of consecutive frames before achieving best results. In cases where you maybe need to resample the scene-setting such that the previous frame and the current frame are not exactly dependent on one another, I sometimes simply add a small delay to let the engine catch up to full quality. This is especially nice when raytracing.

There also seems to be a method to force max quality without any regard to frame-rate in the RenderQueue feature. Though I did not dig in too deep into it yet, and I don't know whether it only applies to movie-render like scenarios or if it works with procedural setups that include manipulation of camera positions etc.

@csongorkeller
Copy link

Hi there,
tried the plugin with some metahuman characters, but the image quality is not that good. Do you have any idea how I can make it better.
Like the one attached.
Screenshot 2021-10-19 at 16 08 55
?

@TimmHess
Copy link
Owner

Sorry, I do not have an immediate fix for this. It looks like some rendering properties are turned off in the capture component that massively affects shading, but I will have to do an example project myself first..

@csongorkeller
Copy link

Can you maybe help me what part of the project I should check? So here the goal would be to be as photo realistic as possible...

@TimmHess
Copy link
Owner

TimmHess commented Nov 3, 2021

Is the view from your main camera working? I just tested with the MetaHuman sample project and got the result attached below. When migrating the MetaHuman rig, the engine showed a number of settings that it would like to adjust and I let it.
img_000000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants