Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Conversation

Namyalg
Copy link
Contributor

@Namyalg Namyalg commented Aug 18, 2020

This script can be used to perform 3-D convolution on colored images.

Issue related to #93

img = cv2.resize(img, (width , height))

#The pixels are extracted from the image
pixels = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert a new line before for loop

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change


#function to apply convolution or multiply kernels
def convolute(arr , height , width ,kernel):
convoluted_matrix = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Insert new line before for loop

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

img = Image.fromarray(combine)
img.save('Funkyfilter.jpg')


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove new lines at the end

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make changes


for i in range(height):
for j in range(width):
combine[i ,j] = [int(r_convol[i][j]) , int(g_convol[i][j]) , int(b_convol[i][j])]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before comma and put space after comma

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

prod = np.multiply(temp,kernel)
convoluted_matrix.append(np.sum(prod))

convoluted_matrix = (np.array(convoluted_matrix).reshape(height-3,width-3))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put space after comma

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

convoluted_matrix = []
for i in range(1,height-2):
for j in range(1,width-2):
temp = arr[i:i+3 , j:j+3]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove space before comma and put space after comma

for i in range(1,height-2):
for j in range(1,width-2):
temp = arr[i:i+3 , j:j+3]
prod = np.multiply(temp,kernel)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put space after comma

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

#function to apply convolution or multiply kernels
def convolute(arr , height , width ,kernel):
convoluted_matrix = []
for i in range(1,height-2):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put space after comma

@Namyalg
Copy link
Contributor Author

Namyalg commented Aug 20, 2020 via email

Copy link

@disha2sinha disha2sinha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some of the changes requested earlier are yet to be made

img = cv2.resize(img, (width , height))

#The pixels are extracted from the image
pixels = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change


#function to apply convolution or multiply kernels
def convolute(arr , height , width ,kernel):
convoluted_matrix = []

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

for i in range(1,height-2):
for j in range(1,width-2):
temp = arr[i:i+3 , j:j+3]
prod = np.multiply(temp,kernel)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this change

@Namyalg
Copy link
Contributor Author

Namyalg commented Aug 22, 2020

Yes, I have made them

@Namyalg
Copy link
Contributor Author

Namyalg commented Aug 22, 2020

I would want to know if I can submit scripts that I have written using the PyGame module and raise an issue for the same

@powerexploit
Copy link
Owner

I would want to know if I can submit scripts that I have written using the PyGame module and raise an issue for the same

Great work @Namyalg !
You can submit scripts written using pygame by raising new issue.

@Namyalg
Copy link
Contributor Author

Namyalg commented Sep 4, 2020 via email

@Namyalg
Copy link
Contributor Author

Namyalg commented Sep 19, 2020

I would like to know if I have to make any changes to these scripts

@powerexploit powerexploit merged commit d873a66 into powerexploit:master Sep 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants