Advertisement
r4j

Generate color bitmap

r4j
Aug 6th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.57 KB | None | 0 0
  1. mat spec_t; // after doing stft, super spectrogram... size: spec_t(1025,2002);
  2.  
  3. mat mag_spec_f = db(abs(spec_t)); // where db method: m = 10 * log10(m);
  4. cube c(mag_spec_t.size(), mag_spec_t.size(), 3);
  5. c.slice(0) = mag_spec_t; // error here
  6. c.slice(1) = 256 - abs (256 - 2 * mag_spec_t);
  7. c.slice(2) = 256 - mag_spec_t;
  8. c.save ("mag_spec_t.ppm", ppm_binary);
  9.  
  10. //Error:
  11. // error: Mat::init(): size is fixed and hence cannot be changed
  12.  
  13. //libc++abi.dylib: terminating with uncaught exception of type std::logic_error: Mat::init(): size is fixed and hence cannot be changed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement