14
edits
Changes
→IPP Implementation Summary
=='''IPP Implementation Summary'''==
void IppImgProc::brighten(int brightness, int scaleFactor)
{
// Create a matrix for the output image
outImg_ = cv::Mat::zeros(img_.size(), img_.type());
// Convert the image to 8-bit format
img_.convertTo(gray8Img_, CV_8U);
// Get the image dimensions
width_ = gray8Img_.cols;
height_ = gray8Img_.rows;
// Create an IPP image for the input image data
IppiSize roi = { width_, height_ };
Ipp8u* pData = gray8Img_.data;
int step = gray8Img_.step;
// Set up the brightening parameters
Ipp8u value[3] = { static_cast<Ipp8u>(brightness), static_cast<Ipp8u>(brightness), static_cast<Ipp8u>(brightness) };
IppStatus status = ippiAddC_8u_C3RSfs(pData, step, value, outImg_.data, outImg_.step, roi, scaleFactor);
// Measure the time it takes to perform the brightening operation using IPP
status = ippiAddC_8u_C3RSfs(pData, step, value, outImg_.data, outImg_.step, roi, scaleFactor);
// Check for errors
if (status != ippStsNoErr) {
throw std::runtime_error("IPP error");
}
}
== '''TBB Implementation Summary''' ==