Posts

Showing posts with the label line reading in python

Python Getting Started

  Python  Getting Started Python Install Many PCs and Macs will have python already installed. To check if you have python installed on a Windows PC, search in the start bar for Python or run the following on the Command Line (cmd.exe): C:\Users\ Your Name >python --version To check if you have python installed on a Linux or Mac, then on linux open the command line or on Mac open the Terminal and type: python --version If you find that you do not have Python installed on your computer, then you can download it for free from the following website:  https://www.python.org/ Python Quickstart Python is an interpreted programming language, this means that as a developer you write Python (.py) files in a text editor and then put those files into the python interpreter to be executed. The way to run a python file is like this on the command line: C:\Users\ Your Name >python helloworld.py Where "helloworld.py" is the name of your python file. Let's write our first Python fi

Use Open cv to analyze the palm line main line extraction! How to do scientific fortune telling?

Image
  Use Open cv to analyze the palm line main line extraction! How to do scientific fortune telling? We will use Python and OpenCV libraries in this article to find the main lines in our palms. First, let's read the original image: import cv2 image = cv2.imread( r'G:\PARAS\palm.jpeg' ) cv2.imshow( "palm" ,image) #to view the palm in python cv2.waitKey( 0 ) #Now we will use a filtering algorithm called Canny Edge Detector # to find the palm print. For different images, we need to change the parameters accordingly. gray = cv2.cvtColor(image,cv2.COLOR_BGR2GRAY) #Now we convert the image to grayscale: edges = cv2.Canny(gray, 60 , 65 , apertureSize = 3 ) cv2.imshow( "edges" ,edges) cv2.waitKey( 0 ) #Now we will reverse the color to ensure that the recognized line is black: edges = cv2.bitwise_not(edges) cv2.imshow( "change black and white" ,edges) cv2.waitKey( 0 ) #Now we mix the image above with the original image. cv2.imwrite( "palmlines.jpg&qu