-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
56 lines (56 loc) · 1.88 KB
/
main.cpp
File metadata and controls
56 lines (56 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/**************************************************************************
* Copyright (C) 2019-3019 Haoze Chen, Yunhao Du, Lanaiya Wu, Jong Bin Beak
*
* This file is a part of CS-124-02 team project named "Photo Magician"
*
* This project can be copied and/or distributed without the express
* permission of anybody!
***************************************************************************/
#include "maxHeap.h"
#include "minHeap.h"
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <stdlib.h>
using namespace std;
void readHeader(vector<string>,string);
void readImage(vector<string>,string,string);
void writeImage(vector<int>,string);
void medianFilter(vector<vector<int>>,vector<int>,int,string);
using namespace std;
int main()
{
cout<<"Welcome to HYJL's Photo Magician!"<<endl;
int choice=0;
while(choice!=2)
{
cout<<"What do you want to do?"<<endl;
cout<<"1 - Remove peopel from photoes"<<endl;
cout<<"2 - Quit"<<endl;
cin>>choice;
while(choice!=1&&choice!=2)
cin>>choice;
// First read all the image files that we have
vector<string>fileVector; //vector to store file name
string fileName;//fileName elements to be stored into fileVector
cout<<"Enter the file folder name that you want to process (image1 or image2): ";
string folderName;
cin>>folderName;
string str = "cd " + folderName + " && ls *.ppm > ../fileNameLog && cd ..";
const char* command = str.c_str();
system(command);//get file name into fileNames, and go back to project directory
ifstream fileNameReader("fileNameLog");
while(getline(fileNameReader,fileName))
fileVector.push_back(fileName);//push file names into files vector
readHeader(fileVector,folderName);
cout<<"Display the result image?(1-yes / 2-No): ";
cin>>choice;
while(choice!=1&&choice!=2)
cin>>choice;
if(choice==1)
system("display result.ppm");
}
return 0;
}