Posts

Showing posts with the label PyCharm

How to Detect Shapes in Images in Python using OpenCV

Image
  How to Detect Shapes in Images in Python using OpenCV import numpy as np import matplotlib.pyplot as plt import cv2 import sys # read the image from arguments image = cv2.imread( r'G:\PARAS\anuradha.png' ) # convert to grayscale grayscale = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY) # perform edge detection edges = cv2.Canny(grayscale, 30 , 100 ) # detect lines in the image using hough lines technique lines = cv2.HoughLinesP(edges, 1 , np.pi/ 180 , 60 , np.array([]), 50 , 5 ) # iterate over the output lines and draw them for line in lines: for x1, y1, x2, y2 in line: cv2.line(image, (x1, y1), (x2, y2), color =( 20 , 220 , 20 ), thickness = 3 ) # show the image plt.imshow(image) plt.show()

Introduction to Image Processing in Python with OpenCV

Image
  Edge Detection using Canny Edge Detector Introduction In this tutorial, we are going to learn how we can perform image processing using the Python language. We are not going to restrict ourselves to a single library or framework; however, there is one that we will be using the most frequently, the  Open CV  library. So, let's begin! What is Image Processing? It is important to know what exactly image processing is and what is its role in the bigger picture before diving into its how's. Image Processing is most commonly termed as 'Digital Image Processing' and the domain in which it is frequently used is 'Computer Vision'. Don't be confused - we are going to talk about both of these terms and how they connect. Both Image Processing algorithms and Computer Vision (CV) algorithms take an image as input; however, in image processing, the output is also an  image , whereas in computer vision the output can be some  features/information about  the image. Why do...

How to call stylesheet path Inside Python Index.html

Image
 How to call stylesheet path Inside Python Index.html  <!-- Styles --> < link href ="https://fonts.googleapis.com/css?family=Raleway:400,400i,600,700,700i &amp; subset=latin-ext" rel ="stylesheet" > < link rel ="stylesheet" href ="{{ url_for('static', filename='css/bootstrap.css') }}" > < link rel ="stylesheet" href ="{{ url_for('static', filename='css/fontawesome-all.css') }}" > < link rel ="stylesheet" href ="{{ url_for('static', filename='css/swiper.css') }}" > < link rel ="stylesheet" href ="{{ url_for('static', filename='css/magnific-popup.css') }}" > < link rel ="stylesheet" href =" {{ url_for('static', filename='css/styles.css') }} " > <!-- Favicon --> < link rel ="icon" href ="{{ url_for('static', ...