Archive for the ‘Technology’ Category

Experiment in HDR with Fake Tilt Shifting.

Monday, June 16th, 2008

I’ve been seeing a few stunning High Dynamic Range (HDR) images lately on the blogs so I thought I’d have a crack at it myself. But with an added twist, I have combined it with a fake tilt shift technique. Disclaimer: I am not a photographer and my Photoshop skills are pretty average.

This image is made up of three exposures. One underexposed at shutter speed 1/1600. One overexposed at shutter speed 1/400 and the other in the middle at 1/800. I used the auto exposure bracketing feature on my wife’s Canon EOS 5D. The three exposures were then combined into a HDR image and tone mapped using Photomatix. By exaggerating the dynamic range, the detail in the image looks as though it was hand painted. Lastly the image was opened in Photoshop CS3 where a fake tilt shift technique was applied. The aim of the tilt shift was to create the illusion of a miniature model by blurring the immediate foreground, background and horizon but leaving the center of the image not blurred. As you look at the image you can imagine that you are looking at a photograph of a miniature model of Auckland City.

Auckland Fake Tilt Shifted in HDR


This is another HDR of my backyard which is the first HDR I had attempted. It turned out pretty good. You can almost imagine you are looking at a ray-traced scene. There is no fake tilt shift on this one.

Matt's backyard in HDR

 

How to Pwn a Scumbag Laptop Thief – DIY Style

Monday, April 28th, 2008

With a little know how it is pretty easy to set up your laptop so that you can get it back again if it’s been stolen. There are a few commercial products available that can do this but it’s more fun to make your own. This only works if your computer is used on the internet once stolen. It will automatically poll a web server which then logs the IP address of your computer. The server then emails the IP to you and you can then use a traceroute command to find out what ISP the thief is using. Once this is known, you can then get in touch with your local enforcers of law. They’ll hopefully be able to work with the ISP to locate the physical address of your laptop. So there are a few things that will need to happen for this to be able to work.

A thief will need to be able to log into the computer. So avoid using login screen or if your computer is set up so that it requires logging into then provide a guest account and provide the user name and password on a post-it note stuck to the laptop. If the crook can’t log in then they will just end up reinstalling the OS and all will be lost.

The crook will need to access the internet. If they can’t get online then you can’t get them. Try to stick to a pretty straight forward network setup that will work with most DSL routers. The more complicated it is, the less likely it is to work. Perhaps you could provide a link on your desktop to your dial-in account. Some ISPs offer a dial-in service, so you could create a shortcut to this as a courtesy to a scumbag thief.

Here’s what you’ll need:

  • Know-how in php and Java
  • A web server on the internet that runs php scripts with mail sending enabled. The (email part is optional). There are several free web hosting services you could use however many of them have the php mail function disabled. Most commercial php web hosts have php mailing enabled.
  • Your laptop will need the Java Runtime Environment installed. You may wish to port the Java code to some other language if you prefer.
  • RealVNC installed

The iplogger.php script will log and email the IP address of your stolen computer to you. This is to be uploaded to your web server. You will need to modify line 11 with your own email address. Also in the event that your computer is stolen you will need to modify line 5 with the id that you have assigned to your computer. For example:
$stolenuser = “mattslaptop”;

You shouldn’t need to modify the Main.java unless you have installed RealVNC to a different location. This change is made on line 51. If you don’t want to use RealVNC then just delete lines 48 to 53.

Compile the main.java program into a class file and create a shortcut to it. The target of the shortcut will look something like this:

%windir%\system32\javaw.exe “C:\Main.class” http://mydomain.com/iplogger.php?id=mattslaptop

The url of the iplogger script is passed in as an argument and the name of the computer to track is included as part of the url. Change ‘mattslaptop’ to your own computers id.

Note that we use javaw to start the Main.class. This is so that the process runs in the background without a window.

Copy the shortcut into: C:\Documents and Settings\All Users\Start Menu\Programs\Startup


That’s it. You can test if it’s working by looking at the following url on your own web host:

http://mydomain.com/mattslaptop

The output will be something like :

121.22.123.232 Local Date/Time:27-04-2008_12:39      Server Date/Time:26-Apr-2008 19:34

Once your computer is stolen, remember to change line 5 on the iplogger script so that is matches the id of your computer. This will enable regular email updates of IP addresses.

Once you have the recent log of the IP address, you should also be able to VNC to your computer but only if it is not behind a network firewall. Remember to unblock VNC in your laptops firewall. You should VNC in listen mode only to watch what the bandit is doing on your computer. If you try to remote control it, you will give yourself away. You may see the culprit enter personal info that may help to identify them and this can then be given to police.

Okay, so there are a lot of conditions that need to met in order for this to work. Hopefully the villain is not too smart and doesn’t realize this risks of using a stolen computer on the internet. But I guess it’s safe to assume they probably don’t otherwise they would have a higher paying job and wouldn’t have to jack other peoples shit. Good luck.

Of course, there are more elegant ways of doing this. A cleaner way to do this is by avoiding Java altogether and code to a Windows service in Visual Studio. Also VNC should be run as a service also. This would be much more covert. The solution that I’ve provided here was just hacked together yesterday just as a proof of concept. So there’s plenty of enhancements you could make to this.

No DVD audio playback with Windows Media Player

Saturday, January 26th, 2008

Another problem I’ve had with DVDs is that I couldn’t hear the audio when I played them on the computer. I had checked all of the obvious things like having the speakers turned on and having the volume up. I don’t often have the need to play DVDs on my computer so hadn’t bothered to get to the cause of this until now.

I was able to rule out a hardware fault as I could hear the audio on some discs but not others. I thought that it may have been a fault in the audio cable that runs from the CD/DVD drive to the audio CD Line In on the motherboard. It turns out that this cable isn’t even required. It was a software issue relating to Windows Media Player.

Windows Media Player does not have a built in AC3 or DTS decoder. Therefore audio will not work for these types of DVDs. AC3 or DTS are licensable technologies that developers of DVD playing software have to pay for. Therefore the cost is transferred to you. I guess that Microsoft was too cheap to include this for their media player. Or if they did the cost of Windows XP would be more.  

But there is an easy fix. After some googling I found this forum. There is a reverse engineered open source audio decoder for DVDs called AC3 Filter. Apparently this will fix the problem in most cases fairly reliably. I downloaded and installed it and played the DVD and the audio now worked. I didn’t need to change the default configuration but if you need to, there are plenty of options to tweak.

DVD-R discs that wont play in DVD players

Friday, January 25th, 2008

I’ve been trying for ages to create DVDs on my computer that will work on my DVD player. In theory, with a little knowledge and know-how, it should be pretty straight forward. In my case, this was not so. By doing a bit of research, I was finally able to successfully create discs that will actually play on a DVD player.

The DVDs that I make are photo slideshows for clients of my wife’s wedding photography business. For each wedding, there will be around 150 images that we create a slideshow of using Microsoft Photo Story 3. This software does really nice transitions that look quite elegant. You have the option of outputting your project in WMV format in DVD quality at 768 x 576 along with a few other formats.

The authoring software I use is Adobe Encore CS3, which is an excellent product for creating menus and planning the project. What it isn’t good for is transcoding WMV files into a format suitable for DVD. Apparently many of the shipped codecs are quite screwed. I was receiving a PGC error before the DVD burn would even start. I read a good forum that discussed how to fix PGC errors. This lead me to software called Sorenson Squeeze which is used to pre-encode your movie so that Adobe Encore doesn’t have to.

One of the common pitfalls in producing DVDs is the use of cheap media. TDK are fairly reputable as are Verbatim. My main burner is a Lite-On that is about a year old.

I was now ready to burn my DVD project to disc. Encore completed the burn without error messages. The disc would play fine on my computer however it would not play in my Panasonic DVD player. For a while I believed that my DVD player was not compatible with burned media. This issue was frustrating as I didn’t know which was at fault. Was it the disc or the player or a combination of both?

Later I read about a technique called Bitsetting. This is where you use special utility software to change the Book Type of your disc to trick DVD player into thinking the disc is a DVD-ROM. DVDs that are mass replicated are identified as DVD-ROM as the book type. They are not burned with a laser. Instead they are created with a stamp that is from a glass master. It costs hundreds of dollars to do this and is not a viable option for a one-off disc. Bitsetting does not work on DVD-R. It only works on DVD+R/RW discs. As it turns out none of my DVD writers were compatible with the software so I had to try something else.

I contacted a local DVD authoring and replication outfit in Auckland called Express Video mainly just to find out the cost of making a glass master. I wondered how they went about creating one-off DVDs for clients and if they had any issues with discs not working in their clients’ players. I emailed Jon and the advice that he gave me was to use quality media (They use Verbatim DVD-R discs). He also said to burn the discs at a slower speed. All of my previous attempts were at 16x. I tried again at 8x speed. This disc played but the audio and video kept dropping out. The slowest speed that my Lite-On writer would do was 6x. On this attempt, the disc played with fewer video and audio dropouts but it was still far from perfect. I found another older DVD writer under my desk. I considered scrap and I didn’t even think it was working. I’m not sure what brand it is but it allowed me to burn my DVD at 1x speed. At last this disc played flawlessly on my Panasonic player.

So if you’ve had problems creating discs that will play on DVD players, maybe this advice will help: Use quality DVD-R discs and burn at the slowest speed possible. Good luck.