Questions tagged [filter]
The filter tag has no usage guidance.
131
questions
0
votes
0
answers
21
views
pset4 filter/more edge
My code compiles and run okay I does everything but when checking with check50 It shows error
My code is :
#include "helpers.h"
#include <math.h>
// Make a copy of array
void ...
0
votes
2
answers
46
views
CS50 pset4 filters/less check50 error
I am trying to check my code using check50 but it gives me the error
But when I am compiling it and running it from the terminal it runs just fine.
My code for helper.c is
#include "helpers....
0
votes
0
answers
9
views
Pset 04 Edges FIlter. I don't know whats wrong with the code
I've been trying to implement the function edges with an auxiliary one, determineEdges. It compiles, but generates, probably by an error, a black image.
I'm having trouble to figure out what is the ...
0
votes
0
answers
16
views
CS50 Filter - less, sepia function not giving output as expected
What did i do wrong here, I'm on blur function right and i compiled my code and it compiles gives sepia filter but with bit of green bleed on 3 out of 4 pictures i went through my code but cannot find ...
0
votes
0
answers
28
views
Week 4 - Filter (More Comfortable) - Edge
I cannot for the life of me understand what's wrong here. It does apply a filter, but it looks too blue and doesn't pass the CS50 check. Any ideas?
void edges(int height, int width, RGBTRIPLE image[...
0
votes
0
answers
16
views
Can't figure out what is wrong with my blur code
void blur(int height, int width, RGBTRIPLE image[height][width])
{
// DEFINE ONE STRUCT TO ACT AS BUFFER MEANWHILE CALCULATING AVERAGE
RGBTRIPLE buffer[height][width];
// GO THROUGH EACH ...
0
votes
1
answer
35
views
Segfault while declaring 2d array in filter-more's edges function. Probably a lack of memory?
At the very start of the edges function i try to declare an array to hold the image with black borders (now the first comment), but as i've discovered using printfs, it causes a segfault. I searched ...
0
votes
1
answer
70
views
Pset4 Sepia Errors - 3x3 and 4x4 images
I just ran my code through check50 and it's throwing the following errors:
:( sepia correctly filters more complex 3x3 image
:( sepia correctly filters 4x4 image
But I looked further into the issue ...
0
votes
1
answer
162
views
CS50 PSET 4 Filter-less, Blur function not filtering 3x3 and 4x4 images correctly
I have read many similar problems on here about the same issue. I believe my function is correct, although redundant and not very stylish. It should however get the job done. I get the same pixels ...
0
votes
1
answer
174
views
[SOLVED]PSET-4 - Filter - Blur - blur correctly filters pixel in corner
I am getting these 3 errors on check50:
blur correctly filters pixel in corner
expected "70 85 95\n", not "69 192 95\n"
blur correctly filters 3x3 image
expected "70 ...
0
votes
1
answer
354
views
Filter less, Blur, why does my code not blur the edge and 3x3 and 4x4 image?
I am stuck at the blur function in filter less. Your task is to calculate the average RGB value of the surrounding pixel in one row and one column of a bmg image, including the middle pixel. It works ...
0
votes
1
answer
114
views
Filter blur errors
I'm working on the filter-less problem in pset4. I've got all of my functions to work properly except for the blur function. I am getting the following errors I believe due to problems with how I'm ...
0
votes
1
answer
156
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 ...
0
votes
1
answer
189
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])
{...
0
votes
1
answer
30
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 ...
1
vote
1
answer
47
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.
...
1
vote
1
answer
103
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][...
0
votes
1
answer
141
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 ...
2
votes
1
answer
1k
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 ...
0
votes
1
answer
114
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-...
1
vote
1
answer
2k
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 ...
0
votes
1
answer
49
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' ...
0
votes
1
answer
385
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
0
answers
70
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 ...
1
vote
1
answer
544
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 >> ...
0
votes
1
answer
28
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)
{
...
1
vote
1
answer
70
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
1
answer
110
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 ...
1
vote
2
answers
2k
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 ...
1
vote
2
answers
46
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:
...
0
votes
1
answer
120
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
1
answer
118
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 ...
1
vote
1
answer
51
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.
0
votes
1
answer
320
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 &...
0
votes
1
answer
123
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 ...
1
vote
1
answer
360
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 ...
1
vote
1
answer
43
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, ...
0
votes
1
answer
78
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 ...
0
votes
1
answer
108
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 ...
-1
votes
1
answer
154
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 ...
0
votes
1
answer
42
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])
{
...
0
votes
1
answer
28
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])
{...
0
votes
1
answer
61
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 ...
0
votes
1
answer
55
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 < ...
0
votes
0
answers
42
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 ...
0
votes
2
answers
213
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 ...
1
vote
2
answers
104
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 ...
0
votes
1
answer
44
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?
0
votes
0
answers
48
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 ...
1
vote
2
answers
74
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 ...