Posts

Showing posts with the label python

DISCRETE FOURIER TRANSFORMATION(DFT)

Image
In this post we are gonna learn about fourier transformation and implementation of Discrete fourier transformation in python. Why we need to use fourier transformation anyway...a normal periodic wave like sine wave has 3 characterstics like Phase,amplitude,frequency that tell us about the wave..it's easy and understandable but what if a wave is unperiodic like this ex. in this example it is not a periodic sinewave..so but an multiple frequencies of waves added together. Hence to analyse these kind of waves we need fourier transformation in signal processing. The fourier transforamation is applied in both Continous and Discrete waves . .In this we are gonna concentrate in DFT(Discrete fourier transformation)..and to visulalize the wave we are gonna use python(cause it's easy to use). we need the following python library to do this : 1.numpy    2.seaborn    3.mathplotlib     DFT(DISCRETE FOURIER TRANSFORMATION) It is applied to specifically discete signals. It is used to break th

PYSERIAL WITH ARDUINO(comms with arduino from pc)

Image
In this post we're gonna learn about "pyserial"  python language library package to communicate or log data from arduino to pc (or) we can get rid of the serial port of arduino.H ence we do the same as we do in serial monitor. the module can be installed using pip   for linux: " sudo python -m pip install pyserial"   for windows : " pip install pyserial" here is a small arduino skecth for reading from terminal or cmd from arduino serial port code: import serial as sl #importing the serial lib as name sl import time mon = '/dev/ttyACM0' #declearing a variable for port name baud = 9600 #defining baud rate arduino = serial . Serial(mon, baud, timeout =. 1 ) while True : mon = arduino . readline() print ( 'the read data:,mon' ) #printing message for reading data from serial here is the python file for data loging code: import serial arduino_port = "/dev/ttyACM0" #serial port of Arduino ba

HOW TO WRITE A CLASS OBJECT IN PYTHON

Image
The one way to get started with  the object oriented programming in python is to get started with the " creating a class object and using it". things u need to get started: 1. Latest version of python3  u can get that from here  2. An ide or u can use python default ide which it comes with! that's all u need to get started. here we are gonna make code for math function called standard scaler(for scaling data). you make one for anything u want I'm just a math guy!!  so the math formula for standard scaler is : hence we start with a class object called Scale , the class object doesn't need any input variable for it's name we do it in functions inside of it. The first function inside of class object should be a __init__() " function it must be..! next, an __init__() function should always starts with a " self " variable and other as   follows  by as other variables u may like... class Scale:         def _init_ ( self , data ):              s

video face detection using HAAR'S CASCADE with python

Image
face detection using HAAR'S CASCADE with python In this tutorial we're gonna look into a face detection using "HAAR's CASCADE" algorithm in open cv.  haar's cascade a is face detection classifier built-in  opencv for face and many more detection. Haar's cascade is originally developed from viola-jones algorithm . but it's not perfect it is prone to noise often, and this algorithm is best suited for frontal face detection, but for just simplicity we use it today. Let's be clear about 2 things they are face Recognization and face detection. They both are 2 separate things. This haars cascade focus and used for face detection means in picture or a video it can detect the faces. Where face recognization is detecting a particular face of person. The problem in computer vision has been bothered so long untill  Development began on similar systems in the 1960s, here is wiki page on history of face detection . The viola jones algorithm achived the face

simple color tracking using opencv(no machine learning mombo jambo!)

Image
                              In this method we are using opencv and python for identifying a color and hilight it. this method uses the simple Bitwise and operation and image "HSV(hue,saturation,value)" manupulation of colors.                      The HSV value of image is represent the original colors of image though the RGB or BGR cannot tell the difference between the levels of colors hence this method only to work with HSV images since the HUE tells the color and saturation tells the level of color.                       here i'm tracking blue levels of colors in HSV u can track any color u want you need the hsv value for that, i suggest to use max value of upper color and min value for lower colorat start and play around the values untill u get statisfied results or just google it!.                      To get started u need few things, and just few line of codes you get ur face detection. we need the following things to get started: 1.python 3 recent would be nice

computer vision(opencv) with python

Image
face detection using HAAR'S CASCADE with python In this tutorial we're gonna look into a face detection using "HAAR's CASCADE" algorithm in open cv. haar's cascade a is face detection classifier built-in  opencv for face and many more detection. Haar's cascade is originally developed from viola-jones algorithm. but it's not perfect it is prone to noise often, but for just simplicity we use it today. "using this method we can also detect many other features like face,eyes,full body,lowerbody,russian number_plates,etc.." here the same method modified for video face detection to get started u need few things, and just few line of codes you get ur face detection. we  need the following things to get started: 1.python 3 recent would be nice! 2.opencv lib package installed using pip 3.laptop/desktop with webcam step 1:               go to www.python.org and download latest version of python3  choose the install python along with pip and Option say

1 Best way to add members to Telegram group(2021 using python)

Image
This post for those who want to add members to thier telegram group, which could take forever if we do manually, hence we can automate this take.  I 'm using python for this automation. Using the python script called telethon we can add members to the group.  T he daliy limit is 200 members. The script adds members with 60-180 sec intervals to avoid bans. you need the following installed in your computer : 1.python 3 (recent one would be better) 2.pip install of python installed(we can enable this option while install python choosing custom install) 3.telethon package installed using pip installer. 4.telegram group api registered in the telegram website. 5.good internet(mandatory) 1.Install python 3 CODE :  visit  python.org  for downloading and installing the windows pacakge. Note: 1.choose the custom installing to enable necessary installers in windows.             2.if you are on the linux or mac python is defaultly installed. just update it.   2. pip installer   Note: in linux