Open main menu

CDOT Wiki β

Changes

GPU621/Group 3

3 bytes removed, 18:08, 9 April 2023
Optimizing Image Processing using Intel's Data Analytics Library for Parallel computing and Vectorization
<syntaxhighlight lang="cpp">void openMP_imgProcessor::sharpenImg(cv::Mat& image) {
//supressing OpenCV messages
std::streambuf* coutbuf = std::cout.rdbuf();
std::cout.rdbuf(nullptr);
 
// Convert the image to grayscale
cv::Mat grayscale;
cv::cvtColor(image, grayscale, cv::COLOR_BGR2GRAY);
//
// Apply the kernel to the grayscale image
//finds areas with quick jumps from dark to light, increases contrast there
}
}
 
//stop supressing
std::cout.rdbuf(coutbuf);
}</syntaxhighlight lang="cpp">
<syntaxhighlight lang="cpp">void openMP_imgProcessor::brightenImg(cv::Mat& image, int brightnessLvl) {
//supressing OpenCV messages
std::streambuf* coutbuf = std::cout.rdbuf();
std::cout.rdbuf(nullptr);
//
int width = image.cols;
int height = image.rows;
int channels = image.channels();
//
#pragma omp parallel for
for (int row = 0; row < height; row++) {
}
}
 
//stop supressing
std::cout.rdbuf(coutbuf);
}</syntaxhighlight lang="cpp">
72
edits