I would like code to reproduce the Periodic plus smooth image decomposition by Lionel…
- User
I would like code to reproduce the Periodic plus smooth image decomposition by Lionel Moisan but using C++ with Arrayfire on Ubuntu 22.04.. A python version with a test image is online at https://github.com/jacobkimmel/ps_decomp. I would like the Arrayfire C++ version to use Arryafire's fftR2C and fftC2R functions to take advantage of additional speed and reduced memory for very large images once the basic code is working.
- Assistant
- User
I would like several revisions. First, please use fftR2C and fftC2R as requested. Second, rather than displaying the result please write them to individual appropriately named pgm files.
- Assistant
- User
Proper use of these fft functions can be done by including the required additional arguments, for example as shown in https://sos-software.com/wp-content/uploads/parallel-universe-issue-48.pdf p39, af::fftR2C<2>(img1, 0.0);
- Assistant
- User
There have been problems with the use of the wrong double quotes. It needs " but is that a cut and paste error or is it wrong in the code as you have produced it? Also other compile errors starting at line 8... af-sp2.cpp: In function ‘af::array computeSpectrum(const af::array&)’: af-sp2.cpp:8:17: error: ‘cast’ was not declared in this scope 8 | array img = cast(input);
- Assistant
- User
This still gives quotation errors which I have been correcting but now that we have gone to this many revisions that is no longer practical ... error: extended character “ is not valid in an identifier 50 | std::cout << “Converged after " << i + 1 << " iterations.” << std::endl; ..... More importantly however this still gives other compile errors such as ... 8:17: error: ‘cast’ was not declared in this scope 8 | array img = cast(input);
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.