Wednesday, August 28, 2013

ImageMagick: batch resize and DPI change

mogrify -resize 59.06% -density 150x150 *.tif
mogrify -resize 1024x1234 -density 150x150 *.tif
If the images are in grayscale than the above will convert them to RGB. Thus one can use the following: mogrify -resize 59.06% -density 150x150 -colorspace gray -layers flatten *.tif
mogrify -resize 1024x1234 -density 150x150 -colorspace gray -layers flatten *.tif

Wednesday, August 14, 2013

Matlab: split vector into number of parts of roughly the same size

%split into 3 parts
chunckCell=splitvect(1:10, 3);
ans = 1 2 3 ans = 4 5 6 7 ans = 8 9 10

Wednesday, July 24, 2013

Ubuntu: Install java 7 source (openjdk-7-source)

sudo apt-get install openjdk-7-source

The that is going to be installed by this command can be found: /usr/lib/jvm/java-7-openjdk-i386 or

Saturday, July 20, 2013

Arch Linux: xfce 4.10 panel freezes

From time to time the xfce 4.10 panel freezes. Instead of restarting or logging out, one can just kill it and it should restartkillall -9 xfce4-panel

ImageJ: Import source code into Eclipse and git version control

ImageJ is a public domain Java image processing program inspired by NIH Image for the Macintosh. It runs, either as an online applet or as a downloadable application, on any computer with a Java 1.4 or later virtual machine. Downloadable distributions are available for Windows, Mac OS, Mac OS X and Linux.
Since it is open sourced it can be modified and extended. It normally comes with ant build.xml but I usually work with Eclipse and Git, thus I wanted to work with the source files in this environment.

I will show how to add ImageJ source code into Eclipse and with Git support. The steps below where executed in Xubuntu 13.04.

1. Download the source code and unpack

The ImageJ source code is here. At the moment of writing, the latest version is I usually download to ~/Downloads folder. To unpack it use the following:cd ~/Downloads/
This will create a folder named source in ~/Downloads.

2. Create new Java Project in Eclipse

Create new Java Project in your default workspace. Usually the folder is set by Eclipse as ~/workspace. Its important to select "Use project folder as root for sources and class files" because in a moment we will import the ImageJ source into it.

Wednesday, July 17, 2013

Arch Linux: Error about msvcr100.dll.wctomb_s in wine 1.6-rc5 when starting Path of Exile.

Sorry, just writing from memory. I had wine 1.6-rc5 on a Arch Linux x64, though wine was set as 32-bit wine environment, i.e. withWINEARCH=win32 winecfgI had problem running Path of Exile client (Client.exe). It was something about unimplemented function msvcr100.dll.wctomb_s. The fix for me was to install Microsoft Visual C++ 2010 winetricks vcrun2010However, this may require you to first install msxml3.

Thursday, July 11, 2013

avcon: change frame, resize ogv obtained from RecordMyDesktop

avconv -i test.ogv -r 10 -s 1280x720 -q 1 output.ogvr is frames per second, s is the new size and q is quality, from 1(worse) to 32(best).