mkalten / reacTIVision

computer vision framework for tangible interactive surfaces
Other
308 stars 65 forks source link

`tile size` default value for fullHD (1920x1080) gives artifacts #22

Closed s-light closed 7 years ago

s-light commented 7 years ago

found that the default value for tile size is set to 10. https://github.com/mkalten/reacTIVision/blob/master/common/Main.cpp#L92

this causes artifacts in the thresholder algorithm - visible as black or white horizontal stripes. if i use the onscreen option (key g) and change the tile size it locks me to the value 2. i can't change this. but the strips are gone. if i use the xml configuration file and set other values (for example 20) this gives no visible artifacts. (but i don't know if such a high value can make sense... have to read more about how this all works...)

seems this is set / initalized at FrameThresholder.cpp#L144 if i understand this correct it is also dependent on much threads are used - i checked this with setting threads="1" and now i was able to choose 2,3,4,5,6,8,10,12,15,20,24,30,40,60,120. so eventually at some point it would make sense to allow more threads for big pixel formats?

mkalten commented 7 years ago

The tile size value can indeed produce horizontal artifacts if you choose an uncommon divider that depends on the image size and number of threads, so if you have a lot of threads (autodected by the number of logical cpus) then the available values may be limited. But as you noticed you can also override the tile size and number of threads in your settings. If you have multiple CPUs then you should choose 2 or 4 threads manually, which should also give you more tile size choices. In general at this resolution 20 should be quit good though, just see how clean the thresholded image looks best to you.