diff --git a/test/2024,9,23/homework.py b/test/2024,9,23/homework.py new file mode 100644 index 0000000..3978220 --- /dev/null +++ b/test/2024,9,23/homework.py @@ -0,0 +1,22 @@ +import cv2 as cv + +# 1 +img=cv.imread("sample.jpg",cv.IMREAD_GRAYSCALE) +# 2 +def draw_circle(event,x,y,flags,param): + if event==cv.EVENT_LBUTTONDOWN: + cv.circle(img,(x,y),10,0,-1) +#3 +cv.namedWindow('modify_sample') +cv.setMouseCallback('modify_sample',draw_circle) +#4 +alpha=0.3 +beta=80 +while(1): + cv.imshow('modify_sample',img) + pressedKey=cv.waitKey(5) + # 5 + if pressedKey==ord('q'): + break + if pressedKey==ord('s'): + cv.imwrite('modified_sample.jpg',img) \ No newline at end of file diff --git a/test/2024,9,23/modified_sample.jpg b/test/2024,9,23/modified_sample.jpg new file mode 100644 index 0000000..62d3219 Binary files /dev/null and b/test/2024,9,23/modified_sample.jpg differ diff --git a/test/2024,9,23/sample.jpg b/test/2024,9,23/sample.jpg new file mode 100644 index 0000000..0b65879 Binary files /dev/null and b/test/2024,9,23/sample.jpg differ