MCPcopy Create free account
hub / github.com/cpvrlab/ImagePlay / processInputData

Method processInputData

IPL/src/processes/IPLIFFT.cpp:48–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48bool IPLIFFT::processInputData(IPLData* data , int, bool)
49{
50 IPLComplexImage* complexImageData = data->toComplexImage();
51 if (NULL == complexImageData) {
52 // TODO write an error message
53 return false;
54 }
55 _complexImage = new IPLComplexImage(*complexImageData);
56
57 // delete previous result
58 delete _result;
59 _result = NULL;
60
61 int width = _complexImage->width();
62 int height = _complexImage->height();
63
64 _result = new IPLImage(IPL_IMAGE_GRAYSCALE, width, height);
65
66 // get properties
67 //int mode = getProcessPropertyInt("mode");
68
69 int progress = 0;
70 int maxProgress = height;
71
72 _complexImage->IFFT();
73
74 float dc = _complexImage->real(0,0);
75
76 float min = _complexImage->minReal();
77 float max = _complexImage->maxReal();
78
79 float diff = max-min;
80
81 for(int y=0; y<height; y++)
82 {
83 // progress
84 notifyProgressEventHandler(100*progress++/maxProgress);
85 for(int x=0; x<width; x++)
86 {
87 float value = (_complexImage->real(x,y) - min) / diff;
88 value = (value < 0) ? 0 : value;
89 value = (value > 1) ? 1 : value;
90 _result->plane(0)->p(x, y) = value;
91 }
92 }
93
94 std::stringstream s;
95 s << "DC: ";
96 s << dc;
97 addInformation(s.str());
98
99 return true;
100}
101
102IPLData* IPLIFFT::getResultData( int )
103{

Callers

nothing calls this directly

Calls 8

toComplexImageMethod · 0.80
widthMethod · 0.80
heightMethod · 0.80
IFFTMethod · 0.80
realMethod · 0.80
minRealMethod · 0.80
maxRealMethod · 0.80
planeMethod · 0.80

Tested by

no test coverage detected