Hot answers tagged

2 votes
Accepted

PSET4 (More Comfortable) Filter Edges

I've found 3 problems in your code: 1. You're making a copy of the image but you're not using it? 2. Revise the arrays Gx-Gy something is wrong. 3. Pay attention where you declare the group of long ...
  • 1,561
2 votes

Pset4 filter edges issue

I found the solution, it turns out I was supposed to create a copy of the original image to work on.
2 votes
Accepted

PSET4 Filter, edge detection process only works for square-like pictures. How to make it work for the whole picture?

if (j < height - 1) Something's wrong with that line.
  • 20.7k
1 vote
Accepted

pset4: edges have correct 3 out of 5

Your k-- and p-- don't match the c++ and r++. For example, you have int r = 0, c = 0; for (int k = i; k >= i - 1; k--) which starts at the upper left in your ...
  • 20.7k
1 vote

Pset4 Filter Edge Dedection

Found. RGBTRIPBLE doesn't support Float.
1 vote

Pset4 filter edges issue

The code you used does not create a separate temporary memory for the changes that you make to the image. As your code uses data stored in previous pixel as reference to edit the image, it creates a ...
1 vote

Pset4 filter edges issue

I had the same issue and tried to solve it with by temporarily storing the values (like in blur) but that didn't work ... so I now solved this like you, but tbh I don't really get why this works :/. ...
1 vote
Accepted

Do computers have to check if (false) the same way as whether (0 != 0), etc.?

Interesting question. The computer has to evaluate whatever is in the parentheses. The more complicated, the more it has to process. If there is only a variable inside the parentheses, then the ...
  • 64.6k
1 vote
Accepted

PSET4 - Filter(more)- Edges- Check50 error

Here's a really big hint. The right edge and bottom edge pixels are all bad, but the left and top are OK (except top right and bottom left). Have you taken a careful look at the limits for the right ...
  • 64.6k
1 vote

CS50 - PSET 4 - Filter - Edges

That's the correct image: https://imgur.com/a/Z4APwpb It seems that something is wrong with the edges for sure. And also something wrong with the rest of the numbers, too, because I see a lot of noise ...
1 vote

filter more comfortable pset4 edges

Your algorithm looks fine, just a couple typos. RGBTRIPLE edged_pixel(int i, int j, int height, int width, RGBTRIPLE image[width][height]) should specify height before width, like the other instances. ...
  • 349
1 vote

I don't know what I'm doing wrong Pset4 filter "edges"

Perhaps this has been worked out already, the question has sat for a few weeks. This is a complicated problem, I wrote my own test.c which calls the functions in helpers. It takes an input height and ...
  • 349
1 vote

Help with pset4 filter edge detection function

It might be an issue to do with having height and width the wrong way round. I think this could be causing the issue with the right hand third of the image. i think iteration starts in top left with [...
1 vote

Help with pset4 filter edge detection function

//Detect upper right corner if(!(i+1 > width-1 || j+1 > height-11)) maybe because of this it is happening.. typo in if statement
  • 371
1 vote
Accepted

CS50 - edge filter pset4

int gx[3][3] = {{-1, 0, -1}, {-2, 0, 2}, {-1, 0, 1}}; The third number in this (-1) should be 1. Which makes sense with the first row and last column being right, since that value wouldn't be used ...
  • 709
1 vote
Accepted

PSET 4 - Filter: Anyone able to help me on Edges?

There is a little misspell in your gx array in the 'gXY_grid' function. There would be some improvements to optimize your code, but by fixing the array, your program will do the job.
  • 1,561
1 vote

Edge detection produces weird outputs

May be some more issues but, a big one, is that you are not processing the edge and border pixels at all: Here: if (x - 1 < 0 || x + 1 > width - 1 || y - 1 < 0 || y + 1 > height - 1) ...
  • 1,561
1 vote

PSet4 - Filter (more) - Edge

So, now it is a lot shorter (thanks to the inspiration by Ayam Chan) and works fine. Am I allowed to publish the complete code? Or is that not appreciated? Greetz
  • 88
1 vote
Accepted

PSet4 - Filter (more) - Edge

First of all, you should consider revise your code in order to group some of those for loops and reduce the number of lines. It will be more readable for you and for others. You have two separate ...
  • 1,561

Only top scored, non community-wiki answers of a minimum length are eligible