1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #28324 from raimbekovm:fix-kaze-charbonnier

features2d: add missing KAZE DIFF_CHARBONNIER support #28324

### Description

This PR fixes the missing implementation for `DIFF_CHARBONNIER` diffusivity type in KAZE feature detector.

### Changes
- Added `charbonnier_diffusivity()` call for `DIFF_CHARBONNIER` type in `Create_Nonlinear_Scale_Space()`
- Added proper error handling for unsupported diffusivity types

### Problem
When using KAZE with `DIFF_CHARBONNIER` diffusivity type, keypoint coordinates were not computed at subpixel level, because the code lacked the specific handling for this diffusivity mode.

### Solution
The `charbonnier_diffusivity()` function already exists in `nldiffusion_functions.cpp`, it just wasn't being called. This PR adds the missing `else if` branch to call it, matching the pattern already implemented in `AKAZEFeatures.cpp`.

Fixes #27134

### Pull Request Readiness Checklist

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another copyleft license.
- [x] The PR is proposed to the proper branch.
- [x] There is a reference to the original bug report and related work
- [ ] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
Murat Raimbekov
2026-02-11 18:06:26 +06:00
committed by GitHub
parent a87c227400
commit dc0a276edc
2 changed files with 45 additions and 0 deletions
@@ -128,6 +128,10 @@ int KAZEFeatures::Create_Nonlinear_Scale_Space(const Mat &img)
pm_g2(evolution_[i].Lx, evolution_[i].Ly, Lflow, options_.kcontrast);
else if (options_.diffusivity == KAZE::DIFF_WEICKERT)
weickert_diffusivity(evolution_[i].Lx, evolution_[i].Ly, Lflow, options_.kcontrast);
else if (options_.diffusivity == KAZE::DIFF_CHARBONNIER)
charbonnier_diffusivity(evolution_[i].Lx, evolution_[i].Ly, Lflow, options_.kcontrast);
else
CV_Error_(Error::StsError, ("Diffusivity is not supported: %d", static_cast<int>(options_.diffusivity)));
// Perform FED n inner steps
for (int j = 0; j < nsteps_[i - 1]; j++)