Skip to content

zhaoxuhui/Entropy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

2cb6705 · May 13, 2024

History

12 Commits
Aug 27, 2019
Aug 27, 2019
Feb 17, 2024
Jul 10, 2022
Aug 27, 2019

Repository files navigation

Entropy

code for calculating image entropy

  • python code is under python folder

  • c++ code is under c++ folder

  • test images are under imgs folder

Python codes(Python 2 & Python 3)

entropy.py

It contains the basic code for 1-D image entropy.

entropy2d.py

It contains the basic code for 2-D image entropy.The code will run very slowly,it is kept just for beginners to learn the basic principles and methods.Remember DO NOT use it for practical circumstance.

entropy2dSpeedUp.py

It contains optimized code for better performance,and it is very recommanded to use it in practical circumstance.

entropy2dCounter.py

It is the same with entropy2dSpeedUp.py,I just add some time evaluating code into it.

entropy2dMyFij.py

I write the code for calculating Fij with my algorithm in this file.The performance is a little slower than entropy2dSpeedUp.py,but the algorithm is very useful in c++ codes.

C++ codes

The whole project is arranged by CMake. If you want to run it,you must have a CMake environment on your computer.The only dependence library is OpenCV.The exe file is under cmake-build-debug folder,name is entropy2d.

Tips

After many tests,C++ project has a best performance,which is shown below.

So if you can satisfy the requirements for c++ project mentioned above,it's best to use it.If not, you can choose the python code entropy2dSpeedUp.py,it will provide almost the greatest performance.

Last but not least,if you have any thing to say, don't forget to open an issue or contact me.