Skip to Content
Computer Vision with OpenCV 3 and Qt5
book

Computer Vision with OpenCV 3 and Qt5

by Amin Ahmadi Tazehkandi
January 2018
Intermediate to advanced content levelIntermediate to advanced
486 pages
11h 28m
English
Packt Publishing
Content preview from Computer Vision with OpenCV 3 and Qt5

Histogram comparison

Two histograms calculated by using the calcHist function, or loaded from disk and filled into a Mat class, or literally created with any method, can be compared with each other to find the distance or difference (or divergence) between them, by using the compareHist method. Note that this is true as long as the Mat structure of the histograms is consistent with what we saw before, meaning the number of columns, depth, and channels.

The compareHist function takes two histograms stored in Mat classes and a comparison method, which can be one of the following constants:

  • HISTCMP_CORREL
  • HISTCMP_CHISQR
  • HISTCMP_INTERSECT
  • HISTCMP_BHATTACHARYYA
  • HISTCMP_HELLINGER
  • HISTCMP_CHISQR_ALT
  • HISTCMP_KL_DIV

Note that the return value of ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering OpenCV 4 - Third Edition

Mastering OpenCV 4 - Third Edition

Roy Shilkrot, David Millán Escrivá
Hands-On Computer Vision with TensorFlow 2

Hands-On Computer Vision with TensorFlow 2

Benjamin Planche, Eliot Andres
OpenCV 4 with Python Blueprints - Second Edition

OpenCV 4 with Python Blueprints - Second Edition

Dr. Menua Gevorgyan, Michael Beyeler (USD), Arsen Mamikonyan, Michael Beyeler

Publisher Resources

ISBN: 9781788472395Supplemental Content