How To Install OpenCV-Python in Fedora

Hello Everyone,In this tutorial we will learn to setup OpenCV-Python in  Fedora operating system. We have tested this tutorial in Fedora 18 (64-bit) and Fedora 19 (32-bit). Basically, There are two ways to install OpenCV-Python in Fedora but here we will install it using relatively easy method.

1) Install  OpenCV-Python from Pre-built Binaries

Install all packages with the command blow in terminal.

$ yum install numpy opencv*

Now, it’s time to test whether it has been installed properly or not. Open Python IDLE (or IPython) and type the codes in Python terminal.

>>> import cv2
>>> print cv2.__version__

If there are no errors then  OpenCV-Pythons is installed properly.

Arithmetic operators in Python With Example

Generally, Arithmetic operators are used to perform mathematical operations like addition, subtraction, multiplication, divison and more.

+ Addition a + b = 10
Subtraction a – b = -10
* Multiplication a * b = 20
/ Division b / a = 10
% Modulus (Divides and returns remainder) b % a = 0
** Exponent 10 ** 3
Result: 1000
// Floor Division (Division that results into whole number adjusted to the left in the number line. The result of this division is the integral part of the result) >>> 10 // 3
3 >>> 10.0 // 3
3.0 >>>

Let’s take an example, b=10,c =0

a = 21
b = 10
c = 0

c = a + b
print “Result of c is “, c

c = a – b
print “Result of c is “, c

c = a * b
print “Result of c is “, c

c = a / b
print “Result of c is “, c

c = a % b
print “Result of c is “, c

a = 2
b = 3
c = a**b
print “Result of c is “, c

a = 10
b = 5
c = a//b
print “Result of c is “, c

Produces the following result −

Result of c is 31
Result of c is 11
Result of c is 210
Result of c is 2
Result of c is 1
Result of c is 8
Result of c is 2

Python Operators

This Chapter will be give you some idea about the various built-in python operators. In python, An operator is an object that is capable of manipulating a value. Generally it is being used to manipulate the value of operands. For example, in “1 + 2”, Where 1 and 5″are called operands and + is called operator.

Types of Operator

Python language supports the following types of operators.

  • Arithmetic Operators
  • Comparison (Relational) Operators
  • Bitwise Operators
  • Logical Operators
  • Membership Operators
  • Assignment Operators
  • Identity Operators