-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImageProcessor.cpp
41 lines (33 loc) · 1.07 KB
/
ImageProcessor.cpp
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
#include "ImageProcessor.h"
#include "ImageMatrix.h"
#include "ImageLoader.h"
#include "Convolution.h"
#include "ImageSharpening.h"
#include "EdgeDetector.h"
#include "DecodeMessage.h"
#include "EncodeMessage.h"
#include <iostream>
ImageProcessor::ImageProcessor() {
}
ImageProcessor::~ImageProcessor() {
}
std::string ImageProcessor::decodeHiddenMessage(const ImageMatrix &img) {
ImageMatrix matrix(img);
ImageSharpening sharp;
ImageMatrix sharpMatrix=sharp.sharpen(matrix,2);
EdgeDetector edge;
edgePix = edge.detectEdges(sharpMatrix);
DecodeMessage decode;
return(decode.decodeFromImage(sharpMatrix,edgePix));
}
ImageMatrix ImageProcessor::encodeHiddenMessage(const ImageMatrix &img, const std::string &message) {
//Sharpening the image to get the edge pixels:
ImageMatrix matrix(img);
ImageSharpening sharp;
ImageMatrix sharpMatrix=sharp.sharpen(matrix,2);
EdgeDetector edge;
edgePix = edge.detectEdges(sharpMatrix);
//Encoding the message
EncodeMessage msg;
return(msg.encodeMessageToImage(img,message,edgePix));
}