Ingen beskrivning

Filter.cpp 1.6KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. #include "mainwindow.h"
  2. #include <iostream>
  3. #include <cassert>
  4. using namespace std;
  5. void messageBox(const QString &st) {
  6. QMessageBox* msgBox = new QMessageBox();
  7. msgBox->setWindowTitle("Pesky Tourist");
  8. msgBox->setText(st);
  9. msgBox->setWindowFlags(Qt::WindowStaysOnTopHint);
  10. msgBox->show();
  11. }
  12. // Given a vector of ints, sorts it in ascending order
  13. void Sort(vector<int> &V){
  14. // Implement your selection sort algorithm here
  15. }
  16. // Given a (possibly unsorted) vector of ints, returns its median
  17. int Median(vector<int> &V){
  18. // Implement your median function ...
  19. return 0;
  20. }
  21. // Given a (possibly unsorted) vector of QRgbs, returns the median
  22. // composed of the medians of the color components.
  23. QRgb MedianPixel(const vector<QRgb> &V){
  24. // Implement you pixel median function here....
  25. return qRgb(0,0,0);
  26. }
  27. void test_Sort() {
  28. // Implement your unit test for sort here .....
  29. // You may change this to a congratulatory message once you
  30. // implement this unit test :-)
  31. messageBox("Sort unit test not yet implemented!!");
  32. }
  33. void test_Median() {
  34. // Implement your unit test for median here .....
  35. messageBox("Median unit test not yet implemented!!");
  36. }
  37. void test_MedianPixel() {
  38. // Implement your unit test for median pixel here .....
  39. messageBox("MedianPixel unit test not yet implemented!!");
  40. }
  41. void MainWindow::RemoveNoise(const vector<QImage> & images, QImage & finalImage){
  42. test_Sort();
  43. test_Median();
  44. test_MedianPixel();
  45. // Implement the filter here! See the algorithm in the lab
  46. messageBox("RemoveNoise function not yet implemented!!!");
  47. }