Advertisement
Guest User

Untitled

a guest
Mar 24th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. int centerX = spectrumCplx.cols/2;
  2. 54 int centerY = spectrumCplx.rows/2;
  3. 55 if( flag == HIGH_PASS_FILTER ) {
  4. 56 // ponechejte pouze hodnoty spektra nad limitní frekvencí
  5. 57 for (int row = 0; row < spectrumCplx.rows; row++) {
  6. 58 for (int col = 0; col < spectrumCplx.cols; col++) {
  7. 59 if((col >= (centerX - limit_frequency/2) && col < centerX + limit_frequency/2) &&
  8. 60 (row >= (centerY - limit_frequency/2) && row < centerY + limit_frequency/2)){
  9. 61 spectrumCplx.at<cv::Vec2f>(row,col).val[0] = 0.0;
  10. 62 spectrumCplx.at<cv::Vec2f>(row,col).val[1] = 0.0;
  11. 63 }
  12. 64 }
  13. 65 }
  14. 66
  15. 67 }
  16. 68 else if( flag == LOW_PASS_FILTER ) {
  17. 69 // ponechejte pouze hodnoty spektra pod limitní frekvencí
  18. 70 for (int row = 0; row < spectrumCplx.rows; row++) {
  19. 71 for (int col = 0; col < spectrumCplx.cols; col++) {
  20. 72 if((col < (centerX - limit_frequency/2) || col > centerX -1 + limit_frequency/2) ||
  21. 73 (row < (centerY - limit_frequency/2) || row > centerY -1 + limit_frequency/2)){
  22. 74 spectrumCplx.at<cv::Vec2f>(row,col).val[0] = 0.0;
  23. 75 spectrumCplx.at<cv::Vec2f>(row,col).val[1] = 0.0;
  24. 76 }
  25. 77
  26. 78 }
  27. 79 }
  28. 80
  29. 81 }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement