mercredi 21 août 2024

How to install opencv and opencv-devel in Oracle Linux 9

 If you are looking on how to install opencv and opencv-devel on Oracle Linux 9, here is the answer:

dnf config-manager --add-repo https://yum.oracle.com/repo/OracleLinux/OL9/developer/EPEL/x86_64

dnf update

dnf install opencv

dnf install opencv-devel


Done.

Did this help? Leave a comment below.


mardi 21 février 2017

Geometric mean in Python

Here is a small snippet of code that can be used to compute geometric mean of a set of numbers in Python:

import math

def geomean(listofvalues):
    s=0
    for v in listofvalues:
        s+=math.log10(v)
    s=s/len(listofvalues)
    s=math.pow(10,s)
    return s

# main function
def main():
    #test sample
    list=[4,4,4,5]
    y=geomean(list)
    print(y)

# main fucntion call
if __name__ == "__main__":
    main()