Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Snap image with Gig-E camera #16

Closed
hanabata opened this issue Sep 2, 2014 · 15 comments
Closed

Snap image with Gig-E camera #16

hanabata opened this issue Sep 2, 2014 · 15 comments
Assignees
Labels

Comments

@hanabata
Copy link

hanabata commented Sep 2, 2014

Dear all,

Now I and my colleague are trying to simply snap the image with the camera DMK 23GM021, employing Gigabit-ethernet communication (Product of Imaging Source company).
We have used arvcameratest.c and related libraries provided athttps://github.com/TheImagingSource/tiscamera/wiki/Aravis.
However, this program seems to capture an image as one shot in the video. This is different from what we want. We want to simply capture an image at an arbitrary time and take images a few times with a short interval (~10ms). The video mode takes a longer dead time (~500ms) than the time we want to achieve. We also want to make a loop of the process using several cameras, i.e., taking an image one after another with different cameras. So we are afraid that the memory buffer is saturated if the video mode is used because we need a few images and others are stored in the buffer.

If you know how to take a snap shot and shorten the dead time or have any suggestions, could you teach us?

We really need your help.

Best regards,

@TIS-Edgar TIS-Edgar self-assigned this Sep 2, 2014
@TIS-Edgar
Copy link
Member

Hi,

With the description of your wanted setup I would suggest you take a look a look at triggering.

It should allow you the sequenced image retrieval from different cameras and also enable custom time intervals.

Cheers,

@hanabata
Copy link
Author

hanabata commented Sep 3, 2014

Hi,

Thank you very much for your suggestion. We are trying to do that but could you also teach us the page or any document describing it? It would help us so efficiently.
I would like to ask you one more question. In this trigger mode, does the camera work as not video but simply picture (snap shot) mode?

@TIS-Edgar
Copy link
Member

The steps for triggering with aravis are:

  • Create a stream
  • Register callback function
  • Set acquisition mode to continuous
  • Activate Trigger Mode
  • Start acquisition
  • Send Trigger Command to capture image

The callback function will now be called every time a new image arrives (i.e. you activated trigger).

A real life example can be found here:
https://gitorious.org/gevcapture/gevcapture/source/4c260062d6e7b1da2cec04215734e8ea901fe349:gevCapture.c#L360

I hope this helps clarifying things for you.

@hanabata
Copy link
Author

hanabata commented Sep 5, 2014

Hi,

Thank you a lot!
I tried to compile gevCapture.c to see how it works but failed with an error. I've attached the log of the compilation below. If you know how to solve it, could you teach me?
I already succeeded to install ARAVIS 0.3.5 and /usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libgobject-2.0.so exists.

/usr/bin/gcc -g -O0 -std=c99 -Wall -I/usr/local/include/aravis-0.4 -pthread -I/usr/include/gtk-3.0 -I/usr/include/atk-1.0 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -DUSE_GIGE -pthread -c -o gevCapture.o -DVERSION="$(./printversion.sh)" gevCapture.c
gevCapture.c: In function ‘main’:
gevCapture.c:1012:3: warning: ‘g_type_init’ is deprecated (declared at /usr/include/glib-2.0/gobject/gtype.h:669) [-Wdeprecated-declarations]
g_type_init(); // depreciated, but required on older installs
^
/usr/bin/gcc -L/usr/local/lib -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -Wl,-E -lrt -lpthread -o gevCapture gevCapture.o -laravis-0.4
/usr/bin/ld: gevCapture.o: undefined reference to symbol 'g_type_check_instance_is_a'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libgobject-2.0.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [gevCapture] Error 1

@TIS-Edgar
Copy link
Member

Do you have all necessary header files installed?
Execute sudo apt-get install libglib2.0-dev on ubuntu/debian to install them.

I was able to compile the project fine, so it boils down to where the difference in our setup is.

@hanabata
Copy link
Author

hanabata commented Sep 9, 2014

Hi,

I already install libglib2.0-dev but somehow failed. This error occurs on the Ubuntu 13.10 in my laptop.
By the way, with some reasons we have mainly used the computer installed the Ubuntu 12.04.5 LTS and also failed with the same error. Furthermore, I found that ARAVIS_0_3_1 is compiled success fully this Ubuntu (12.04.5 LTS) while after 0.3.2 we fail the compilation as follows,

% ./configure --enable-viewer --enable-gst-plugin
Configuration:

Compiler: gcc
Compiler flags: -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libxml2
Linker flags: -lm -pthread -lgio-2.0 -lgobject-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0 -lz

Build viewer: yes
Build gstreamer plugin: yes
Build gstreamer-0.10 plugin: no

% make[1]: Entering directory /home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer' CCLD arv-viewer arvviewer.o: In functionarv_viewer_select_camera_cb':
/home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer/arvviewer.c:668: undefined reference to _gst_fraction_type' collect2: ld returned 1 exit status make[1]: *** [arv-viewer] Error 1 make[1]: Leaving directory/home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer'
make: *** [all-recursive] Error 1

On the Ubuntu 13.10, I've never seen this kind of error. I guess the lack of streamer-0.10 plugin might be the cause despite although I did not include the --enable-gst-plugin-0.10 option. Is it necessary for the ARAVIS compilation? Actually I looked for the way to install gstreamer-base-0.10
gstreamer-app-0.10 but I could not find suitable one. If you know, could you teach me?

One more thing, what version of ARAVIS is needed for the compilation of gevCapture.c?

Sorry for making the thing complicated.
Thank you!

@TIS-Edgar
Copy link
Member

Hi,

The viewer changed to gstreamer-1.0 with release 0.3.2.
You can find the announcement here: http://www.freelists.org/post/aravis/Release-of-Aravis-032

Quote:

Changes:

  • gst_plugin: new plugin based on gstreamer 1.0, in addition to the existing 0.10 version.
    • gst_plugin: add packet-resend property.
  • viewer: port to gstreamer 1.0, and drop support for gtk+ 2.0.
  • viewer: fix video output for camera with buggy time stamping.
  • camera: fix frame rate setting for Point Grey devices.

If you wish to use or plugins you will currently have to use gst-0.10 (which hopefully will change soon).

_gst_fraction_type' undefined reference

gcc seems to find the header but not the library to resolve gst_fraction_type, which is....weird.
Do any mistakes occur during configure (as in missing library, etc)?
I have uploaded a successful configure for comparisons sake here.

If you need to install gstreamer libraries I would suspect libgstreamer1.0-dev or something related is missing.

One more thing, what version of ARAVIS is needed for the compilation of gevCapture.c?

I am not aware of any restrictions to certain aravis version. The API has not changed for a long time and should be considered stable, so it should not matter which version is used.

@hanabata
Copy link
Author

Hi,

I've not seen any errors and false during configure. I got exactly the same result for ARAVIS_0_3_2 on the Ubuntu 12.04.5 LTS as yours with the same options in your example.
The result of the configure is below.

Configuration:

Compiler: gcc
Compiler flags: -pthread -I/usr/include/glib-2.0 -I/usr/lib/i386-linux-gnu/glib-2.0/include -I/usr/include/libxml2
Linker flags: -lm -pthread -lgio-2.0 -lgobject-2.0 -lxml2 -lgthread-2.0 -lrt -lglib-2.0 -lz

Build viewer: yes
Build gstreamer plugin: yes
Build gstreamer-0.10 plugin: yes

When I executed make command, I got the same error as one in my previous comment.

% make
….
….
GICOMP Aravis-0.4.gir
make[2]: Leaving directory /home/amc/hanabata/AMC/ARAVIS_0_3_2/src' make[1]: Leaving directory/home/amc/hanabata/AMC/ARAVIS_0_3_2/src'
Making all in viewer
make[1]: Entering directory /home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer' CC arvviewer.o CCLD arv-viewer arvviewer.o: In functionarv_viewer_select_camera_cb':
/home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer/arvviewer.c:668: undefined reference to _gst_fraction_type' collect2: ld returned 1 exit status make[1]: *** [arv-viewer] Error 1 make[1]: Leaving directory/home/amc/hanabata/AMC/ARAVIS_0_3_2/viewer'
make: *** [all-recursive] Error 1

I have no idea why this happens.

Cheers,

@TIS-Edgar
Copy link
Member

Ok,

I assume you called make clean before recompiling to assure all object files are recompiled (caching can be an issue)?
Are really all dependencies installed (I assume yes, or configure should have thrown an error)? A list of known dependencies can be found in our wiki.

Have tried the aravis mailing list? Maybe they will be able to see what I don't. I will continue searching what dependency/configuration is missing...

@hanabata
Copy link
Author

Hi,

I assume you called make clean before recompiling to assure all object files are recompiled (caching can be an issue)?

Yes. I run make clean when I recompile.

Are really all dependencies installed (I assume yes, or configure should have thrown an error)? A list of known dependencies can be found in our wiki.

As I wrote in the previous comment, I've missed gstreamer-base-0.10
gstreamer-app-0.10. But if I remove --enable-gst-plugin-0.10 from the option, the same error happens.

Besides, I would like ask you the correct way of the compilation.
Should I first run ./autogen.sh and then run configure?

Thank you!

@TIS-Edgar
Copy link
Member

Since autogen only generates the configure script it should (in theory) not affect the discovery of libraries an header files.

At this point I am not sure why aravis is not building on your system. Please ask on the aravis mailing list. They will be able to help better than I

@hanabata
Copy link
Author

Hi,

I already ask about it to the people in aravis and they are trying to understand what the problem is.
Thank you very much.

@hanabata
Copy link
Author

Hi,

I succeeded to compile ARAVIS_0_3_2 with "./configure --enable-viewer --enable-gst-plugin --enable-gst-0.10-plugin --enable-introspection=yes"
After the compilation I ran "make install" and tried to compile gevCapture.c. But I faced the following error which is the same as what I reported here.

% make
/usr/bin/gcc -L/usr/local/lib -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -Wl,-E -lrt -lpthread -o gevCapture gevCapture.o -laravis-0.4
/usr/bin/ld: gevCapture.o: undefined reference to symbol 'g_signal_connect_data'
/usr/bin/ld: note: 'g_signal_connect_data' is defined in DSO /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libgobject-2.0.so so try adding it to the linker command line
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libgobject-2.0.so: could not read symbols: Invalid operation
collect2: ld returned 1 exit status
make: *** [gevCapture] Error 1

Actually, /usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/libgobject-2.0.so exists.
Do you know why this causes?

Cheers,
Yoshi

@TIS-Edgar
Copy link
Member

Hi,

I have not seen that error before. My best guess would be something on the line of this: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange

@hanabata
Copy link
Author

Hi,

I succeeded to compile!
I modified LIBS := -laravis-0.4 by adding -lgobject-2.0 -lrt -lglib-2.0 -pthread in my case.

Yoshi

On Sep 17, 2014, at 11:26 PM, Edgar notifications@github.com wrote:

Hi,

I have not seen that error before. My best guess would be something on the line of this: https://fedoraproject.org/wiki/UnderstandingDSOLinkChange


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants