Opencv project link
https://www.kaggle.com/code/bulentsiyah/learn-opencv-by-examples-with-python/notebook
Dataset link
https://www.kaggle.com/code/bulentsiyah/learn-opencv-by-examples-with-python/input
Visual story telling of netflix link
https://www.kaggle.com/code/subinium/storytelling-with-data-netflix-ver
Resize image
import cv2
import numpy as np
import matplotlib.pyplot as plt
image = cv2.imread(r"D:\sims\eb\sim21\EB-ML-06-10-2022-Test-Output-15\PERFORATION\Overkill\Fail\Blister 1 2022-03-12 12-59-43.859 T0 M0 G0 3 PERFORATION Mono.bmp", 1)
# Loading the image
half = cv2.resize(image, (0, 0), fx = 0.1, fy = 0.1)
bigger = cv2.resize(image, (1050, 1610))
stretch_near = cv2.resize(image, (780, 540),
interpolation = cv2.INTER_LINEAR)
Titles =["Original", "Half", "Bigger", "Interpolation Nearest"]
images =[image, half, bigger, stretch_near]
count = 4
for i in range(count):
plt.subplot(2, 2, i + 1)
plt.title(Titles[i])
plt.imshow(images[i])
plt.show()
import turtle
colors = [ "pink","yellow","blue","green","white","red"]
sketch = turtle.Pen()
turtle.bgcolor("black")
for i in range(200):
sketch.pencolor(colors[i % 6])
sketch.width(i/100 + 1)
sketch.forward(i)
sketch.left(59)
# Draw a Panda using Turtle Graphics
# Import turtle package
import turtle
# Creating a turtle object(pen)
pen = turtle.Turtle()
# Defining method to draw a colored circle
# with a dynamic radius
def ring(col, rad):
# Set the fill
pen.fillcolor(col)
# Start filling the color
pen.begin_fill()
# Draw a circle
pen.circle(rad)
# Ending the filling of the color
pen.end_fill()
##########################Main Section#############################
# pen.up --> move turtle to air
# pen.down --> move turtle to ground
# pen.setpos --> move turtle to given position
# ring(color, radius) --> draw a ring of specified color and radius
###################################################################
##### Draw ears #####
# Draw first ear
pen.up()
pen.setpos(-35, 95)
pen.down
ring('black', 15)
# Draw second ear
pen.up()
pen.setpos(35, 95)
pen.down()
ring('black', 15)
##### Draw face #####
pen.up()
pen.setpos(0, 35)
pen.down()
ring('white', 40)
##### Draw eyes black #####
# Draw first eye
pen.up()
pen.setpos(-18, 75)
pen.down
ring('black', 8)
# Draw second eye
pen.up()
pen.setpos(18, 75)
pen.down()
ring('black', 8)
##### Draw eyes white #####
# Draw first eye
pen.up()
pen.setpos(-18, 77)
pen.down()
ring('white', 4)
# Draw second eye
pen.up()
pen.setpos(18, 77)
pen.down()
ring('white', 4)
##### Draw nose #####
pen.up()
pen.setpos(0, 55)
pen.down
ring('black', 5)
##### Draw mouth #####
pen.up()
pen.setpos(0, 55)
pen.down()
pen.right(90)
pen.circle(5, 180)
pen.up()
pen.setpos(0, 55)
pen.down()
pen.left(360)
pen.circle(5, -180)
pen.hideturtle()
No comments:
Post a Comment