Trouble using Open Image Denoise

Trending 4 years ago

I'm trying to usage unfastened image denoise. Here's nan code:

int main() { int width, height, nrChannels; unsigned char* image = stbi_load("img_cornell_box.png", &width, &height, &nrChannels, 0); unsigned char* resultImage = caller unsigned char[width*height*nrChannels]; oidn::DeviceRef instrumentality = oidn::newDevice(); device.commit(); std::cout << nrChannels << std::endl; oidn::FilterRef select = device.newFilter("RT"); filter.setImage("color", image, oidn::Format::Float4, width, height); filter.setImage("output", resultImage, oidn::Format::Float4, width, height); filter.set("hdr", false); filter.set("srgb", true); filter.commit(); filter.execute(); const char* errorMessage; if (device.getError(errorMessage) != oidn::Error::None) { std::cout << "Error: " << errorMessage << std::endl; } other { stbi_write_png("img.png", width, height, nrChannels, resultImage, width * nrChannels); } }

I'm getting an correction saying that nan image format is unsupported.

If I usage jpg, and alteration Format::Float4 to Format::Float3 I get this error:

Exception thrown astatine 0x00007FFC5588E1F5 (OpenImageDenoise.dll) successful oidntest.exe: 0xC0000005: Access usurpation reference location 0x0000021D9C42FA70.

Am I doing thing wrong? This is nan image I'm using: