I have a question about the NrealLight camera.
I made some modifications to the OnCapturedPhotoToMemory method in PhotoCaptureExample.cs in the demo scene of Assets/NRSDK/Demos/RGBCamera-Capture, and implemented the process of saving the captured photo to the device in PNG format.
void OnCapturedPhotoToMemory(NRPhotoCapture.PhotoCaptureResult result, PhotoCaptureFrame photoCaptureFrame)
{
var targetTexture = new Texture2D(m_CameraResolution.width, m_CameraResolution.height, TextureFormat.BGRA32, false);
// Copy the raw image data into our target texture
photoCaptureFrame.UploadImageDataToTexture(targetTexture);
image = targetTexture.EncodeToPNG();
try
{
System.IO.File.WriteAllBytes(Application.persistentDataPath + "/test.png", image);
}
catch (Exception ex)
{
}
// Release camera resource after capture the photo.
this.Close();
}
When I successfully saved the file and viewed it with “adb pull” command on my PC, the photo itself seemed to have a blue tint.
When compared to the PNG file taken with the HoloLens2 from MicroSoft, the photo itself has a bluish tint.
I’m not sure if “normal” is the right word, but I’d like to know how I can improve the bluish effect and take photos normally.
If you know how to do this, please let me know.
NRSDK v1.6.0
Unity 2019.4.22f1
VisualStudio 2019 Community