Questions tagged [filter]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
14 views

filter-less, reflection, segmentation fault, core dumped, PSET4

dear Friends of CS50X, I have been working on pset4, filter-less, reflection for several hours now. I think my code does what it is supposed to do. Also, in my solution I tried to use the concepts ...
user avatar
0 votes
2 answers
36 views

Image blurs but check50 fails for filter less. Why?

The image is blurry and everything seems to work fine. But check50 fails. Hence, I am not sure where I made the mistake. // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) {...
user avatar
0 votes
1 answer
16 views

Why is my array code not working in case of pset4, filter's reflect function?

The purpose of reflect is to invert the array of pixels from right to left. So, I decided to create an array and store the data with a negative count loop. Then repopulate the array with a positive ...
user avatar
0 votes
0 answers
19 views

pset4 blur loop passing but not sure why

I've been working on the blur segment for a while now, trying many different iterations of its code. I finally got it down to where it (kind of) passed with this code with the exception of two checks: ...
user avatar
1 vote
1 answer
34 views

Pset4 Blur filter (more comfortable) assign new struct to image does not work

I was trying to use the following code to complete the blur function. Everything seems fine but I just couldn't update the RGBTRIPLE variable image directly with another RGBTRIPLE variable I crreated. ...
user avatar
0 votes
1 answer
38 views

Pset4 Filter (Less) - Invalid operands to binary expression (Int and RGBTRIPLE)

Hello. I'm facing a problem trying to compile this code. I got the error msg Invalid operands to binary expression ('int' and 'RGBTRIPLE') void blur (int height, int width, RGBTRIPLE image[height][...
user avatar
0 votes
1 answer
54 views

Blur in cs50 problem set 4

My code for the blur filter works fine to edge, corner and middle pixels, but it doesnt work right for a whole 3x3 or 4x4 picture i've been trying everything but nothing seems to fix it. This is what ...
user avatar
2 votes
1 answer
74 views

Questions regarding pset4 Blur filter (less comfortable)

After tinkering for a while with why my filter didn't work, I finally succeded with the following code: // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { //make copy ...
user avatar
0 votes
0 answers
33 views

pset4 filter edges too white

I've read through other posts that had a similar result: the output image being too white; however, the solutions to those have not fixed my code. Also, there's a strange dark vertical line running ...
user avatar
0 votes
0 answers
47 views

pset4 blur function not working properly with tests

Here's my solution for the blur function on the less hard pset4 exercise filter. When I test the function it seems to work fine, and it outputs blurred images, but some tests do not pass. I think I ...
user avatar
0 votes
1 answer
38 views

filter less: Reflection : image is reflected correctly but does not pass check50

void reflect (int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE invert[height][width]; for (int i=0; i<height; i++) { for (int j=width,s=0; j>=0; j-...
user avatar
1 vote
1 answer
840 views

My CS50 PSET4 Filter (Less) Blur function doesn't pass check50 despite seemingly working fine

I've been working on CS50 PSET4 Filter (Less) and finally got a working blur function (or so I thought!) // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE ...
user avatar
0 votes
2 answers
41 views

Blur problem (Less)

I can't catch the error in my code, I think that I 'm using the right Algorithm and approach. // creating a copy to apply blur on it RGBTRIPLE copy[height][width]; // initializing avaerages' ...
user avatar
0 votes
1 answer
137 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 ...
user avatar
0 votes
0 answers
67 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 ...
user avatar
0 votes
1 answer
287 views

PSET4 filter less Blur function

I am stuck in Pset4-Filter/less the Blur function in particular. My problem is the image blurred correctly but does not pass check50. Check50 result : :( blur correctly filters middle pixel >> ...
user avatar
0 votes
1 answer
23 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) { ...
user avatar
1 vote
1 answer
55 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++)...
user avatar
0 votes
1 answer
80 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 ...
user avatar
  • 47
1 vote
2 answers
806 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 ...
user avatar
  • 47
0 votes
2 answers
40 views

Blur PSet4 (Filter) - Compilation errors passing reference to the image[height][width] array in helper function using pointers

I'm having a brainfart wrapping my head around the use of pointers when trying to pass a reference to the image 2D array in a helper function that I created to assist in the blur effect. Here's blur: ...
user avatar
  • 1
0 votes
1 answer
75 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 ...
user avatar
0 votes
1 answer
55 views

Check50 shows errors on Blur Function, Filter even though images are blurred

My blur function seems to be working when I input the sample images and open the output file but check50 shows 4/5 errors :( blur correctly filters middle pixel expected "127 140 149\n", not ...
user avatar
1 vote
1 answer
38 views

I am asking about pset4. What is the importance of creating a header file like helpers.h?

I am confused about the usage of helpers.h and declaring the functions in it. As I can from the beginning include the bmp.h in the helpers.c and create the functions in the helpers.c.
user avatar
0 votes
1 answer
183 views

Pset4 filter blur corner

I finished the other filters and just the blur filter is giving errors. The errors are the following: :) blur correctly filters pixel on edge :( blur correctly filters pixel in corner expected &...
user avatar
0 votes
1 answer
58 views

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

I can't get edges to work I would really like some hints to what's wrong with my code. // Detect edges void edges(int height, int width, RGBTRIPLE image[height][width]) { //copying original image ...
user avatar
1 vote
1 answer
142 views

PSET4 — Filter (more) — Edges Error

I'm currently working through the filter problem, and I'm not sure why it's not working on the pixels on the edge (it also seems to only be incorrect on the B value in RGB). This is the message I'm ...
user avatar
1 vote
1 answer
31 views

My blur function blurs every image, but fails every check50 check - please help!

I'd really appreciate any help that can be offered here. My code seems to output a blurred image perfectly, but fails every check50 check and I can't work out why... void blur(int height, int width, ...
user avatar
0 votes
1 answer
39 views

Pset 4 - Filter - Edge detection

My function kind of works but the result is too white. I saw some people having the same issue because they didn't store the new pixels in a temporary image, but I already did that. void edges(int ...
user avatar
0 votes
1 answer
56 views

PSet 4 Filter(less) Sepia - Why is my output image slightly red tinted?

At first, I forgot to cap the RGB values at 255 for sepia, and it resulted in white pixels being blue. But other areas were fine(proper sepia). So additionally, I added the ternary operators to check ...
user avatar
0 votes
1 answer
94 views

pset4/filter: What is being instantiated with RGBTRIPLE(*image)[width]

I'm struggling to get my head around what is being instantiated here with (*image) (and what to do with it) in this line: RGBTRIPLE(*image)[width] = calloc(height, width * sizeof(RGBTRIPLE)); I ...
user avatar
  • 101
0 votes
1 answer
37 views

Some values in my 'edges' don't pass check50

the rightmost values in the matrix in check50 is wrong but the other values are correct. I'm not really sure what's wrong. code: void edges(int height, int width, RGBTRIPLE image[height][width]) { ...
user avatar
0 votes
1 answer
26 views

Not getting the edge function to work

Please find my code for the edge function below, I'm getting all errors on check50 but can't understand what's wrong. // Detect edges void edges(int height, int width, RGBTRIPLE image[height][width]) {...
user avatar
0 votes
1 answer
49 views

Problem Set 4 Blur --- incorrect output

I am currently working at the blur filter. While the other task were pretty easy, this one ist very much difficult. I have spend hours looking for the mistake - but without success, I tried to do it ...
user avatar
0 votes
1 answer
49 views

Need help solving blur with c

Code: void blur(int height, int width, RGBTRIPLE image[height][width]) { //temporary image to swap RGBTRIPLE temp_img[height][width]; for (int g = 0; g < height; g++) { for (int h = 0; h < ...
user avatar
0 votes
0 answers
33 views

check50 is not working with pset4 filter

I've been trying to check problemset4 filter-less but check50 is not working The username and password is correct and I have visited submit.cs50.io as the message says and I was logged in there but ...
user avatar
0 votes
2 answers
168 views

Pset4, the first problem "Filter". How can I define the grayscale function recursively?

I have a question about problem 4, assignment 1 Filter, where we have to define the grayscale function. So it is actually not difficult to define this function with a loop in a loop. But I am trying ...
user avatar
1 vote
2 answers
79 views

What's my error?

I am having some errors with my code in check50. All of my code is on this gist. Grayscale - expected "28 28 28\n", not "27 27 27\n" in without whole number average. I am using ...
user avatar
  • 21
0 votes
1 answer
38 views

Pset4Ffilter - Starting Off

I'm doing the pset4 filter (less comfortable),but I just don't know where to start. Can someone pleases give me some starting off tips?
user avatar
0 votes
0 answers
47 views

Problem with filter (pset 4): Blur and edge

All the filters on the filter program work well, but check50 is giving me a few errors, which I think, is due to rounding issues. But, I have checked and re-checked the code for those errors, and ...
user avatar
1 vote
2 answers
55 views

Blur only working with middle pixel

I've been stuck in this problem for a while, and the code only works when its inputted a middle pixel. Does anyone have a clue? I've searched everywhere for this particular issue, but I have only ...
user avatar
  • 11
1 vote
1 answer
62 views

pset4 filter - only blurs the corners correctly

i can`t get the picture blurred at all (it comes out a complete mash up of colours blended together ...) ...i' ve been trying to figure this out for months now :(( HELP! void blur(int height, int ...
user avatar
  • 109
0 votes
1 answer
29 views

Filter(less) Blur is all but correct for 1 or 2 values

I've been looking through the similar questions and they don't really help me. I clicked the link to see the results and double checked my code but it just doesn't seem to want to work. Here's my code:...
user avatar
  • 1
0 votes
1 answer
94 views

Need help with pset4 filter blur

Getting close on pset4 filter (less) but getting hung up with the following errors for the blur function. Anyone able to see what I am doing wrong? Would welcome any advice. Here are the errors I am ...
user avatar
0 votes
1 answer
77 views

PSET filter reflect

Reflects sort of works, but when running cs50 check the message: :( reflect correctly filters 1x2 image expected "0 0 255\n255 0...", not "0 0 255\n0 0 2..." :( reflect ...
user avatar
0 votes
1 answer
72 views

cs50 Pset 4 filter:Greyscale. Cade is not averaging correctly?

So I am a little stuck on the Greyscale protion of the Pset4. I have the code in place as follows... void grayscale(int height, int width, RGBTRIPLE image[height][width]) { for (int i = 0; i < ...
user avatar
  • 7
2 votes
1 answer
75 views

pset4 - filter program,can't figure out what exactly is the problem with blur!

Can't figure out what the problem with this code is. It seems to be working correctly for corners, but for nothing else. Please help! void blur(int height, int width, RGBTRIPLE image[height][width]) { ...
user avatar
0 votes
1 answer
154 views

Pset4 Reflect Filter Challenges - Not Reflecting

I am working on reflecting this image. I think I got the logic correctly, but I am not positive about that. However, my image did not reflect. Is this because I need to use malloc? I tried to but ...
user avatar
0 votes
1 answer
72 views

Pset 4 Blur Filter Program Seems to Compile but Doesn't Output Anything and Check50 Reads Errors

I am having trouble with the blur function. I am not given any error messages when I run the program, and it creates an output image as if the blurring is working. However, when I open the output ...
user avatar
0 votes
1 answer
126 views

pset4 filter/blur code problem

I have written code for the blur filter in problem set 4. The code compiles and runs fine and seems to blur the image but when I run check50 it says that the RGB values aren't correct. I have looked ...
user avatar