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
11 views

pset4 blur filter invalid or unsupported image format

In pset4 Filter problem when I write blur function I get Invalid or Unsopported Image Format Error. The program compiles without errors and in check50 it also works fine. This is my code. I would ...
0
votes
0answers
7 views

CS50 Problem Set 4 filter less blur: please help debugging

//:( blur correctly filters 3x3 image expected "70 85 95\n80 9...", not "70 85 95\n80 9..." //:( blur correctly filters 4x4 image expected "70 85 95\n80 9...", not "...
0
votes
0answers
28 views

Academic honesty

Question about the Academic Honesty after working on recover problem for more than 10 hours and watching the lecture , shorts , and walking through several times , and still facing lots of errors and ...
0
votes
1answer
20 views

pset 4 recover, I can compile but no JPEGs returned

#include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> typedef uint8_t BYTE; int main(int argc, char *argv[]) { if(argc > 2 || argc < 2) ...
0
votes
1answer
26 views

CS50 PSET4 recover Segmentation Fault

Can someone point out why this code is resulting in segmentation fault? It's a code for the 'recover' question in pset4, cs50. #include <stdio.h> #include <stdlib.h> #include <stdint.h&...
0
votes
1answer
16 views

PSET4 LESS BLUR function -Ending Edges problem 2nd version

New version of my previous problem here PSET4 LESS BLUR function -Ending Edges problem I know the problem is with the imitations but can't figure out what is it My code works fine but for the ending ...
0
votes
1answer
14 views

PSET4 LESS BLUR function -Ending Edges problem

My code works fine but for the ending edges not. I mean the right & bottom edges values. Here is my code : void blur(int height, int width, RGBTRIPLE image[height][width]) { // h = 400 w = ...
0
votes
1answer
14 views

PSET4/Recover -- Why am I getting "double free or corruption (top)"?

#include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE; int counter = 0; char filename[8]; FILE *img; BYTE buffer[512]; int main(int argc, char *argv[])...
0
votes
1answer
20 views

Pset4 filter reflect segmentation fault

I'm currently trying out cs50's pset4 filter (less comfortable). The program compiles but when run, it outputs segmentation fault. When using check50, it showed that my reflect code passed three of ...
0
votes
0answers
57 views

My Filter program is not blurring the image correctly. And it is not able to open the input file. It shows it as NULL

Here is my code: #include"helpers.h" #include<math.h> #include<stdio.h> #include<stdlib.h> // Convert image to grayscale void grayscale(int height, int width, RGBTRIPLE ...
0
votes
1answer
23 views

Pset4 recover produces only 2 corrupted iamges

I am at Pset4 recover pset. When I run my code, it produces only 2 corrupted images here is my code : #include <stdio.h> #include <stdlib.h> #include <stdint.h> typedef uint8_t BYTE;...
0
votes
1answer
27 views

PSET4 Recover error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *

I am at PSet4-recover. I can't compile code properly. Always get these errors : recover.c:47:31: error: incompatible integer to pointer conversion passing 'int' to parameter of type 'const char *' [-...
0
votes
1answer
43 views

CS50 blur filter failed 3x3 and 4x4

I created a for loop checking each pixel around the one to be blurred. If the pixel was in range, its RGB values would be added to a total variable to then be averaged. My program works for all ...
0
votes
1answer
16 views

Debug50 won't even open and I don't know what step to take next in lab4 Recover

Because I can't get debug50 to help me out, I don't know where to start to debug this program. I think I have an infinite loop somewhere, but I'm not sure. Any help to get me started on right path ...
0
votes
0answers
13 views

pset4 filter, reverse: Made it work but cant quite understand how

So I created the function reverse and it works, it flips the image. To get to this point I had to try and repeat several times. While my logic says that: First I should use a temp variable to store ...
0
votes
1answer
20 views

Getting an "Invalid or Unsupported Image Format" while trying to open images (Recover, Pset4)

I'm currently trying out CS50's Recover (PSET4). The program compiles and I manage to get back all the 50 jpgs. But I can't open them because the image isn't correctly returned and I get an "...
0
votes
0answers
22 views

CS50/pset4/recover doesnt recover img 49

Hei All, I am running my version of recover and check50 validates every check apart from the last one This is my code. I really cant figure out what's wrong. #include <stdio.h> #include <...
0
votes
1answer
22 views

(PSET 4 - Recover) Why is first recovered image blank?

I am on problem set 4 recover and I have nearly completed it. I have written my code and it compiles but when I run it on the card.raw file it appears to recover all the 50 photos except the 1st one ...
0
votes
1answer
35 views

My Program is not recovering the jpegs correctly

My program is compiling properly it is even recovering the images but when I am opening the image to view, it is not opening. It is showing "Invalid or Unsupported file format". Please look ...
0
votes
1answer
32 views

pset4 filter blur less got stuck

i have been working on blur and it works just fine as i run it. but when i run check50 i get this : :( blur correctly filters middle pixel expected "127 140 149\n", not "145 160 169\n&...
0
votes
1answer
30 views

pset4 recover fread segmentation fault

guys I want to ask why am I constantly getting segfault with second fread inside of a while loop after checking jpeg header. first fread works perfectly going through first several 512bytes of card....
0
votes
0answers
25 views

Getting a segmentation fault on cs50's filter

I'm currently stuck on cs50's pset4 filter (less comfortable). The program compiles perfectly. I have tried out the first three parts of the code (grayscale, sepia & reflection) and their output ...
0
votes
1answer
16 views

The sepia code passes 2 first tests but doesn't pass the rest of those tests. What am I doing wrong?

This is the code I have written but it fails to produce the intended result. I am really not able to figure out why it's wrong. Can somebody help me? [snip] if (image[i][j].rgbtRed > 255) { ...
0
votes
1answer
10 views

Pset4 (Less). Filter sepia. In the output image, the white parts are magenta

For some reason, the image attached below is the output I get with Sepia filter. I don't know where the code is wrong. void sepia(int height, int width, RGBTRIPLE image[height][width]) { int k = 0;...
0
votes
1answer
27 views

Need clarity for Problem Set4 recover

I am working on set4 recover My program is always printing "Testing EOF", hence it looks card file is empty. Here is my code in detail. #include <stdio.h> #include <stdlib.h> #...
0
votes
1answer
10 views

Pset 4 filter less comfortable, cant open the output BMP file

So I just made the greyscale function and it passes check50 but when I try to open or download the output.bmp file, it doesn't show anything. Anyone know how to fix this? This was the command I put in ...
0
votes
1answer
25 views

Pset 4 Recover output shows Segmentation Fault

#include <stdlib.h> #include <stdint.h> //to use uint8_t as BYTE typedef uint8_t BYTE; int main(int argc, char *argv[]) { if (argc != 2) { printf("INVALID. There ...
0
votes
1answer
18 views

Filter - Structures & Headers

The problem statement states that BMP files have a particular header with: (1) BITMAPFILEHEADER 14 bytes long and (2) BITMAPINFOHEADER 40 bytes long. bmp.h (provided) includes the definitions of the ...
0
votes
2answers
43 views

CS50 Recover - fread into buffer

I am working on CS50 Recovery and I am unable to get the program to check the JPEG starting header. I used debug50 and added a couple print statements to try and find the problem. Every time I run the ...
0
votes
1answer
30 views

CS50 - PSET 4 - Filter - Edges

//Pixel buffer RGBTRIPLE pixelBuffer[height][width]; //Iterates on every pixel and calculates Gx and Gy for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++)...
0
votes
1answer
15 views

cs50 Pset4 filter(more) blur

void add(RGBTRIPLE* a, RGBTRIPLE* b){ a->rgbtRed += b->rgbtRed; a->rgbtGreen += b->rgbtGreen; a->rgbtBlue += b->rgbtBlue; } // Blur image void blur(int height, int width,...
1
vote
1answer
15 views

pset4 filter greyscale error

When I run "make helper," the following error comes up: "undefined reference to `main'" and "linker command failed with exit code 1" What am I doing wrong?? thank you in ...
0
votes
1answer
45 views

PSET4 Recover, output files are blank

Honestly, I have been struggling with Week 4, and I have been trying to complete this pset to the best of of my current understanding. I have researched multiple articles on this topic, but I have yet ...
0
votes
1answer
29 views

Pset4/recover: Why does it not works? Image names are correct. But it doesn't match. Please help?

:) recover.c exists. :) recover.c compiles. :) handles lack of forensic image :( recovers 000.jpg correctly recovered image does not match :( recovers middle images correctly recovered image ...
0
votes
1answer
32 views

CS50 Recover recovering corrupted images, and only 43 images

I'm attempting to solve the Recover problem, and I'm using a for loop to go through the bytes of the raw file. It spits out 43 images, some of which have the full image, but most are corrupted, and ...
0
votes
0answers
29 views

Filter (more) Edge error not passing check50

Yesterday I copleted filter less and all images passes check50, today I try to complete filter more edge I've added the same code like like filter less for Grayscale, Reflection, Blur and added new ...
0
votes
1answer
15 views

Pset4 - Memory/reflection problem

So I've been on this reflection in pset4's memory problem for well over an hour and I can't seem to get the first column of height to reflect. Only the first column too, everything else reflects. here'...
0
votes
1answer
51 views

pset4 filter. Blur image compiles goed but does'nt pass the check50 lots of error

The code in helpers.c all images compiles exept for the Blur image it compiles without any errors. But doesn't pass the cs50 check? any suggestions only the Blur image section. Thanks // Blur ...
0
votes
2answers
182 views

pset4 filter Could not open infile.bmp

I compiled the grayscale image in helpers.c with make filter without any errors correctly and check50 also correctly and passes all creterea But when I enter [ ./filter -g infile.bmp outfile.bmp ] it ...
0
votes
0answers
15 views

Pset4 able to compile but unable to recover images

My code compiled successfully and it passed check50,but when I implemented it, nothing occurred and no jpg file is created. Can anyone help me figure out what happened? [EDIT: Code removed for Harvard ...
0
votes
0answers
11 views

Cant figure out what is wrong with pset 4 more edges. check50 returns the following :-

:) edges correctly filters middle pixel :) edges correctly filters pixel on edge :) edges correctly filters pixel in corner :( edges correctly filters 3x3 image expected "76 117 255\n21...&...
0
votes
0answers
33 views

Pset4 - Filter - Blur- some pixels have RGB 0 0 0

I've been struggling with the filter portion of problem set 4 for quite a while. In particular, I've had a particularly persistent bug. As you can see from the Check50 screenshot below, some RGB ...
0
votes
1answer
44 views

PSET4 Blur not passing Check50

My code seems to work (when visually inspecting output files), but Check50 does not pass it. I'm struggling to understand what is causing this issue despite having repeatedly read over the code and ...
0
votes
1answer
32 views

Segmentation Fault in CS50 Recover - pset4

I would appreciate some guidance on the below issue. I have seen the other threads with the same issue but haven't had any luck applying those fixes. I am getting the below error in my code and I can'...
0
votes
1answer
35 views

Wrote a simple recover.c program to extract the first image from card.raw but the image is corrupted?

that is the code I wrote can anyone tell what is wrong with my code!! FILE *file = fopen(argv[1], "rb"); FILE *outptr = fopen("000.jpg", "wb"); typedef uint8_t BYTE; ...
0
votes
1answer
51 views

Problem with Recover (Pset4)

everyone. I've been struggling with the Recover problem of Pset4. I really don't understand why I'm getting the following error message when applying the Check50 control: *Results for cs50/problems/...
1
vote
1answer
45 views

Recover - segmentation fault and other general problems

Hey guys so I've hit a bit of a wall with Recover, when I run my program I get segmentation fault but I also don't know how to end off one jpeg when another header pops up? In essence, I'm not sure ...
0
votes
1answer
27 views

Collatz Function Iteration

Guys help here I'm so lost as how to answer this question, I'm infact clueless...Find the two smallest different input numbers x,y (with 0<x<y), for which the COLLATZ algorithm takes equally ...
0
votes
1answer
26 views

PSET4 Recover fread/fwrite

PSET 4 is really taking me for a wild ride that I am not enjoying whatsoever. #include <stdio.h> #include <stdlib.h> #include <string.h> #include <stdint.h> int num = 0; ...
1
vote
2answers
56 views

Cleaning up PSET4 Blur

I have successfully finished the blur effect on PSET4. Here is a small smattering of the code if(i - 1 >= 0 && j - 1 >= 0) { red += OgImage[i-1][j-1]....

1
2 3 4 5
35