mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 19:36:26 +02:00
[CCV] Prevented unintended modifications of matrices
Signed-off-by: Jim Martens <github@2martens>
This commit is contained in:
@ -4,14 +4,13 @@ gauss_pyramid::gauss_pyramid() {}
|
||||
|
||||
gauss_pyramid::gauss_pyramid(cv::Mat img, float sigma, int number_of_layers)
|
||||
{
|
||||
_layers.push_back(img);
|
||||
cv::Mat blurredImage;
|
||||
cv::Mat resizedImage = img;
|
||||
for (int i = 1; i < number_of_layers; i++)
|
||||
cv::Mat resizedImage = img.clone();
|
||||
for (int i = 0; i < number_of_layers; i++)
|
||||
{
|
||||
cv::GaussianBlur(resizedImage, blurredImage, cv::Size(0, 0), sigma, sigma, cv::BORDER_REPLICATE);
|
||||
_layers.push_back(blurredImage.clone());
|
||||
cv::resize(blurredImage, resizedImage, cv::Size(), 0.5, 0.5, cv::INTER_NEAREST);
|
||||
_layers.push_back(resizedImage);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user