Monthly Archives: June 2012

Intervaluino Plus: a configurable intervalometer made with Arduino

Finally I’ve finished the first official release of the Intervaluino Plus. The name comes from the concept of extending the capabilities of the previous Arduino intervalometer called Intervaluino made by Timm Suess.

An intervalometer is basically a device that triggers an action every certain amount of time, and in photography it is used to create time-lapses.

My Intervaluino Plus uses a small Arduino compatible board called RBBB. I used it because I want to put all this components in a small box with a 9 volt battery and an Arduino Duemilanove (the first board I bought in Japan) or the more recent Arduino Uno wouldn’t fit inside. Either way, you can use an Arduino board as soon as it is compatible with the RBBB, Arduino Duemilanove, Arduino Uno, etc. Beware that the RBBB does not have a USB port so you will need a FTDI-TTL cable to connect it to the computer (you’ll need to install the drivers for your operating system too).

Intervaluino Plus is configurable via 4 buttons: left, right, up and down and comes with a 4 digit 7 segment serial display (Sparfunk COM-0976X) that only needs one line to be controlled. Here is a video showing how it works. I’ve replaced the trigger part so you can see clearly when it shots the pictures:

Left and right buttons are used to change the menu option whereas up and down change the value of the options themselves. When Intervaluino Plus is switched on it asks how many pictures have to be taken by displaying the text “PICS“. We can then use up and down to increase or decrease the amount from 1 picture up to 9999. If you are thinking that you don’t want to push the botton 9999 times you are as lazy as me ;) So I implemented a “fast forwad” that makes the counter go faster if you leave the button pushed for some time. Also to know that you are on the first option the first dot down on the right of the display will remain on.

Once we have selected the amount of pictures to take we can push the left button to go to the next menu option, which is called “PERI“. It represents the period of time we want between every picture. We can configure it from 1 second up to 9999. This time you will see that the second dot is on, representing that we are changing the second option.

We are now ready to take pictures! Just push the left botton once more and the display will show “PHOT” and the Intervaluino Plus will start taking pictures. Once finished the job Intervaluino Plus will go back to the first option again.

There is a “hidden” feature so you can adjust the display brightness on power up. If you turn on the Intervaluino Plus while you maintain the up button pushed the display will bright at the highest level whereas maintaining the down button will make the display barely bright. Use this option to safe battery or if the light conditions prevent you from reading clearly the digits.

The SOURCE CODE is available in my github repository and you can see the schematics right here:

This is the parts list:

  • 1x Arduino compatible board, a RBBB for example.
  • 1x Sparfunk COM-0976X 4 digit 7 segment serial display.
  • 1x 4n35 or 4n25 optocoupler or a 5V relay (JZC-11F-05VDC-1Z for example) UPDATE: The relay introduced a rebound effect that made the camera took 2 pictures in a row instead of just 1.
  • 4x push switches.
  • 4x 10KΩ resistors.
  • 1x 330Ω resistor if you use the optocoupler.
  • 1x connector for your camera cable. Female 2.5mm stereo jack for Canon DSLR.

To create the breadboard drawing and the schematic I used Fritzing. You can download the schematic of Intervaluino Plus here.

In following versions I want to make at least those improvements:

  • Change the limit of 9999 pictures and 9999 maximun seconds between every picture.
  • A “BULB” option so the shutter stays open for a period of time configured in the options.
  • Texts longer than 4 characters that will scroll on the display.
  • Add another button to use it as an “enter” key.

If you find a bug or want to improve the Intervaluino Plus don’t hesitate to contact me.

ARToolKit with OpenKinect using the IR camera

More than one year ago I started adding Kinect support to ARToolKit using libfreenect. I had some results but didn’t have enough time to publish a fully tested version of it. Now I know it ins’t very useful because Ubuntu already detects Kinect as a webcam (creating a /dev/videoX device for it, or at least that happend to me with Ubuntu 12.04 UPDATE: I figured out that this happens because of the gspca_kinect module introduced in Linux 3.0 kernel), so you can use it with ARToolKit via the GStreamer video input. Still I wanted to learn more on how ARToolKit works on its inside. Now I’ve added some more features and support not only for the RGB camera but also for the IR camera, tilt and LED.

The nature of the IR camera makes detecting markers very difficult as they are very blurry when not very close to the Kinect, but hey it’s been fun hacking with libfreenect. I’ll try to publish the code ASAP. I still want to test it more.

Intervalometer with Arduino for time-lapse photography

UPDATE: Intervaluino Plus is out!

Lately I’ve been developing with an Arduino compatible board. It is called RBBB and as you can see from the picture it’s quite small.

I want to create time-lapse videos and creating my own intervalometer is a great chance to learn using the Arduino platform. You don’t know what Arduino is? Then you should see this video done by Make:

The project is basically a RBBB board, a 4 digit 7 segment serial display, 4 buttons (will be 5 soon) and a relays (I’ll change this to a optocoupler). The 4 digit 7 segment serial display is controlled with the serial driver that the Arduino platform has in it, so it is extremely easy to use. Just create some functions to control each digit and the dots, so you can easily show numbers and letters. The relay opens and closes the remote button of the camera.

I’m right now developing the last part: the interaction between the display and buttons with the user. I hope to have it finished this week. I’ll publish the source code, parts list, where to buy them and connection diagrams so you can also make this device.

Install osgART 2.0 RC3 with OpenSceneGraph 2.8.3 or 2.9.6 with Collada support in Ubuntu 12.04

Before installing osgART we need to install ARToolKit, collada-dom and OpenSceneGraph so look at those post before continuing with this:

Once you have installed the dependencies for osgART download osgART 2.0 RC3 code from here and uncompress it. Run the following commands:

mkdir build
cd build
cmake .. -DCMAKE_CXX_FLAGS=-fpermissive -DCMAKE_MODULE_LINKER_FLAGS=-lgstreamer-0.10 -DCMAKE_SHARED_LINKER_FLAGS=-lgstreamer-0.10
make
sudo make install

You can remove the “-DCMAKE_CXX_FLAGS=-fpermissive” option if you add the following includes in the “include/osgART/Utils” file after “#include “:

#include 
#include 

Configure the ARTOOLKIT_CONFIG variable (you should have this already configured when installing ARToolKit):

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 run the example program while showing the “Hiro” pattern to the camera:

cd /usr/local/bin/
./osgartsimple

If you get this error:

Plugin '-1' unknown!
Could not initialize video plugin!

It is caused because the osgART libraries weren’t correctly copied to the library folder (“/usr/local/lib“) and/or the OSG plugins folder (“/usr/local/lib/osgPlugins-X.X.X“). Verify that a file called “libosgART.so” is in “/usr/local/lib” and that the files “osgdb_osgart.so“, “osgart_tracker_artoolkit2.so” and “osgart_video_artoolkit2.so” are in the OSG plugins folder (that should be “/usr/local/lib/osgPlugins-2.8.3” or “/usr/local/lib/osgPlugins-2.9.6” depending on the version of OSG you installed). Be aware that if you install different versions of OSG at the same time the osgART plugin may no be copied to the plugin folder of the OSG version you want. Also you may run this just in case:

sudo ldconfig /etc/ld.so.conf

If you see a black background it is caused because of a small bug in ARToolKit. It can be fixed in ARToolKit changing “ar2VideoCapNext” function on “lib/SRC/VideoGStreamer/video.c line 378 to return 0 instead of TRUE OR by changing osgART file “src/osgART/Video/ARToolKit/ARToolKitVideo.cpp” on line 310 from this:

if (0 == ar2VideoCapNext(video))

To this:

if (ar2VideoCapNext(video))

If you want to have a smoother marker detection on osgART you can change the source code on file “src/osgART/Traker/ARToolKit/SingleMarker.cpp” and uncomment the line 76 and comment the line 77. I mean changing this:

//arGetTransMatCont(markerInfo, patt_trans, patt_center, patt_width, patt_trans);
arGetTransMat(markerInfo, patt_center, patt_width, patt_trans);

To this:

arGetTransMatCont(markerInfo, patt_trans, patt_center, patt_width, patt_trans);
//arGetTransMat(markerInfo, patt_center, patt_width, patt_trans);

Sources: http://projects.springlobby.info/issues/1575
https://github.com/bitcoin/bitcoin/pull/456
https://code.ros.org/trac/opencv/ticket/1020
http://forum.openscenegraph.org/viewtopic.php?t=7755

Install OpenSceneGraph 2.9.6 with Collada support in Ubuntu 12.04

Although I usually install OpenSceneGraph 2.8.3 to work with osgART 2.0 RC3 it is also posible to use OpenSceneGraph 2.9.6 (in fact is the latests version compatible with osgART UPDATE: read this post to see how to make osgART 2.0 RC3 work with OpenSceneGraph 2.9.7 and further). You can download it using SVN:

svn checkout http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.6 OpenSceneGraph-2.9.6

The steps to install OSG 2.9.6 with Collada support in Ubuntu 12.04 are just the same as I explained before in “Install OpenSceneGraph 2.8.3 with Collada support in Ubuntu 12.04“, but you have to do some more changes on the source code because of FFMpeg. So just add those changes to the source code of OSG 2.9.6 and then do just the same as if you were installing OSG 2.8.3:

/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
- In line 276 change this:

const int bytes_decoded = avcodec_decode_audio2(m_context, reinterpret_cast(buffer), &data_size, m_packet_data, m_bytes_remaining);

To this:

#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=32)
            AVPacket avpkt;
            av_init_packet(&avpkt);
            avpkt.data = const_cast(m_packet_data);
            avpkt.size = m_bytes_remaining;

            const int bytes_decoded = avcodec_decode_audio3(m_context, reinterpret_cast(buffer), &data_size, &avpkt);
#else
            // fallback for older versions of ffmpeg that don't have avcodec_decode_audio3.
            const int bytes_decoded = avcodec_decode_audio2(m_context, reinterpret_cast(buffer), &data_size, m_packet_data, m_bytes_remaining);
#endif

/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp

- In line 168 change this:

const int bytes_decoded = avcodec_decode_video(m_context, m_frame.get(), &frame_finished, m_packet_data, m_bytes_remaining);

To this:

#if LIBAVCODEC_VERSION_MAJOR >= 53 || (LIBAVCODEC_VERSION_MAJOR==52 && LIBAVCODEC_VERSION_MINOR>=32)
            AVPacket avpkt;
            av_init_packet(&avpkt);
            avpkt.data = const_cast(m_packet_data);
            avpkt.size = m_bytes_remaining;

            const int bytes_decoded = avcodec_decode_video2(m_context, m_frame.get(), &frame_finished, &avpkt);
#else
            // fallback for older versions of ffmpeg that don't have avcodec_decode_video2.
            const int bytes_decoded = avcodec_decode_video(m_context, m_frame.get(), &frame_finished, m_packet_data, m_bytes_remaining);
#endif

Sources: http://code.metager.de/source/xref/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp

  • Page 1 of 2
  • 1
  • 2
  • >