0

I want to perform histogram matching on OpenCV Mat images in C++.

I know in python I can use skimage.exposure.match_histograms method.

Is there any equivalent implementation of this method in C++?

wohlstad
  • 12,661
  • 10
  • 26
  • 39
Amir
  • 3
  • 5
  • FYI: The source code of skimage is on github: [scikit-image/scikit-image](https://github.com/scikit-image/scikit-image/blob/98e157969bafabdff8b262ef2328f02c797ac8d3/skimage/exposure/histogram_matching.py). – Scheff's Cat Mar 29 '22 at 10:30
  • I found this [C++ implementation](https://github.com/samiranrl/Scilab-Toolbox/blob/master/sci_gateway/cpp/opencv_imhistmatch.cpp). – Rotem Mar 29 '22 at 20:21
  • @Rotem I tried to use your suggested implementation but it runs slowly (a couple of seconds for a 960x600 image) and output is 90 degree rotated. – Amir Mar 30 '22 at 07:19
  • You may have to reimplement it... I found a Python implementation in [this post](https://stackoverflow.com/questions/32655686/histogram-matching-of-two-images-in-python-2-x). You may have to find a C implementation of `interp`. – Rotem Mar 30 '22 at 08:06

0 Answers0