diff --git a/Answers_Sakshi/README.md b/Answers_Sakshi/README.md new file mode 100644 index 0000000..11b485e --- /dev/null +++ b/Answers_Sakshi/README.md @@ -0,0 +1,4 @@ +Name:- Sakshi Kalunge +Registration ID:- 241071032 +Branch:- Computer Engineering +College email ID:- svkalunge_b24@ce.vjti.ac.in \ No newline at end of file diff --git a/Answers_Sakshi/Task1.png b/Answers_Sakshi/Task1.png new file mode 100644 index 0000000..1d3522c Binary files /dev/null and b/Answers_Sakshi/Task1.png differ diff --git a/Answers_Sakshi/Task2.png b/Answers_Sakshi/Task2.png new file mode 100644 index 0000000..949ff99 Binary files /dev/null and b/Answers_Sakshi/Task2.png differ diff --git a/Answers_Sakshi/Task4.png b/Answers_Sakshi/Task4.png new file mode 100644 index 0000000..888b7d9 Binary files /dev/null and b/Answers_Sakshi/Task4.png differ diff --git a/Answers_Sakshi/task1.py b/Answers_Sakshi/task1.py new file mode 100644 index 0000000..b70c470 --- /dev/null +++ b/Answers_Sakshi/task1.py @@ -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) + \ No newline at end of file diff --git a/Answers_Sakshi/task2.py b/Answers_Sakshi/task2.py new file mode 100644 index 0000000..9774500 --- /dev/null +++ b/Answers_Sakshi/task2.py @@ -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,221): + morse_code+=" " + +print(morse_code) + + \ No newline at end of file diff --git a/Answers_Sakshi/task4.py b/Answers_Sakshi/task4.py new file mode 100644 index 0000000..2567294 --- /dev/null +++ b/Answers_Sakshi/task4.py @@ -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]max):max=count + count=0 + +print(max*max) diff --git a/Answers_Sakshi/task7.png b/Answers_Sakshi/task7.png new file mode 100644 index 0000000..955205b Binary files /dev/null and b/Answers_Sakshi/task7.png differ diff --git a/Answers_Sakshi/task7.py b/Answers_Sakshi/task7.py new file mode 100644 index 0000000..a60d401 --- /dev/null +++ b/Answers_Sakshi/task7.py @@ -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() +