Remove shadow during background substraction


    Apr 07 2012 | 6:42 pm
    hi! i found http://maleesh.wordpress.com/2010/03/18/shadow-removing-with-opencv-2/ i found this article, do you think, that it will be hard to implement it in gen? how to start with it?

    • Apr 09 2012 | 2:08 pm
      i did first steps, can you help me please? i need this functionality very much for my next piece.. thank yopu very much!!!
    • Apr 09 2012 | 3:40 pm
      ups. here is my last attempt:
    • Jan 09 2013 | 11:25 pm
      here a shader port! I think it works a little better. Thank you!
      PS: the maleesh blog is protected by password...
    • Jan 10 2013 | 4:19 pm
      woow! thats a good shader but fails to me and im not a shader wiz... :( any idea? thanks!
      -- START GLSL INFO LOG: fp -- Fragment shader failed to compile with the following errors: ERROR: 0:97: error(#160) Cannot convert from: "bool" to: "highp float" ERROR: 0:98: error(#160) Cannot convert from: "bool" to: "highp float" ERROR: 0:99: error(#160) Cannot convert from: "bool" to: "highp float" WARNING: 0:102: warning(#402) Implicit truncation of vector from size: 1 to size: 4 ERROR: 0:105: error(#162) Wrong operand types: no operation "-" exists that takes a left-hand operand of type "const int" and a right operand of type "bool" (or there is no acceptable conversion) WARNING: 0:106: warning(#402) Implicit truncation of vector from size: 1 to size: 4 ERROR: 0:109: error(#160) Cannot convert from: "bool" to: "highp float" WARNING: 0:110: warning(#402) Implicit truncation of vector from size: 1 to size: 4 ERROR: 0:113: error(#160) Cannot convert from: "bool" to: "highp float" WARNING: 0:114: warning(#402) Implicit truncation of vector from size: 1 to size: 4 ERROR: error(#273) 6 compilation errors. No code generated -- END GLSL INFO LOG: fp -- jit.gl.shader: GLSL program failed to compile.
    • Jan 10 2013 | 4:40 pm
      on my machine, i get the following errors ....
      -- START GLSL INFO LOG: fp -- ERROR: 0:91: 'pow' : no matching overloaded function found ERROR: 0:91: 'pow' : no matching overloaded function found ERROR: 0:93: 'pow' : no matching overloaded function found ERROR: 0:97: '=' : cannot convert from 'bool' to 'float' ERROR: 0:98: '=' : cannot convert from 'bool' to 'float' ERROR: 0:99: '=' : cannot convert from 'bool' to 'float' ERROR: 0:102: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:105: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'const int' and a right operand of type 'bool' (or there is no acceptable conversion) ERROR: 0:105: '=' : cannot convert from 'const int' to 'float' ERROR: 0:106: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:109: '=' : cannot convert from 'bool' to 'float' ERROR: 0:110: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:113: '=' : cannot convert from 'bool' to 'float' ERROR: 0:114: '=' : cannot convert from 'float' to '4-component vector of float' -- END GLSL INFO LOG: fp -- jit.gl.shader: GLSL program failed to compile. -- START GLSL INFO LOG: fp -- ERROR: 0:91: 'pow' : no matching overloaded function found ERROR: 0:91: 'pow' : no matching overloaded function found ERROR: 0:93: 'pow' : no matching overloaded function found ERROR: 0:97: '=' : cannot convert from 'bool' to 'float' ERROR: 0:98: '=' : cannot convert from 'bool' to 'float' ERROR: 0:99: '=' : cannot convert from 'bool' to 'float' ERROR: 0:102: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:105: '-' : wrong operand types no operation '-' exists that takes a left-hand operand of type 'const int' and a right operand of type 'bool' (or there is no acceptable conversion) ERROR: 0:105: '=' : cannot convert from 'const int' to 'float' ERROR: 0:106: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:109: '=' : cannot convert from 'bool' to 'float' ERROR: 0:110: '=' : cannot convert from 'float' to '4-component vector of float' ERROR: 0:113: '=' : cannot convert from 'bool' to 'float' ERROR: 0:114: '=' : cannot convert from 'float' to '4-component vector of float' -- END GLSL INFO LOG: fp -- jit.gl.shader: GLSL program failed to compile.
    • Jan 10 2013 | 5:14 pm
      mmm I'm not a shader expert but I think:
      timtom GPU doesn't support pow() function and I've substitute it with (n*n) instead of pow(n,2).
      and yours GPU doesn't support implicit type conversions so I cast them
      try this code.
      Accumulator
    • Jan 10 2013 | 6:21 pm
      I get these errors. Any idea what they are??
      -- START GLSL INFO LOG: fp -- ERROR: 0:105: '-' does not operate on 'int' and 'float' ERROR: 0:106: Use of undeclared identifier 'lt_43' ERROR: 0:106: Use of undeclared identifier 'lt_43' ERROR: 0:106: Use of undeclared identifier 'lt_43' ERROR: 0:106: Use of undeclared identifier 'lt_43' ERROR: 0:107: Use of undeclared identifier 'outMx' -- END GLSL INFO LOG: fp -- jit.gl.shader: GLSL program failed to compile.
    • Jan 11 2013 | 1:57 am
      YES! thanks esnho the new one compiles fine! and even better banging the background matrix.. :)
      im only getting some good results chossing out_mode 1 and tweaking param CD_squared_lt with the other modes 0,2 or 3 seems nothing happens.. can you explain a little bit the params?
      cheers!
    • Jan 11 2013 | 1:37 pm
      @MIB: did you try the last version?
      @carsol: I've done just a copy and paste porting... maybe ćwiek can explain those parameters or the password protected blog linked by him... sorry. If you try the ćwiek you'll notice that the modes are porting for the four outlets of the gen patch.
    • Jan 12 2013 | 1:40 am
      I've found this article, is not the same algorithm but it looks similar and it seems to work well, but I did not any implementations of this.
    • Jan 15 2013 | 9:42 pm
      We are not talking about gen no more so, I put in a GEN patch and the relative shader patch, it's a really simple background subtraction patch.
      Here is the patch, it contains the GEN and shader version:
      I made a lot of confusion in this post, please forgive me.