Example Code

Mind-Melting Slit Scan Photography... Powered by LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

This LabVIEW App Brings Slit-Scan Photography to any Camera!

Transform yourself into mesmerizing works of art

SlitScan3.JPG


Originally used in static photography to produce surreal, deformed images, the slit-scan imaging technique was evolved to create spectacular animations – enabling cinematographers to compose psychedelic flows of colours and movements.

 

Slit-scan was traditionally a mechanical camera technique – but, as this application proves, software processing can be applied to bring this mesmerizing effect to any camera!

 

 

I’ve seen the technique used in dozens of movies, adverts and music videos. It’s creates such a striking effect, that I was desperate to experiment with it myself! With LabVIEW and the NI Vision Developement Module by my side, I was determined to make it happen!


In essence, this application extracts n lines from the previous n images. These extracted lines are then used to construct the weird and wonderful slitscan image.

Scanning (top to bottom).JPG

The application also include a button on the front panel that allows you to reverse the direction of the scan.Scanning (bottom to top).JPG


To achieve this, the attached code creates a continuously updated cyclic buffer, which contains a certain number of previous frames from the live video stream. The specific number of frames that are held in memory are determined by the...

 

  • Resolution of the camera.
  • The number of lines used in the scan.

 

These image buffers are preallocated when you click the run button, and then released/disposed when you click stop.

Preallocate memory.JPG


Important: If you have trouble executing the code, you have 3 options...

  1. Reduce the video resolution. This can be done in the ever-useful Measurement and Automation Explorer.
  2. Increase the number of lines per scan (front panel control)
  3. Install more RAM in your PC or laptop


This Application requires LabVIEW 2012 (or above), the relevant versions of the NI Vision Development Module and NI Vision Acquisition Software.

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Matt_McLaughlin
NI Employee (retired)
on

Hey RER,

Did I miss something? There doesn't seem to be any code attached.

This sounds awesome and I'd love to try it out!

-Matt

Matt
NI Community Team
National Instruments
RER
NI Employee (retired)
on

Matt, you havent missed anything my friend! This was supposed to be saved as a draft. The code is complete. I want to produce a little example video, before making it live!

Thanks for your support. Check back soon!

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
RER
NI Employee (retired)
on

After a long wait (Ive been very busy with a new born son!) I'm pleased to announce that the application is NOW LIVE!!!

*Phew!

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Matt_McLaughlin
NI Employee (retired)
on

Haha! SO glad you got this posted!

It is great and a ton of fun to play around with, but led to a very distracted morning at work.

Awesome job on this!

Matt
NI Community Team
National Instruments
Jatin1489
Member
Member
on

Hey RER,

I have installed vision module on my labview 2012.

IMAQdx open camera, Imaqdx configure grab, Imaqdx grab, Imaqdx close are missing subvis in your code for me.

what other module should I download?

RER
NI Employee (retired)
on

Hi Jatin1489,

The Vision Developement Module  allows you to process and analyze images. However, to acquire and save images from a camera you need NI Vision Acquisition Software. It is a seperate installer to VDM. You can download it here

Please note that the NI Vision Acquisition Software is activation based. However... good news... VDM comes with a license for NI Vision Acquisition Software, allowing you to interact with GigE Vision, IEEE 1394 and DirectShow USB devices, in addition to Camera Link, analog, parallel digital cameras and NI Smart Cameras.

I hope this has been useful!

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
moha420
Member
Member
on

I have the same problem Jatin1489 and I could not fix it as you say RER

RER
NI Employee (retired)
on

Hi Moha,

To confirm... NI Vision Acquisition Software needs to be activated/licensed before you can access the IMAQdx functions. Can you confirm that it is activated on your machine?

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Jan_Wagner
NI Employee (retired)
on

Hi RER, have you been aware that you have implemented in Labview a technique that even Stanley Kubrick was using in his famous movie: 2001: A Space Odyssey? Prove: https://www.youtube.com/watch?v=KhRo2WbWnKU

marketing
Member
Member
on

Your YouTube video was broadcasted on a Japanese TV show illustrating how the slit scan works.

Our customer even noticed the PXI placed on the desk!

Contributors