NLeSC / LargeScaleImaging

Data, Software,Results and Publications for the Large Scale Imaging research @ NLeSc
Apache License 2.0
3 stars 0 forks source link

Write tests for helper function binarize #6

Closed dafnevk closed 8 years ago

dafnevk commented 8 years ago

We want to have a unit test for the function binarize (in the helpers module). This function should test the correct behavior for a specific test image.

elboyran commented 8 years ago

The nosetests on my VM (Linux on WIndows host) in the shared folder works only with --exe flag (cant change the file permissions!), Also verbose is useful, so the command to use is nosetests tests/ -v --exe

dafnevk commented 8 years ago

It seems strange and undesired to me that the files are executable on your system, and that you can't change it. Is git maybe not tracking it correctly? See: http://stackoverflow.com/questions/3821263/what-does-git-think-a-files-executable-bits-value-is http://superuser.com/questions/300601/why-git-keeps-track-of-changes-in-execution-permission/300615

Maybe it has to do with the fact it's in the shared folder with Windows...

elboyran commented 8 years ago

"Maybe it has to do with the fact it's in the shared folder with Windows..." I'm afraid so.

elboyran commented 8 years ago

Done. Flag "visualize" has been misspelled, corrected some places only (affected by the tests), might need to fix the rest.

elboyran commented 8 years ago

Test for a different threshold than 128.

elboyran commented 8 years ago

Something very weird is going on. I made several more tests (for different threshold levels) and it passes them all, but for level 130. In MATLAB the rule I use is "binary = gray>= level", while it seems opencv uses "binary = gray > thresh". Still changing MATLAB code for level 130 to >, not >= still doesn't help and this particular test fails!??

elboyran commented 8 years ago

Fix the MATLAB code to use > not >=. Regenerate the true binarised images in MATLAB. Try all tests again.

elboyran commented 8 years ago

MATLAB code fixed. 4 binarization tests for levels 0, 57, 175 and 255 committed.