Showing posts with label gimp. Show all posts
Showing posts with label gimp. Show all posts

2012-09-20

Using the National Geographic Gimp Filter to postprocess video clips

Are you also a bit unsatisfied with movie editing programs like Kdenlive or OpenShot? In image processing programs like Gimp, you have such fine grained control and myriads of available filters to alter still images in every possible way. In contrast to that, movie editing programs like the ones mentioned above only offer you a handful of filters to create an individual look for your video project.

Fortunately it is quite easy to use a combination of ffmpeg and Python Gimp-fu to exploit all of Gimp's capabilities for batch processing video clips frame by frame. Here is a small example, where I applied Gimp's National Geographic Filter on a short clip. Depending on your system, you might need some patience, if you plan to process longer clips.



The scripts that were used to this can be found here. It is quite easy to modify it to use any other arbitrary set of Gimp filters, image processing operations, etc.

2012-07-09

Creating Timelapse Videos with a Webcam

Last week I had some fun creating timelapse videos using just an inexpensive webcam and a laptop. Timelapse videos are a nice way to visualize processes which are otherwise to slow to observe directly (eg. the movement of clouds or the growth of plants). Technically the the solution to all the world's problems seem to be little Python scripts, which can be downloaded here. ;)
For simplicity a lot of things are hardcoded in these scripts, so you most certainly have to make changes. The scripts should be easy to understand, as they are quite short and simple. However if anything is unclear, just drop me a comment.

timelapse.py, timelapse_copy.py

timelapse.py uses ffmpeg for capturing images from the webcam (support for v4l assumed). You do not need this script, if you have any other means of acquiring the individual frames. The filenames of the acquired images contain a consecutive nr. and the time and date when the image was taken. Unfortunately it turned out later that times and dates in the filename confuse ffmpeg and have to stripped away to join the individual frames to a single video file. Besides the nr. needs to have leading zeros. The timelapse_copy.py script was made to compensate for that.


timelapse_filter.py

As mentioned before, an inexpensive webcam was used for simplicity. Therefore a Gimp plugin is used to sharpen and denoise the pictures a little. The script uses Gimp and the package gimp-plugin-registry (for the wavelet denoise). You can skip this step if you have a good camera or are not willing to wait, because the filtering can take quite some time, depending on which filtering operations you want to run on the individual frames. Do not forget to copy this script to ~/.gimp-2.6/plug-ins and to make it executable.

timelapse_ffmpeg.py

A third script creates a video from the filtered images again using ffmpeg.

2011-12-18

A Scanner Darkly

I have always assumed that my scanner (an Epson Perfection V200) has construction flaws. An examples of this is, that it does not work with USB ports that are not directly connected to the motherboard.

Today I found out about another shortcoming. The waste heat of the scanner sled does not get transported away properly, which leads to permanent traces on the scanner glas. Fortunately the effect is not yet visible in everyday scans, but this situation might get worse.

To visualize the effect, scans were taken with open cover in a dark room. I combined the results from different scans in multiple layers (GIMP) with different opacities to diminish the influence of little dust particles. It would have been ideal to use this, which I could not get to work unfortunately.

To highlight the structures in the picture, Gimp's
Retinex filter was used, which performs quite well on this task. The result can be seen in the picture below.



The scanner's sled moves to a rest position away from the edge of the scanner, if not used for a while. This is where the sled cools down and the traces emerge.

SEL: These traces are from the PCB, which is attached to the sled.

SPL: Below this dot lies a small cut-out in the sled. It transports heat from the power lines of the lamp to the glas.

SLI: This horizontal stripes lies above the lamp, that illuminates what is to be scanned.

SSCR: Some scratches produced by the sled. Maybe there was something to heavy on the glas?

F: Probably finger prints that arose while cleaning the edges ;)

SCR: other scratches?

The picture below shows the same kind of image, this time produced with a Canon CanoScan LiDE 35. Even though this scanner not being the most recent model, the qualitative difference is clearly visible:



I wonder if it might be possible to augment this technique to identify which scanner model a document has been scanned with? Comments and suggestions are welcome as usually.