-
Notifications
You must be signed in to change notification settings - Fork 0
/
Convolution.h
31 lines (24 loc) · 1.05 KB
/
Convolution.h
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
// Convolution.h
#ifndef CONVOLUTION_H
#define CONVOLUTION_H
#include "ImageMatrix.h"
// Class `Convolution`: Provides the functionality to convolve an image with
// a kernel. Padding is a bool variable, indicating whether to use zero padding or not.
class Convolution {
public:
// Constructors and destructors
Convolution(); // Default constructor
Convolution(double** customKernel, int kernelHeight, int kernelWidth, int stride, bool padding); // Parametrized constructor for custom kernel and other parameters
~Convolution(); // Destructor
Convolution(const Convolution &other); // Copy constructor
Convolution& operator=(const Convolution &other); // Copy assignment operator
ImageMatrix convolve(const ImageMatrix& input_image) const; // Convolve Function: Responsible for convolving the input image with a kernel and return the convolved image.
private:
// Add any private member variables and functions .
double** kernel_matrix;
int height;
int width;
int stride;
bool padding;
};
#endif // CONVOLUTION_H