hello,
after lot's of times to understand the problem, Antoine and me finally realise that artoolkit use RGB image on linux, but pix_opencv provide RGBA image. He made a working prototype using the code on the svn, and openCV conversion routine.
is there a Gem way to convert RGBA to RGB? (in order to remove openCV dependency) (this look to be mandatory only on linux)
Here is the code that we are now using... (makefile should be manually adjusted since we don't know how to deal with autoconf).
cheers Cyrille
On 04/04/2011 07:37 PM, cyrille henry wrote:
hello,
after lot's of times to understand the problem, Antoine and me finally realise that artoolkit use RGB image on linux, but pix_opencv provide RGBA image.
well Gem generally provides RGBA images, not only pix_opencv.
He made a working prototype using the code on the svn, and openCV conversion routine.
is there a Gem way to convert RGBA to RGB? (in order to remove openCV dependency) (this look to be mandatory only on linux)
<code> imageStruct*rgbaimage=...; imageStruct rgbimage; rgbimage.convertFrom(rgbaimage, GL_RGB); </code>
simple, isn't it?
Here is the code that we are now using... (makefile should be manually adjusted since we don't know how to deal with autoconf).
next time, it would be great if you could simply send the "svn diff", which is a trifle smaller than the full zip :-)
anyhow, thanks for looking at [pix_artoolkit]. i'm a bit hesitant to blindly include the propsed change, mainly because it seems to be a bit like magic to me. is there any documentation about RGB being used on linux rather than RGBA? the only thing i found is [1], which states that the color is "platform specific" (whatever that means), and that it is usually ARGB though the order of r,g,b components is irrelevant, which i always read is a 32bit pixel. obivously this is wrong. there seems to be a typedef AR_PIXEL_FORMAT, but i haven't seen it being used anywhere (but i only look at the online docs and not at some actual code)
so now the way to proceed would be: - find a way to reliably detect which format is needed by a ARToolkit (preferrably at runtime, rather than at compile time) - convert to the requested format using Gem's convertFrom/convertTo routines (and extend that, if a format is missing)
even better would be if we could tell ARToolkit which format we want to present the data in (it seems a bit weird to let Gem convert from YUV to RGB, and then ARToolkit will convert from RGB to Grayscale)
fgamsdr IOhannes
[1] http://artoolkit.sourceforge.net/apidoc/ar_8h.html#b2868d9587c68fb7255d4f270...
hello
Le 05/04/2011 09:45, IOhannes zmölnig a écrit :
On 04/04/2011 07:37 PM, cyrille henry wrote:
hello,
after lot's of times to understand the problem, Antoine and me finally realise that artoolkit use RGB image on linux, but pix_opencv provide RGBA image.
well Gem generally provides RGBA images, not only pix_opencv.
sorry, i wanted to write Gem provide RGBA image.
He made a working prototype using the code on the svn, and openCV conversion routine.
is there a Gem way to convert RGBA to RGB? (in order to remove openCV dependency) (this look to be mandatory only on linux)
<code> imageStruct*rgbaimage=...; imageStruct rgbimage; rgbimage.convertFrom(rgbaimage, GL_RGB); </code>
simple, isn't it?
yes, it's very simple. thanks
Here is the code that we are now using... (makefile should be manually adjusted since we don't know how to deal with autoconf).
next time, it would be great if you could simply send the "svn diff", which is a trifle smaller than the full zip :-)
well, this version was heavily modify, and it is no more compatible with the original object. i think we should start again, now that we know what to do, and how to do it. but it look like it not the way you want things to be done...
anyhow, thanks for looking at [pix_artoolkit]. i'm a bit hesitant to blindly include the propsed change, mainly because it seems to be a bit like magic to me. is there any documentation about RGB being used on linux rather than RGBA?
no, that's why it was hard to find.
from the documentation : http://www.hitl.washington.edu/artoolkit/documentation/devframework.htm artoolkit can accept lot's of different format...
but looking at page like this : http://code.google.com/p/ary/wiki/InstallationARToolkit explain a configuration that is working : $ export ARTOOLKIT_CONFIG="v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink"
and they use x-raw-rgb,bpp=24... that's why we try converting RGBA to RGB, and it's finally (magically) working...
the only thing i found is [1], which states that the color is "platform specific" (whatever that means), and that it is usually ARGB though the order of r,g,b components is irrelevant, which i always read is a 32bit pixel. obivously this is wrong. there seems to be a typedef AR_PIXEL_FORMAT, but i haven't seen it being used anywhere (but i only look at the online docs and not at some actual code)
so now the way to proceed would be:
- find a way to reliably detect which format is needed by a ARToolkit (preferrably at runtime, rather than at compile time)
- convert to the requested format using Gem's convertFrom/convertTo routines (and extend that, if a format is missing)
even better would be if we could tell ARToolkit which format we want to present the data in (it seems a bit weird to let Gem convert from YUV to RGB, and then ARToolkit will convert from RGB to Grayscale)
yes, lot's of things could be improved. but for now, i'm happy to have artoolkit working, and i'm late on the project that should use it. so, i'm sorry, but now i'll focus on using artoolkit, better than improving the code...
thanks for you comments, Cyrille
fgamsdr IOhannes
[1] http://artoolkit.sourceforge.net/apidoc/ar_8h.html#b2868d9587c68fb7255d4f270...
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
here is a diff that only convert rgba to rgb before sending to artoolkit. this make artoolkit to work on 2 different linux (ubuntu) computer.
112c112,115 < if (::arDetectMarker(image.data, m_thresh, &marker_info, &marker_num) < 0) { ---
imageStruct rgbimage; rgbimage.convertFrom(&image, GL_RGB);
if (::arDetectMarker(rgbimage.data, m_thresh, &marker_info, &marker_num) < 0) {
Cyrille
Le 05/04/2011 10:29, cyrille henry a écrit :
hello
Le 05/04/2011 09:45, IOhannes zmölnig a écrit :
On 04/04/2011 07:37 PM, cyrille henry wrote:
hello,
after lot's of times to understand the problem, Antoine and me finally realise that artoolkit use RGB image on linux, but pix_opencv provide RGBA image.
well Gem generally provides RGBA images, not only pix_opencv.
sorry, i wanted to write Gem provide RGBA image.
He made a working prototype using the code on the svn, and openCV conversion routine.
is there a Gem way to convert RGBA to RGB? (in order to remove openCV dependency) (this look to be mandatory only on linux)
<code> imageStruct*rgbaimage=...; imageStruct rgbimage; rgbimage.convertFrom(rgbaimage, GL_RGB); </code>
simple, isn't it?
yes, it's very simple. thanks
Here is the code that we are now using... (makefile should be manually adjusted since we don't know how to deal with autoconf).
next time, it would be great if you could simply send the "svn diff", which is a trifle smaller than the full zip :-)
well, this version was heavily modify, and it is no more compatible with the original object. i think we should start again, now that we know what to do, and how to do it. but it look like it not the way you want things to be done...
anyhow, thanks for looking at [pix_artoolkit]. i'm a bit hesitant to blindly include the propsed change, mainly because it seems to be a bit like magic to me. is there any documentation about RGB being used on linux rather than RGBA?
no, that's why it was hard to find.
from the documentation : http://www.hitl.washington.edu/artoolkit/documentation/devframework.htm artoolkit can accept lot's of different format...
but looking at page like this : http://code.google.com/p/ary/wiki/InstallationARToolkit explain a configuration that is working : $ export ARTOOLKIT_CONFIG="v4l2src device=/dev/video0 use-fixed-fps=false ! ffmpegcolorspace ! capsfilter caps=video/x-raw-rgb,bpp=24 ! identity name=artoolkit ! fakesink"
and they use x-raw-rgb,bpp=24... that's why we try converting RGBA to RGB, and it's finally (magically) working...
the only thing i found is [1], which states that the color is "platform specific" (whatever that means), and that it is usually ARGB though the order of r,g,b components is irrelevant, which i always read is a 32bit pixel. obivously this is wrong. there seems to be a typedef AR_PIXEL_FORMAT, but i haven't seen it being used anywhere (but i only look at the online docs and not at some actual code)
so now the way to proceed would be:
- find a way to reliably detect which format is needed by a ARToolkit (preferrably at runtime, rather than at compile time)
- convert to the requested format using Gem's convertFrom/convertTo routines (and extend that, if a format is missing)
even better would be if we could tell ARToolkit which format we want to present the data in (it seems a bit weird to let Gem convert from YUV to RGB, and then ARToolkit will convert from RGB to Grayscale)
yes, lot's of things could be improved. but for now, i'm happy to have artoolkit working, and i'm late on the project that should use it. so, i'm sorry, but now i'll focus on using artoolkit, better than improving the code...
thanks for you comments, Cyrille
fgamsdr IOhannes
[1] http://artoolkit.sourceforge.net/apidoc/ar_8h.html#b2868d9587c68fb7255d4f270...
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev
GEM-dev mailing list GEM-dev@iem.at http://lists.puredata.info/listinfo/gem-dev