
Lubomir Bourdev wrote:
To demonstrate how GIL can be integrated with other imaging libraries, we decided to create two wrappers of imaging algorithms of another library and invoke them from GIL. We picked Vigra as a test case.
Things work well only for 8-bit grayscale values. 16-bit gray sort of works ok, perhaps the only difference is the need to use different settings. If I use RGB values, however, canny_edge does not compile, and the Gaussian convolution returns the result in grayscale. Other color spaces, channel depths and planar images I am not sure how to set up.
Perhaps I am not using Vigra properly. Prof. Köthe could you take a look at my source file (link above) and let me know if it looks OK?
I got your program to work. The 8-bit grayscale case does indeed give the correct result. In case of 16-bit grayscale, I found that the input grayvalues were shifted by 8 bit. I.e. instead of the value 188, the input image contained 48316 == 188 << 8 (the input file was the same). The edges changed accordingly. This is perhaps a byte order problem, or a bad reinterpret_cast? It failes to compile with 8-bit RGB because cannyEdgelList() is only applicable to scalar images at the moment (the docu says "SrcAccessor::value_type must be convertible to float"). But the convolution example works just fine. Compilation with 16-bit signed int also failes, because GIL doesn't define a conversion from gray8 to gray16s (it should). So VIGRA and GIL seem to be fairly interoperable. You should have contributed to VIGRA instead of starting your own library ;-) Regards Ulli -- ________________________________________________________________ | | | Ullrich Koethe Universitaet Hamburg / University of Hamburg | | FB Informatik / Dept. of Informatics | | AB Kognitive Systeme / Cognitive Systems Group | | | | Phone: +49 (0)40 42883-2573 Vogt-Koelln-Str. 30 | | Fax: +49 (0)40 42883-2572 D - 22527 Hamburg | | Email: u.koethe@computer.org Germany | | koethe@informatik.uni-hamburg.de | | WWW: http://kogs-www.informatik.uni-hamburg.de/~koethe/ | |________________________________________________________________|