Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Answers_Sakshi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Name:- Sakshi Kalunge
Registration ID:- 241071032
Branch:- Computer Engineering
College email ID:- [email protected]
Binary file added Answers_Sakshi/Task1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Answers_Sakshi/Task2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Answers_Sakshi/Task4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Answers_Sakshi/task1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import cv2
image=cv2.imread("Task1.png")
img =cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
count=0
positions=[]
for y in range (img.shape[0]):
for x in range (img.shape[1]):
if img[y][x]!=255:
count+=1
positions.append((y,x))
print(count)
print(positions)

18 changes: 18 additions & 0 deletions Answers_Sakshi/task2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import cv2

image=cv2.imread("Task2.png")
image =cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)

morse_code=""
for y in range(image.shape[0]):
for x in range(image.shape[1]):
if image[y][x]==0:
morse_code+="-"
elif image[y][x]==255:
morse_code+="."
elif image[y][x] in range(120,220):
morse_code+=" "

print(morse_code)


34 changes: 34 additions & 0 deletions Answers_Sakshi/task4.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import cv2 as cv

image =cv.imread('Task4.png')

image=cv.cvtColor(image,cv.COLOR_BGR2GRAY)

sumofpixel=0
noofpixel=0
norm=image.tolist()
noofpixel=image.shape[0]*image.shape[1]

for y in range(image.shape[0]):
for x in range(image.shape[1]):
sumofpixel=sumofpixel+norm[y][x]
thv=sumofpixel/noofpixel

count=0
max=0
for y in range(image.shape[0]):
for x in range(image.shape[1]):
if image[y][x]<thv:
image[y][x]=0
else:
image[y][x]=255

for y in range(image.shape[0]):
for x in range(image.shape[1]):
if image[y][x]==0:
count+=1
else:
if(count>max):max=count
count=0

print(max*max)
Binary file added Answers_Sakshi/task7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions Answers_Sakshi/task7.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import cv2
import numpy as np
height,width=500,500

image=np.ones((height,width,3),dtype=np.uint8)*255
image[:]=(230,215,170)

cv2.line(image,(0,500),(500,500),(32,46,126),30)

cv2.rectangle(image,(140,300),(354,500),(111,198,255),-1)

triangle= np.array([[140,300],[247,200],[354,300]],np.int32)
cv2.fillPoly(image,[triangle],(237,126,213))

cv2.rectangle(image,(230,380),(270,500),(248,173,232),-1)

cv2.rectangle(image,(165,340),(200,370),(172,245,255),-1)

cv2.rectangle(image,(294,340),(329,370),(172,245,255),-1)

cv2.circle(image,(420,70),30,(0,255,255),-1)

cv2.putText(image,"My House",(175,295),cv2.FONT_ITALIC,1,(0,0,0),2)

cv2.imshow("Task7",image)
cv2.waitKey(0)
cv2.destroyAllWindows()