Skip to content

Commit c7fd402

Browse files
committed
2 parents c75c38c + d8a3794 commit c7fd402

File tree

40 files changed

+18327
-298
lines changed

40 files changed

+18327
-298
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: 🐛 Bug Report
2+
description: Report a bug report
3+
title: '[Bug]: '
4+
labels: ['🔧 goal: fix']
5+
body:
6+
- type: textarea
7+
id: what-happened
8+
attributes:
9+
label: Describe the bug
10+
placeholder: A clear and concise description of what the bug is.
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: steps-to-reproduce
15+
attributes:
16+
label: Steps to reproduce the behavior
17+
placeholder: |
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
validations:
23+
required: false
24+
- type: textarea
25+
id: expected-behaviour
26+
attributes:
27+
label: Expected behavior
28+
placeholder: A clear and concise description of what you expected to happen.
29+
validations:
30+
required: true
31+
- type: textarea
32+
id: screenshots
33+
attributes:
34+
label: Screenshots
35+
placeholder: If applicable, add screenshots to help explain your problem.
36+
validations:
37+
required: false
38+
- type: dropdown
39+
id: device
40+
attributes:
41+
label: Device?
42+
multiple: true
43+
options:
44+
- Desktop
45+
- Mobile
46+
- type: dropdown
47+
id: operating-system
48+
attributes:
49+
label: Which OS are affected?
50+
multiple: true
51+
options:
52+
- Mac
53+
- Windows
54+
- Linux
55+
- type: textarea
56+
id: version
57+
attributes:
58+
label: Enter the version of your web browser
59+
placeholder: Version
60+
validations:
61+
required: true
62+
- type: dropdown
63+
id: browsers
64+
attributes:
65+
label: Which browsers are affected?
66+
multiple: true
67+
options:
68+
- Firefox
69+
- Chrome
70+
- Safari
71+
- Microsoft Edge
72+
- Brave
73+
- Other
74+
- type: textarea
75+
id: additional-info
76+
attributes:
77+
label: Additional context
78+
placeholder: Add any other context about the problem here.
79+
validations:
80+
required: false
81+
- type: checkboxes
82+
id: terms
83+
attributes:
84+
label: 'Record'
85+
options:
86+
- label: I agree to follow this project's Code of Conduct
87+
required: true
88+
- label: I'm a GSSoC'23 contributor
89+
- label: I want to work on this issue

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: ✨ Feature Request
2+
description: Suggest a feature request
3+
title: '[Feat]: '
4+
labels: ['⭐ goal: addition']
5+
body:
6+
- type: textarea
7+
id: what-feature
8+
attributes:
9+
label: Is your feature request related to a problem? Please describe.
10+
placeholder: A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: solution
15+
attributes:
16+
label: Describe the solution you'd like.
17+
placeholder: A clear and concise description of what you want to happen.
18+
validations:
19+
required: true
20+
- type: textarea
21+
id: alternatives
22+
attributes:
23+
label: Describe alternatives you've considered.
24+
placeholder: A clear and concise description of any alternative solutions or features you've considered.
25+
validations:
26+
required: true
27+
- type: textarea
28+
id: screenshots
29+
attributes:
30+
label: Show us the magic with screenshots
31+
placeholder: Attach screenshots to visualize your idea
32+
validations:
33+
required: false
34+
- type: checkboxes
35+
id: terms
36+
attributes:
37+
label: 'Record'
38+
options:
39+
- label: I agree to follow this project's Code of Conduct
40+
required: true
41+
- label: I'm a GSSoC'23 contributor
42+
- label: I want to work on this issue
43+

.github/ISSUE_TEMPLATE/script-addition.md

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: ✨ Script Addition
2+
description: Describe this Script you want to add
3+
title: '[Script]: '
4+
labels: ['⭐ goal: Script-addition']
5+
body:
6+
- type: textarea
7+
id: Aim
8+
attributes:
9+
label: Aim
10+
placeholder: What is the objective of the Script
11+
validations:
12+
required: true
13+
- type: textarea
14+
id: Details
15+
attributes:
16+
label: Details
17+
placeholder: What the features will your script have
18+
validations:
19+
required: true
20+
- type: checkboxes
21+
id: terms
22+
attributes:
23+
label: 'Record'
24+
options:
25+
- label: I agree to follow this project's Code of Conduct
26+
required: true
27+
- label: I'm a GSSoC'23 contributor
28+
- label: I want to work on this issue
29+
30+

Age_Calculator/Age_Calculator.py

Lines changed: 30 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,30 @@
1-
# importing the date module from the datetime package
2-
from datetime import date
3-
4-
# defining a function calculate the age
5-
def calculate_age(birthday):
6-
7-
# using the today() to retrieve today's date and stored it in a variable
8-
today = date.today()
9-
10-
# a bool representing if today's day, or month precedes the birth day, or month
11-
day_check = ((today.month, today.day) < (birthday.month, birthday.day))
12-
13-
# calculating the difference between the current year and birth year
14-
year_diff = today.year - birthday.year
15-
16-
# The difference in years is not enough.
17-
# We must subtract 0 or 1 based on if today precedes the
18-
# birthday's month/day from the year difference to get it correct.
19-
# we will subtract the 'day_check' boolean from 'year_diff'.
20-
# The boolean value will be converted from True to 1 and False to 0 under the hood.
21-
age_in_years = year_diff - day_check
22-
23-
# calculating the remaining months
24-
remaining_months = abs(today.month - birthday.month)
25-
26-
# calculating the remaining days
27-
remaining_days = abs(today.day - birthday.day)
28-
29-
# printing the age for the users
30-
print("Age:", age_in_years, "Years", remaining_months, "Months and", remaining_days, "days")
31-
32-
# main function
33-
if __name__ == "__main__":
34-
35-
# printing an opening statement
36-
print("Simple Age Calculator")
37-
38-
# asking user to enter birth year, birth month, and birth date
39-
birthYear = int(input("Enter the birth year: "))
40-
birthMonth = int(input("Enter the birth month: "))
41-
birthDay = int(input("Enter the birth day: "))
42-
43-
# converting integer values to date format using the date() method
44-
dateOfBirth = date(birthYear, birthMonth, birthDay)
45-
46-
# calling the function to calculate the age of a person
47-
calculate_age(dateOfBirth)
1+
from datetime import date
2+
3+
def calculate_age(birthday):
4+
today = date.today()
5+
6+
# Check if the birthdate is in the future
7+
if today < birthday:
8+
return "Invalid birthdate. Please enter a valid date."
9+
10+
day_check = ((today.month, today.day) < (birthday.month, birthday.day))
11+
year_diff = today.year - birthday.year - day_check
12+
remaining_months = abs(today.month - birthday.month)
13+
remaining_days = abs(today.day - birthday.day)
14+
15+
# Return the age as a formatted string
16+
age_string = f"Age: {year_diff} years, {remaining_months} months, and {remaining_days} days"
17+
return age_string
18+
19+
if __name__ == "__main__":
20+
print("Simple Age Calculator")
21+
22+
try:
23+
birthYear = int(input("Enter the birth year: "))
24+
birthMonth = int(input("Enter the birth month: "))
25+
birthDay = int(input("Enter the birth day: "))
26+
dateOfBirth = date(birthYear, birthMonth, birthDay)
27+
age = calculate_age(dateOfBirth)
28+
print(age)
29+
except ValueError:
30+
print("Invalid input. Please enter valid integers for the year, month, and day.")
Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,43 @@
11
import cv2
2+
import argparse
23

3-
# getting the path for first image
4-
src1 = input("Enter the path of the image 1\n")
5-
src1 = cv2.imread(src1)
6-
# src1 = cv2.resize(src1,(540,540)) #resizing the image
7-
# getting the path for second image
8-
src2 = input("Enter the path of the image 2\n")
9-
src2 = cv2.imread(src2)
10-
11-
# Resizing the image so that both images have same dimensions
12-
src2 = cv2.resize(src2, src1.shape[1::-1])
13-
# Applying Bitwise AND operation
14-
andop = cv2.bitwise_and(src1, src2, mask=None)
15-
andop = cv2.resize(andop, (640, 640))
16-
cv2.imshow('Bitwise AND', andop)
17-
18-
orop = cv2.bitwise_or(src1, src2, mask=None) # Applying Bitwise OR operation
19-
orop = cv2.resize(orop, (640, 640))
20-
cv2.imshow('Bitwise OR', orop)
21-
22-
xorop = cv2.bitwise_xor(src1, src2, mask=None) # Applying Bitwise OR operation
23-
xorop = cv2.resize(xorop, (640, 640))
24-
cv2.imshow('Bitwise XOR', xorop)
25-
cv2.waitKey(0)
26-
cv2.destroyAllWindows()
4+
def perform_bitwise_operations(image1_path, image2_path):
5+
src1 = cv2.imread(image1_path)
6+
src2 = cv2.imread(image2_path)
7+
8+
# Resizing the images to have the same dimensions
9+
src2 = cv2.resize(src2, src1.shape[1::-1])
10+
11+
# Performing bitwise AND operation
12+
and_op = cv2.bitwise_and(src1, src2, mask=None)
13+
14+
# Performing bitwise OR operation
15+
or_op = cv2.bitwise_or(src1, src2, mask=None)
16+
17+
# Performing bitwise XOR operation
18+
xor_op = cv2.bitwise_xor(src1, src2, mask=None)
19+
20+
return and_op, or_op, xor_op
21+
22+
def save_images(image1, image2, image3):
23+
cv2.imshow('Bitwise AND', image1)
24+
cv2.imshow('Bitwise OR', image2)
25+
cv2.imshow('Bitwise XOR', image3)
26+
cv2.waitKey(0)
27+
cv2.destroyAllWindows()
28+
29+
if __name__ == '__main__':
30+
# Creating command-line arguments parser
31+
parser = argparse.ArgumentParser(description='Perform bitwise operations on two images.')
32+
parser.add_argument('image1', type=str, help='Path to the first image file.')
33+
parser.add_argument('image2', type=str, help='Path to the second image file.')
34+
args = parser.parse_args()
35+
36+
image1_path = args.image1
37+
image2_path = args.image2
38+
39+
# Performing bitwise operations
40+
result1, result2, result3 = perform_bitwise_operations(image1_path, image2_path)
41+
42+
# Displaying and saving the resulting images
43+
save_images(result1, result2, result3)

0 commit comments

Comments
 (0)