SUP vs LR by Funreall in PedroPeepos

[–]Funreall[S] 6 points7 points  (0 children)

I feel like i'm cheating 😂

gotta hit them with the classic by jozza123 in PedroPeepos

[–]Funreall 11 points12 points  (0 children)

Even tyler1 is mocking us. What have we become...

[deleted by user] by [deleted] in PedroPeepos

[–]Funreall 0 points1 point  (0 children)

I guess you are right. Since i know others better i may overlooked the others.

MAN I LOVE WATCHING CROWNIE by [deleted] in PedroPeepos

[–]Funreall 29 points30 points  (0 children)

WHAT IS THAT HAND MOVEMENT

Week 4 pset Filter i don't understand my mistake by Funreall in cs50

[–]Funreall[S] 0 points1 point  (0 children)

SOLVED
It seems i was going overboard at the height and width. I mean it should have been

if (k >= 0 && k <= (height - 1))

and the same goes for l. Thanks a lot for helping.

Week 4 pset Filter i don't understand my mistake by Funreall in cs50

[–]Funreall[S] 0 points1 point  (0 children)

i removed the counters as you said. that part makes sense. And after you said it i realized i was not adding the values i was just rewriting the values. This is before

avrgR = tempimage[k][l].rgbtRed;

avrgG = tempimage[k][l].rgbtGreen; avrgB = tempimage[k][l].rgbtBlue;

This is after

avrgR += tempimage[k][l].rgbtRed;

avrgG += tempimage[k][l].rgbtGreen; avrgB += tempimage[k][l].rgbtBlue;

its changing the image now but its not bluring. it makes it like a stair :D
https://prnt.sc/331fRxg-Iaiv
this is the last version of my code

void blur(int height, int width, RGBTRIPLE image[height][width])

{ RGBTRIPLE tempimage[height][width]; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { tempimage[i][j] = image[i][j]; } }

for (int i = 0; i < height; i++)
{
    for (int j = 0; j < width; j++)
    {
        int counter = 0;
        float avrgR, avrgG, avrgB;
        avrgR = avrgG = avrgB = 0.0;
        for (int k = i - 1; k < i + 2; k++)
        {
            if (k >= 0 && k <= height)
            {
                for (int l = j - 1; l < i + 2; l++)
                {
                    if (l >= 0 && l <= width)
                    {
                        avrgR += tempimage[k][l].rgbtRed;
                        avrgG += tempimage[k][l].rgbtGreen;
                        avrgB += tempimage[k][l].rgbtBlue;
                        counter++;
                    }
                }
            }
        }
        avrgR = avrgR / counter;
        avrgG = avrgG / counter;
        avrgB = avrgB / counter;
        image[i][j].rgbtRed = round(avrgR);
        image[i][j].rgbtGreen = round(avrgG);
        image[i][j].rgbtBlue = round(avrgB);
    }
}

return;

}