Questions tagged [pset4]

The standard edition of Problem Set 4 will move beyond C programming language basics, testing your knowledge of pointers, memory management, file i/o and structs.

Filter by
Sorted by
Tagged with
0
votes
0answers
51 views

Help with detecting edges on pset4/filter/more

My program seems to be ok in my brain and on the "outfile.bmp", but when I check50 it all I get is: Here is my code, void edges(int height, int width, RGBTRIPLE image[height][width]) { int gxb, ...
0
votes
1answer
45 views

PSET4 Recover Segmentation Fault, please help

I hope everyone is doing well during this difficult time, my prayers to those been affected by it. I have difficulty debugging the segmentation fault here and the cs50 debugger is not too helpful on ...
0
votes
1answer
319 views

To those who struggle with pset4’s filter-more’s edge detection filter

I’m sure it is obvious for some people, but it wasn’t for me) If your code isn’t working the way it should, you can create new .c file and put there your logic from edge detection function. You can ...
0
votes
1answer
99 views

Pset4: Recover, only 49 images and fails with check50

I recently started with CS50 and I struggle a bit with pset4's recover. While the jpgs look correct to me, my code only recovers 49 jpgs total, not the 50 which are expected. Check50 fails on the ...
0
votes
2answers
237 views

pset4 blur filter

I've been working for like a week on cs50/pset/filter/blur question, but this doesn't seem to be working. My code is like this, and the resulting "blur filtered" image is not any close to what is ...
0
votes
1answer
55 views

PSET 4- RECOVER getting 22 pictures and none good

I keep looking my code and connot identify what is going on. I open 22 pictures, but none of them are good. It doesn't even write in the entire picture, some of them just a part of the picture is ...
1
vote
1answer
572 views

pset 4 : filter - Could not open .bmp file

I have a trivial question. Starting the pset with freshly downloaded and unchanged code and trying to pass a file with ./filter -g yard.bmp out.bmp yields : Could not open yard.bmp. I wrote a simple ...
0
votes
1answer
164 views

Problem Set 4 - Filter (Blur)

I know its pretty lame and uninspired to hard-code each and every special case of the blur function, but somehow it still refuses to pass most of check50's tests (aside from the middle and edge pixel ...
0
votes
1answer
81 views

Pset4/recover: code is working fine but the recoverd images are not correct

I have written this code. The code seems to work fine but the images are not correct they are distorted. I have attached those photos below. Can you please help me and tell me where I went wrong in ...
0
votes
0answers
57 views

I need help pset4 blur filter(Less)

bool exist(int height, int width, int h, int w) { if (-1 < w && w < width && -1 < h && h < height) { num++; return true; } return ...
0
votes
1answer
74 views

Error - linking error

I have no idea what I am doing to get this error, or what it means. clang -ggdb3 -O0 -std=c11 -Wall -Werror -Wextra -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -Wshadow helpers.c ...
0
votes
1answer
69 views

Miscalculating the Corner and Edge pixels in blur

My Blur function seems to correctly calculate the middle pixels but fails (horribly) to calculate corner and edge pixels. This is my Blur function: // Blur image void blur(int height, int width, ...
0
votes
1answer
107 views

Blur function not working in filter

I can't find any mistakes in my code: // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) ...
0
votes
1answer
73 views

PSET4 Recover- code working fine except recovered image 49 does not match

I keep ending up with this last error on Check50 - any tips? int main(int argc, char *argv[]) { // Check for invalid usage if (argc != 2) { printf("Usage: Recover [...
0
votes
2answers
94 views

pset4 recover - timed out while waiting for program to exit

Whenever I run my code using check50, I get this error: "timed out while waiting for program to exit", and I don't know why this is happening. Any help would be greatly appreciated. Here's my code: #...
0
votes
0answers
15 views

Recover: Segmentation fault when assigning JPEG file from function return to image file outside function

I'm trying to return a file with a name from a function according to the sequential ordering required, but as soon as it returns the value, a segmentation fault occurs. I have inkling that it may have ...
0
votes
1answer
246 views

helpers.c not compiling for filter

I am doing filter less comfortable in pset4. My filter file compiles fine, but helpers.c gives the following error : clang-7: error: linker command failed with exit code 1 (use -v to see invocation) ...
0
votes
1answer
56 views

Pset4 Recover: Program works perfectly but jpeg 1 name is not three digits for some reason HELP!

Everything works except the first jpeg gets the name 1 instead of 001 #include <stdio.h> #include <stdlib.h> #include <stdint.h> //includes BYTE struct #include <cs50.h> ...
0
votes
1answer
498 views

cs50 pset4 filter sepia

I'm working on Sepia (2020 problem set 4- filter). The command window printed out the following error message: helpers.c:33:29: runtime error: 260 is outside the range of representable values of type ...
0
votes
1answer
57 views

pset4 recover: 'recovered image does not match'

My program recovers the images but the recovered images are all blank and check50 says that they "don't match". All the images are 512 bytes in size. Please help me find out why this is happening. My ...
2
votes
2answers
304 views

Understanding how memory is allocated in driver code PSET 4, Filter (Less Comfortable)?

What does the following line do, step by step (filter.c L:78) RGBTRIPLE(*image)[width] = calloc(height, width * sizeof(RGBTRIPLE)); I am most confused by the syntax of RGBTRIPLE(*image)[width] ...
0
votes
1answer
968 views

PSET 4 Filter(Less) help with Blur

The code visually seems to work (the images look blurry on the output) when I run it with all 4 of the pre loaded images, but with Check50 everything is marked as incorrect and I can't figure out why. ...
0
votes
1answer
39 views

Help with speller load function on PSET4

I have been stuck on pset4 for quite some time without any meaningful progress. After re-watching the walkthroughs and reading answers here I've sort of put together a "frankenstein" thing for the ...
0
votes
1answer
42 views

pset4 Recover 049.jpg does not match, even though it opens correctly as an image

So, I've been struggling with this bug for a couple days now and can't seem to figure out how to fix it. I've also noticed that the final image file is WAY larger than any of the other jpg's my ...
1
vote
2answers
2k views

Pset4 filter edges issue

I'm trying to figure why my code doesn't work for detecting edges. Even though it produces a result, it is too white. Any suggestions? // Detect edges void edges(int height, int width, RGBTRIPLE ...
0
votes
1answer
199 views

Pset4 filter reverse issue

I am banging my head for the past hour on why this does not work. Basically, testing on the provided pictures, my reverse function does what it says on the tin. However, when I test it vs check50, ...
1
vote
1answer
644 views

runtime error in filter: reflect

I wish i could be more specific but i really don't understand the errors i'm getting This is my reflect function: // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[...
1
vote
1answer
770 views

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

I have written my code based on how I structured the code for the blur filter. For some reason the result is pretty weird, the processing of edge detection is only taking place in a square. See ...
0
votes
1answer
905 views

cs50 pset4 recover 2020

I have been working on pset4 recover, but it is bringing one error how can i rectify it? Here is my code FILE* card_ptr = fopen("card.raw", "r"); if (card_ptr == NULL) { printf("...
0
votes
1answer
131 views

PSET4 blur, one pixel short of success

I'm so close to solving this problem and I'm only one pixel short of getting it thorugh, but I cannot for the life of me figure out what I'm doing wrong. Really hope some (one) of you can spot the ...
0
votes
1answer
166 views

Problem set 4: filter blur

I can only seem to get the corner pixel correct, anyone can spot what's the issue? Thanks! void blur(int height, int width, RGBTRIPLE image[height][width]) { int newRed[height][width]; int ...
0
votes
1answer
434 views

pset4 - filter - sepia: Only red value is consistently correct

So, I currently have this solution for the sepia function of the filter problem. void sepia(int height, int width, RGBTRIPLE image[height][width]) { int b, g, r; // Apply sepia algorithm to ...
0
votes
1answer
78 views

pset4: recover last check wrong

All check correct and it recovers all 50 images but I have this problem and I can't solve it. I know I must find return number from fread function but the return number is 1 no all the elements that ...
0
votes
0answers
205 views

Pset4 edge recognition values too high; not incrementing correctly

I have checked and rechecked my program but the values the edge recognition portions output always seem to default to 255. Is my math wrong or something? Sorry if it's messy; couldn't figure out ...
0
votes
1answer
375 views

pset4: edges have correct 3 out of 5

the corner check correct and the edges check correct and middle pixel check correct but the whole image wrong why ????? void edges(int height, int width, RGBTRIPLE image[height][width]) { int ...
0
votes
1answer
185 views

Debug50 Running through breakpoints

I am trying to use debug50 for PSET 4 (Recover). However, when I set the breakpoints the debugger runs through them and do not pause. Only when I set the breakpoint at the if statement shown in the ...
0
votes
1answer
3k views

pset4 filter blur help

my code for my first attempt for blur is a tad long (I know there are definitely better ways to solve it), but I'm not sure what's wrong with my current one as when I try to visualize my code with a ...
0
votes
0answers
709 views

PSET4 filter blur issue

pset4 blur is the only filter that took me this number of lines, but I still can not figure out where the problem is // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) ...
1
vote
1answer
616 views

pset4: filter reflect all check right except two of them

all checked right except two of them. it reflected the image correctly but I found two errors I can not understand them and how to solve it. void reflect(int height, int width, RGBTRIPLE image[...
0
votes
1answer
558 views

pset4: filter blur wrong count

wrong output when I try cs50 check but when I passing image the count is right I can not find the wrong. void blur(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < ...
0
votes
1answer
68 views

Recover PSET 4 - 26 Invalid Images

Been struggling with the recover PSET for a while now, my code recovers 26 images but when i try to open them i get the following error "Invalid or Unsupported Image Format ". I believe it's because ...
0
votes
1answer
1k views

pset4 filter: reflect the image reflect half only

if I remove this line (*a = temp2) the left image only reflects and if I remove this line (*b = temp ) the right image only reflects but if I write both the image return into the original one no ...
0
votes
1answer
3k views

PSET4 -Blur function

I have been working on the blur function for PSET4 and when i test the function, the provided picture is blurred but i still get a few errors when i run check50. See link to check50's results: ...
0
votes
1answer
69 views

Segmentation fault pset4 recover

I'm having a segmentation fault which I'm not being able to identify. After reading about other similar problems I thought it could be that I wasn't checking if (img == NULL) but even after adding it ...
0
votes
1answer
2k views

pset4 filter: blur seems to be working, but check50 reads errors

For the filter program on pset4, the blur filter seems to be working fine for all images that were included in the distribution code. The blur filter takes a pixel in an image and adds its color ...
0
votes
2answers
550 views

pset4 filter: reflect produces “UndefinedBehaviorSanitizer:DEADLYSIGNAL” forever

When I filter to reflect an image, it keeps printing the following without stopping: UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:...
0
votes
1answer
42 views

Help with unloading my dic

I have been trying speller for far too long now and need help with unloading the dictionary. This is the code I have now // Unloads dictionary from memory, returning true if successful else false bool ...
0
votes
0answers
19 views

Why is my program missing misspelled words? PSET4, Speller(trie)

I am working on pset4, implementing a trie and asked a previous question then went back and corrected my mistake. Now, when I run my program, I get fewer words misspelled than the staff's solution ...
0
votes
1answer
30 views

speller double free or corruption hashtable

I'm getting a "double free or corruption" error when running this code. I don't know in which function the error is. I get the error after the code has run through check, before it gets to the unload ...
0
votes
1answer
61 views

Pset4 Speller, Trie. Why are all words misspelled?

first time poster and new beginner. I realize this question has been asked numerous times among different forums, but still after looking at other's code, I simply can't figure it out. I have ran my ...

1
3 4
5
6 7
32