Close
0%
0%

Schlieren-Videography

With this project I want to show you how you can make Schlieren-Videography at home. To do so we will use the Moiré-effect.

Similar projects worth following
So you are not familiar with schlieren?
Don´t worry, schlieren (German for streaks) are optical turbulence in transparent materials which are not necessarily visible to the human eye. There are multiple ways to record/see them, we want to see and film these using a camera and a moiré pattern.

How does it work?

To make the density of the air visible we have to use a little trick. Dense/less dense air will change the direction of light a little bit, so the Moiré will seem to flicker a little bit, when there is dense/less dense air around.

We will amplify the visual effect of this flicker by having a non flickery comparison image and take the difference of that one with the live image from the camera.

The output will be our schlieren image, the changes in the density of the Air will be very clearly visible.

Its a torch

We can change the density of air very simple by heating/colling it, for example: your Hands, igniter, torch, cold drink, soldering iron, heat gun...

The Moiré-raster is just an image of black and white lines with a ratio of 50% and in my case with a spacing of 0.33 mm

You have to try different spacing out, to find the perfect one, its kind of try and error to get the best results, but it is worth it.

The raster-screen (Moiré)

The best thing is for me was something like to have the full pattern on the camera, focused and 2 pixels height per line.

The full setup with the camera on the right and the raster-screen on the left.


And here is my setup with a water tank, to observe the water.

If your setup is well made, you can also detect the heat from your Hand ( the delta Temp is only 10-13°C!), here is mine.

Video results:

A torch

Here we placed a few drops of Isopropanol in a bottle and ignited it.

Now an older one, its a soldering iron, note the improvement of the image processing.

This one is the first one in HD, recorded with a DIN A0 Moiré pattern


schlieren_8.py

New version with new functionalities: - Noise reduction through image stacking. - Motion compensation mode. - Disable background window.

x-python - 12.04 kB - 09/03/2016 at 17:16

Download

schlieren_6.py

New version with new features. New Dependency: scikit-video (scikit-video.org) is needed for video recording because of OpenCV 2.4.x bug in linux version.

x-python - 10.52 kB - 08/19/2016 at 15:44

Download

schlieren_pseudocolor.py

Python version updates: Better schlieren visibility thanks to second histogram equalization and pseudo color.

x-python - 3.94 kB - 08/10/2016 at 15:08

Download

schlieren.py

First Python 2x version. Dependencies: OpenCV bindings for Python, Numpy. Uncomment and edit line 52 if you want another video device than /dev/video0 for testing.

x-python - 3.86 kB - 08/08/2016 at 19:13

Download

Moire_Video.zip

Version for editing playback videos, NOT live videos, this may be better for higher resolutions. Important: there has to be a difference-image in the skechfolder!

Zip Archive - 613.63 kB - 05/15/2016 at 18:11

Download

Moire.7z New

The project folder, everything is included New display added, press 'e'

x-7z-compressed - 372.42 kB - 01/03/2016 at 15:25

Download

Moire.7z

The project folder, everything is included

x-7z-compressed - 192.61 kB - 01/02/2016 at 19:31

Download

View all 7 files

  • 1 × Camera with Objective I use an Industrial b/w camera with an f/1.8 25mm lens
  • 1 × [optional] A Frame-Grabber for the camera
  • 1 × Moire pattern A moire pattern printed on something like paper
  • 1 × A light source A good lighting is usefull

  • Schlieren Videography at the Orkney International Science Festival 2016

    Mark Dammer09/03/2016 at 17:24 0 comments

    I presented Schlieren Videography at the family day of the Orkney International Science Festival in Kirkwall today. Over 900 visitors had the chance to enjoy the live projection of schlieren imaging with this python program. This brings a new release - schlieren_8.py with new functionality:

    - reducing the pattern size to 0 completely disables the background window.
    - press "M" for a new motion compensation mode that simply processes the difference between successive frames or framestacks.

    - multiple images can be stacked before equalization - this reduces noise. Press 1-9 to stack 1 (no stacking) to 9 images. Larger image numbers can be choosen through the command line option.

    The Schlieren project setup - from left to right: Computer to generate pattern, Screen for pattern projection, Candle as example object, camera, image processing computer showing an old NASA schlieren image of the X15 as example, projector on chair.

    Projection of live schlieren image in the presentation area of our T-Exchange makerspace - still picture and video:

    Schlieren video taken at the OISF. It shows a gas powered hot air gun. The used settings are: Enabled Filters: Equalizer, Blur; Color Palette 2:

  • Added video recording, post-processing and improved image processing

    Mark Dammer08/19/2016 at 16:10 0 comments

    New Python version schlieren_6.py with many new features:

    - record video as MP4 avi or image sequence (needs scikit-video because of OpenCV bug)

    - all functions accessible via command line options.

    - reduced noise in image processing by means of frame stacking for reference frame and CLAHE (contrast limited adaptive histogram equalization) for main processing. I could see the warm air rising from my hand with this new algorithm.

    - fastNlMeansDenoising can be used, but is slow (1 fps on my i7 quadcore). But any image sequence from a previous pass can be fed into the program again via command line:

    python ./schlieren_6.py -dd -i rawimg/%08d.bmp -fd 43 -c 4 -ov color_filtered.avi

    This means: "Load bitmap sequence in rawimg, starting with 00000000.bmp, don't use schlieren differentiation but strong denoising (43) and pseudo-color palette 4, output to color_filtered.avi in the programs directory. You can see the results below.

    - New Hotkey layout:

    d - toggle display between raw and rendered image

    h - toggle HUD style on screen text display

    r - capture 10 frames, stack and average them as reference image

    s - toggle schlieren differentiation (mostly needed from command line for postproc)

    c - rotate through colour palettes

    e - toggle histogram equalization

    b - toggle median blur

    n - toggle denoise (very slow! It is recommended to use this in a second pass)

    v - toggle video recording

    i - toggle recording of image sequence

    p - rotate through background patterns

    + - increase pattern size

    - - decrease pattern size

    q - quit program

  • Updated Python version: better visibility and pseudo color

    Mark Dammer08/10/2016 at 15:12 0 comments

    Promising experiments with a second histogram equalization stage after differentiation and pseudo color mapping.
    I recommend to turn off all automatic features (autofocus, exposure/shutter, gain, white balance) on your camera to avoid flickering images and "pumping". Linux users who use a webcam can use guvcview in control panel mode to control the camera without causing a busy v4l device:

    guvcview -z -d /dev/video1 This controls my second (external) camera.

  • A new Era: First Python Version

    Mark Dammer08/08/2016 at 19:41 0 comments

    A new Era: The first Python version can be found under the files section. The working test system runs XUbuntu 16.04 and uses Python 2.7, OpenCV 2.4.9., python-opencv and Numpy.

    I am using Spyder as Python IDE

    The default video input source is the first camera (device index 0). This can be changed by uncommenting and editing line 52 or the -i / --input_source command line option. The latter allows video files as input as well.

    The program will open three windows for the raw video, the output (Schlieren!) and the background pattern. The background window is black until you choose 1 (chequerboard) or 2 (stripes). All three windows can be resized. There is no video recording option (yet!).

    Keyboard input:

    c use current frame as reference frame

    q quit program

    1 use chequerboard background pattern

    2 use striped background pattern

    =+ increase pattern size

    -_ decrase pattern size

    Have fun!

  • First tests with background patterns generated on a screen

    Mark Dammer08/08/2016 at 15:56 4 comments

    These tests use background patterns on a screen instead of a printed moire. The idea is to be able to project the pattern on a screen or wall for larger scale schlieren videography.

    Test setup with stripe pattern on screen and Logitech c930e camera

    On top the test setup with a stripe pattern on the external screen an a Logitech c930e camera.

    In the first video a stripe pattern similar to the printed moire patterns is used:

    This video is an attempt to get a better image by using a chequerboard pattern:

  • Playback version of the code

    Jan--Henrik05/15/2016 at 18:16 0 comments

    There is now a playback version of the Processing sketch, with which you can record a video and then calculate the schlieren-effect afterwards. The raster-screen is still required.

    This version of the code works great with higher resolutions, as it doesn't need to be played live.

  • Python version

    Jan--Henrik04/10/2016 at 17:47 0 comments

    Hi, a python version of the program is on the go, I will update it soon, no more Java, yay!

  • HD-Schlieren-Video

    Jan--Henrik03/20/2016 at 19:17 0 comments

    Finally! I created a HD-Schlieren-Video on an DIN A0 Moire screen and with my canon EOS 600D.

    That was not possible to do live, so I recorded the Moire screen and the Schlieren and then run the program with the video.

    The effect seems to be not that strong anymore, that is a bad side effect of the higher resolution.

  • New Moire pattern

    Jan--Henrik03/20/2016 at 18:21 2 comments

    I recently got a new Moire pattern. It was supplied by the Tkkrlab in Enschede.

    It is a Moire pattern with a line-spacing of ~1.45 mm and a size of DIN A0.

    Stay tuned for some HD footage of Schlieren :)

  • Quick note for better results

    Jan--Henrik02/14/2016 at 19:25 0 comments

    You can get better results, when the raster is aligned with the sensor-pixels of the camera. Already a tiny angle may worsen the result.

View all 26 project logs

  • 1

    Simple setup, place your camera on a tripod, your Moiré pattern right next to it and focus the camera onto the pattern. 82 cm is a good distance in between the camera and the pattern.

    For my camera a aperture of f/4 with auto-gain and a shutter of 1/120th of a second is quite nice, you may have to play with the settings.

    The orientation of the pattern does not matter as long as it don´t change.

    You also want to make sure that the camera and the pattern don´t move, it is very bad if it moves.

    Here is my setup.

    Also connect your camera to your computer, in my case I had to use a composite frame grabber for it.

  • 2

    For the following step you need to have Processing (3.x) installed, you can get it here.

    https://processing.org/

    Now load the sketch into Processing and run it. You may have to change the sketch size to the resolution of your camera. You can do it in the following line.

    size(720, 576, P2D);

    If it the sketch is running you can jump to the next step.

  • 3

    Now to the basic controls, with c you capture a reference image, with o you can switch to the normal image and zoom in to see if you are focused.

    With e you can erode and dilate the image, it will amplify weak effects, like gas from a lighter.

    With b you can blur the Image and with s you can start saving frames to your hard drive.

View all 5 instructions

Enjoy this project?

Share      

Discussions

katkrat wrote 05/15/2016 at 17:26 point

Thanks for sharing this awesome technique.
However, I don't seem to get it running.
I can't connect my 600D with processing.
It always picks the build-in device.
I have to admit I just gained basic knowledge in processing (just started few weeks ago)
Maybe you can help me to figure it out.

  Are you sure? yes | no

katkrat wrote 05/15/2016 at 17:50 point

Oh. Just saw your comment.

  Are you sure? yes | no

Jan--Henrik wrote 05/15/2016 at 18:13 point

Hi, updated the files, there is now a playback version, with which you can record video and edit it afterwards/calculate the schlieren afterwards :)

  Are you sure? yes | no

Jan--Henrik wrote 05/15/2016 at 18:06 point

Hi, in processing you have to choose the right camera device, you can look up the Processing example https://www.processing.org/reference/libraries/video/Capture.html

It will print out a list of available devices, you can choose the the right one. But personally I would choose an industrial type camera (if available) theese have a good sensor with less resolution ( the resolution is not that important, lower might be easier to handle)  .

You can also choose the playback version, as I did, it also works.

  Are you sure? yes | no

katkrat wrote 05/15/2016 at 19:19 point

Thanks for the quick answer.
I'm getting crazy over here...
I know the devices name but I don't get where to put it..
Thank you a lot for the playback version code!
I'm gonna try that tomorrow.
I have an old video hi8 camera connected via usb easy cap (and easycapviewer...that works)
But it's the same with the processing code.
It always chooses the built in camera.
Moreover, my computer doesn't seem to handle it (mac basic retina, el capitan). it hangs and doesn't react after hitting the play button and going a few steps.
And there's another thing.
The added structure fills just half of the video size. Any idea where that could come from?



Tut mir Leid, für die vielen Fragen.

  Are you sure? yes | no

Jan--Henrik wrote 05/15/2016 at 19:52 point

The problem is the sketch chooses the wrong camera, the processing capture example sketch prints out a huge list of available camera streams of your computer, try all of them, a few of these should the the external USB webcam.

Kein Problem ;)

  Are you sure? yes | no

David H Haffner Sr wrote 05/12/2016 at 18:09 point

Man, that is VERY cool!!

  Are you sure? yes | no

Jan--Henrik wrote 05/15/2016 at 18:14 point

Hey Thanks! :)

  Are you sure? yes | no

Moritz Walter wrote 03/20/2016 at 21:11 point

I love this project, it's so cool. Very inspiring! Thanks for sharing!

  Are you sure? yes | no

Jan--Henrik wrote 03/21/2016 at 16:42 point

You're welcome :)

  Are you sure? yes | no

Stephen Swartz wrote 01/12/2016 at 00:53 point

Without making any comment on your results (which are obviously very cool) I was always told that  Moiré and Schlieren refer to two different techniques for visualizing air density difference.  Any comment.

  Are you sure? yes | no

Jan--Henrik wrote 01/12/2016 at 08:47 point

Actual no, I use the Moiré effect to create/visualise the schlieren

  Are you sure? yes | no

johnking wrote 01/11/2016 at 22:46 point

Could you make a "dynamic" pattern so you would not need the reference pattern in the scene?  For instance,  suppose you were taking images at 60/sec.  Adjacent  (timewise) image subtraction would show small differences of "static" scene.  These small changes could be added back into  ongoing train of images.  By using ambient light, the apparatus is a bit simpler.  The detected schlieren "movement" could be added say ,as a pale purple tint in the main image.  Of course the image processing gets more elaborate.  Also any  moving large objects in the scene will cause large bit intensity deltas.  Just more software. Or is it more features?

john King  11/1/2016

  Are you sure? yes | no

Jan--Henrik wrote 01/12/2016 at 16:19 point

That is a good idea, i will try it later!

  Are you sure? yes | no

Jakob Andrén wrote 01/11/2016 at 03:04 point

Cool! My first though went to my Canon 5D mark II camera, known for its bad aliasing, wonder how well it would work... HD and good optics!

  Are you sure? yes | no

Jan--Henrik wrote 01/11/2016 at 10:06 point

It would work I guess, but I dont know if you can have a live image from that, maybe with recordings it will be great

  Are you sure? yes | no

Cameron Blocker wrote 01/05/2016 at 19:59 point

Do you have any recommendations on where to buy a good camera? I'd like to do more computer vision/image processing projects but lack good equipment.

  Are you sure? yes | no

Jan--Henrik wrote 01/05/2016 at 20:27 point

I guess the best advise I can give, is to buy a used industrial camera, they dont have a hight resolution, neither they are in color, but you have a very hight image quality.

Dont get cheap webcams!

  Are you sure? yes | no

Moritz Walter wrote 01/05/2016 at 15:07 point

Hey, thats a really nice technique for the toolbox! Have to try that! I guess the perfect number of black lines on the moiré background when shot full-frame is simply half the line resolution of the camera used, right? Or is there something else to consider?

  Are you sure? yes | no

Jan--Henrik wrote 01/05/2016 at 16:07 point

Thanks, I'm thought that first too, but i'm not very sure about it anymore. What you described is my currently setup but it is horrible. 1 line per 2 pixel is better, it helps recording the "line movement".

Thank you for the Input, I will try serval line/pixel combiantions.

  Are you sure? yes | no

esot.eric wrote 01/05/2016 at 14:31 point

Oooh! The other day I noticed that my space-heater was interfering with my viewing of the carpet below it... making it "wave" slightly. Tried to get it on camera, but couldn't see anything on the footage. 

I'mma definitely revisit this project when my brain's more active!

  Are you sure? yes | no

Jan--Henrik wrote 01/05/2016 at 16:07 point

:D that effect is what I'm hunting for :)

  Are you sure? yes | no

RandyKC wrote 01/04/2016 at 19:07 point

I've heard of certain clear plastics being used with this technique or something similar to study lines of force in parts. Is this the same technique? Do you know what type of plastic that would be used?

  Are you sure? yes | no

Jan--Henrik wrote 01/04/2016 at 19:34 point

I guess they use acrylic, usually people use another technique with polarization to check the forces inside the plastic.

I will have a look on that and also I will check some acrylic with my schlieren setup :)

  Are you sure? yes | no

slowcoder wrote 01/03/2016 at 15:55 point

What would be required to use schlieren for aerodynamic visualization?

I know NASA and guys like them use it, but is it as simple as just sticking a profile in front of your camera and introducing "wind" ?

  Are you sure? yes | no

Jan--Henrik wrote 01/03/2016 at 16:33 point

Yes and no, It is as simple as to stick only a profile behind the air you want to observe, but there are other ways to do so, which are a little it better, but also much more expensive and bigger. 

NASA and co might use the more expensive solutions, but I don't know which they use.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates