Laplacian filter
Implementation
void cv_apply_laplacian_filter(Image* img, float sigma, int kernSize) {
/* ... */
float sigma1 = sigma;
int kernSize1 = kernSize * 1.5 + 1;
cv_apply_gaussian_blur(img, sigma1, kernSize1);
/* ... */
cv_apply_gaussian_blur(&copiedImage, sigma, kernSize);
for (int i = 0; i < height; i++) {
for (int j = 0; j < width; j++) {
for (int c = 0; c < channels; c++) {
int index = (i * width + j) * channels + c;
img->bytes[index] = img->bytes[index] - copiedImage.bytes[index];
}
}
}
/* ... */
}Result


Problems
Last updated