Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int centerX = spectrumCplx.cols/2;
- 54 int centerY = spectrumCplx.rows/2;
- 55 if( flag == HIGH_PASS_FILTER ) {
- 56 // ponechejte pouze hodnoty spektra nad limitní frekvencí
- 57 for (int row = 0; row < spectrumCplx.rows; row++) {
- 58 for (int col = 0; col < spectrumCplx.cols; col++) {
- 59 if((col >= (centerX - limit_frequency/2) && col < centerX + limit_frequency/2) &&
- 60 (row >= (centerY - limit_frequency/2) && row < centerY + limit_frequency/2)){
- 61 spectrumCplx.at<cv::Vec2f>(row,col).val[0] = 0.0;
- 62 spectrumCplx.at<cv::Vec2f>(row,col).val[1] = 0.0;
- 63 }
- 64 }
- 65 }
- 66
- 67 }
- 68 else if( flag == LOW_PASS_FILTER ) {
- 69 // ponechejte pouze hodnoty spektra pod limitní frekvencí
- 70 for (int row = 0; row < spectrumCplx.rows; row++) {
- 71 for (int col = 0; col < spectrumCplx.cols; col++) {
- 72 if((col < (centerX - limit_frequency/2) || col > centerX -1 + limit_frequency/2) ||
- 73 (row < (centerY - limit_frequency/2) || row > centerY -1 + limit_frequency/2)){
- 74 spectrumCplx.at<cv::Vec2f>(row,col).val[0] = 0.0;
- 75 spectrumCplx.at<cv::Vec2f>(row,col).val[1] = 0.0;
- 76 }
- 77
- 78 }
- 79 }
- 80
- 81 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement