Beta

Image Processing: Gaussian Blurring

Description
Loading description...
Algorithms
Arrays
Lists
View
AllIssues3Questions1Suggestions1Show Resolved
  • Please sign in or sign up to leave a comment.
  • SirSamiboi Avatar

    I had a lot of fun with this one :)

  • FArekkusu Avatar

    The actual and expected values in the random tests should not be stringified.

  • FArekkusu Avatar

    There should be random tests with small inputs for easier debugging.

  • stackunderflow Avatar

    Edges and corners use their own values as the neighbors.

    I don't understand the examples you give. Can you explain?

    • depperm Avatar

      If you look at the example I try to show what I mean. Say you have an image:

      A B C
      F G H 
      K L M
      N O P
      

      G and L are the only pixels with 8 neighbors present but each pixel still needs 8 for the filter to work. A only has 3, so the other 5 have to come from somewhere else; for this algorithm you should use the edges/corners own values. So with A the other neighbors in relation to the whole image (besides B, F, and G) will look like:

      A A B
      A A B C
      F F G H
        K L M
        N O P
      
  • Blind4Basics Avatar

    Hi again,

    You may want to change the description, saying clearly that if the kernel grid will always be 3x3, this is not the case for the image.
    This is not really problematic, but at the beginning I assumed it would be the case for the image too and I had to change the way I constructed the loops (not really funny to have to go "back and forward" in the algorithm).

    Second point : the output of the assert tests is a bit confusing when the code fails : it does not apply the string formating (the line feeds are displayed as \n).
    If you want to display correctly the output, you could "double check" the tests :

    • Evaluate the warrior's code and store it
    • check against the expected array : if different print it
    • then feed the assert test

    What do you think ?

  • Blind4Basics Avatar

    Nice one ! It was funny to implement, thanks for the challenge.

  • ChristianECooper Avatar

    There seems to be a disparity between the example test and the random test when running the submission test suite. One seems to expect int values returned and the other expects float values to be returned. It is currently not possible to produce output that passes both tests.

    • depperm Avatar

      They both expect int values. Why do you think one or the other expects float values?

    • Blind4Basics Avatar

      On my side, no troubles with the tests.

    • ChristianECooper Avatar

      Sorry, didn't see you had replied.

      I think floats are involved because of this output from the first 'hidden' test:

      image: [[13, 14, 14], [15, 20, 21], [15, 20, 25]]
      kernel: [[0.1, 0.12, 0.1], [0.12, 0.2, 0.12], [0.1, 0.12, 0.1]]
      
      '15, 16, 17\n17, 19, 21\n18, 21, 25' should equal '15.0, 16.0, 17.0\n17.0, 19.0, 21.0\n18.0, 21.0, 25.0'
      

      The test failure is explicitly telling me to return floats...