...
 
Commits (2)
......@@ -12,7 +12,7 @@ namespace cve {
namespace complex {
cv::Mat1d magnitude(const cv::Mat2d & csi) {
auto magnitude = cv::Mat1d(csi.size());
cv::Mat1d magnitude = cv::Mat1d::zeros(csi.size());
for(auto i = 0 ; i < csi.total(); i++) {
magnitude(i) = cv::norm(csi(i));
}
......@@ -21,12 +21,12 @@ namespace cve {
}
cv::Mat1d phase(const cv::Mat2d & csi) {
auto phase = cv::Mat1d(csi.size());
cv::Mat1d phase = cv::Mat1d::zeros(csi.size());
for(auto i = 0 ; i < csi.total(); i++) {
auto complexNumber = csi(i);
phase(i) = atan2(complexNumber(2), complexNumber(1));
phase(i) = atan2(complexNumber(1), complexNumber(0));
}
return phase;
}
......