#include <FisherMatrix.h>
|
| SampleFisherMatrix (float maxValue) |
|
Matrix3X3 | Compute (vector3f pos, vector3f delta, ImageData &lut, int w, int h, float zlutMinRadius, float zlutMaxRadius) |
|
Matrix3X3 | Compute (vector3f pos, vector3f delta, int w, int h, std::function< void(ImageData &out, vector3f pos)> imageGenerator) |
|
Matrix3X3 | ComputeAverageFisher (vector3f pos, int Nsamples, vector3f sampleRange, vector3f delta, int w, int h, std::function< void(ImageData &out, vector3f pos)> imggen) |
|
Definition at line 8 of file FisherMatrix.h.
§ SampleFisherMatrix()
SampleFisherMatrix::SampleFisherMatrix |
( |
float |
maxValue | ) |
|
|
inline |
§ Compute() [1/2]
Definition at line 38 of file FisherMatrix.h.
void GenerateImageFromLUT(ImageData *image, ImageData *zlut, float minradius, float maxradius, vector3f pos, bool splineInterp, int oversampleSubdiv)
static TImageData alloc(int w, int h)
Matrix3X3 Compute(vector3f pos, vector3f delta, ImageData &lut, int w, int h, float zlutMinRadius, float zlutMaxRadius)
§ Compute() [2/2]
Definition at line 48 of file FisherMatrix.h.
54 imageGenerator(mu, pos);
56 float maxImg = mu.mean();
61 imageGenerator(imgpx,
vector3f(pos.
x+delta.
x, pos.
y,pos.
z));
62 imageGenerator(imgpy,
vector3f(pos.
x, pos.
y+delta.
y,pos.
z));
63 imageGenerator(imgpz,
vector3f(pos.
x, pos.
y,pos.
z+delta.
z));
72 imageGenerator(imgmx,
vector3f(pos.
x-delta.
x, pos.
y,pos.
z));
73 imageGenerator(imgmy,
vector3f(pos.
x, pos.
y-delta.
y,pos.
z));
74 imageGenerator(imgmz,
vector3f(pos.
x, pos.
y,pos.
z-delta.
z));
96 fisher(0,0) = Ixx; fisher(0,1) = Ixy; fisher(0,2) = Ixz;
97 fisher(1,0) = Ixy; fisher(1,1) = Iyy; fisher(1,2) = Iyz;
98 fisher(2,0) = Ixz; fisher(2,1) = Iyz; fisher(2,2) = Izz;
101 imgpx.free(); imgpy.free(); imgpz.free();
102 imgmx.free(); imgmy.free(); imgmz.free();
void ImgDeriv(TImageData< T > &imgpx, TImageData< T > &imgmx, T delta)
static TImageData alloc(int w, int h)
double FisherElem(TImageData< T > &mu, TImageData< T > &muderiv1, TImageData< T > &muderiv2)
vector3< float > vector3f
§ ComputeAverageFisher()
Definition at line 107 of file FisherMatrix.h.
111 auto f = [&] (
int index) {
112 vector3f smpPos = pos + sampleRange*
vector3f(rand_uniform<float>()-0.5f,rand_uniform<float>()-0.5f, rand_uniform<float>());
114 results[index] =
Compute(smpPos, delta, w,h, imggen);
121 for (
int i=0;i<Nsamples;i++)
123 pool.WaitUntilDone();
125 for (
int i=0;i<Nsamples;i++)
129 for (
int i=0;i<Nsamples;i++)
134 matrix *= 1.0f/Nsamples;
vector3< float > vector3f
Matrix3X3 Compute(vector3f pos, vector3f delta, ImageData &lut, int w, int h, float zlutMinRadius, float zlutMaxRadius)
§ FisherElem()
Definition at line 22 of file FisherMatrix.h.
25 for (
int y=0;y<mu.
h;y++) {
26 for (
int x=0;x<mu.
w;x++)
27 sum += (
double)muderiv1.
at(x,y) * (double) muderiv2.
at(x,y) / (1e-5f + (double)mu.
at(x,y));
§ ImgDeriv()
Definition at line 14 of file FisherMatrix.h.
16 T inv2d = 1.0f/(2*delta);
17 for (
int y=0;y<imgpx.
w*imgpx.
h;y++)
18 imgpx[y] = (imgpx[y] - imgmx[y]) * inv2d;
§ maxValue
float SampleFisherMatrix::maxValue |
|
private |
The documentation for this class was generated from the following file: