Using xrandr to change screen brightness

Of late, I have an external Acer monitor connected to my laptop. While this monitor is great, it does not have any controls to change the brightness manually! It can get too glaring, especially at night. In Windows, this is done by using the enclosed driver software. The same can be done on Linux using the utility xrandr, which even has controls for even setting gamma, contrast, etc. (on a side note, there are also color calibration tools that you can use to correct the color temperature of your screen if you own a colorimeter).

So here’s how to change the brightness manually using xrandr:

~$ xrandr --output  --brightness <0.00-1.00>

you can get the screen name using ‘xrandr -q | grep connected’. In my case, I thumbed down the brightness to 0.6.

For those of you who are facing a similar problem, try it!

Cat less, grep more

I believe this has been previously posted online, but a good tip to share. If you are counting the number of occurences of a keyword in a filelist (for example, a packing list) via the bash terminal, cat less for a faster grep. The key is to use fgrep, instead of piping the output to grep. By not wasting time dumping text to the screen, wou will save quite a bit of execution time. i.e:

~$ fgrep -c '1' packinglist.txt
~$ cat packinglist.txt | grep -c '1'

The latter command will be slower.

Linux fun and reblogging!

There. I have started blogging again, and changed the theme! Thanks to Woothemes for the free theme.

Of late, I have switched to using Ubuntu Linux (almost) completely a few months back. It takes a while getting used to, finding alternatives, etc. but hey! Loving the whole experience. Like, you can do lots of stuff using the bash terminal (command-line interface, or CLI), organize stuff easily, etc. And it loads fast as well.

To give you an idea of what programs Linux systems do have to offer, you have Kile for Latex, Open SSH (ssh) for remote logins, Libreoffice for file editing, various apt managers (aptitude, yum, apt-get) multi-screen managers within a single terminal shell (screen), and even down to customizing your very own desktop GUI window manager (KDE, Gnome Shell, Unity, XFCE, Xorg, etc), Code::blocks, Eclipse, etc. for IDEs, etc, etc. Cool huh?

There are a list of Linux distros you could try. By the way, distros (called flavours) are different packages based on the same Linux Kernel. So you can like try different distros to see which is your cup of tea. A good one would be Crunchbang(#!) (http://crunchbanglinux.org/), Ubuntu (http://www.ubuntu.com/), Debian (http://www.debian.org/), Fedora (http://fedoraproject.org/). It is even possible to boot into Linux using a USB thumbdrive or CD without installing Linux. Try it!

Phil 4:13

A verse to remember:

Philippians 4:13 (New International Version)
13I can do everything through him who gives me strength.

Amen!

Goodbye and A level results!

Hey!

Praise God! Results were very good. At least one less thing to worry about. He saw me through A levels. (:

Tomorrow I am going to serve the country in yet another way – ARMY! (: Will be enlisting soon. Looking forward to it! (:

Something I would like to share today:

8 He has showed you, O man, what is good.
And what does the LORD require of you?
To act justly and to love mercy
and to walk humbly with your God.
– Micah 6:8

Cya in 2 weeks’ time! =D

Memories

2 More days to army. Here’s some photos from the Teaching Internship Programme at Nanyang JC. Cheers! :)

PS All the best for results tomorrow!

Get Adobe Flash player

FLaser on Youtube

Hi there,

Just posted 2 videos from my FLaser Ver 1.0 (2 years ago) on Youtube.  You can view it here:

An excerpt:
Preamble:
This project proposes a cost-effective solution of interacting with a projector screen using a laser pointer, via an ordinary webcam.

The system was deployed and scripted in Flash Actionscript 3.0, back in Dec 2007 to Jan 2008.

It subsequently won the Most Innovative Award and Best Exhibit at the Singapore Shell Science Fair 2008, was shortlisted by MOE to represent Singapore in the Taiwan International Science Fair (TISF) 2008, in addition to being an exhibited finalist at the A*STAR Singapore Science and Engineering Fair (SSEF) 2009.

For more information, please checkout http://blog.joeltong.org/ .

Method:
The system comprises of a screen image from a projector. A webcam is positioned to track the projector screen area.

The steps for successful detection are as follows:
1. Calibration – 4 Red dots are shown on-screen. Thresholding red, the system is able to pick out the distance between the four red dots, demarking the tracked active area by the webcam. A ratio is then computed which is used to position the mouse.
2. A red laser dot is then shone onscreen. Minor adjustment knobs compensate for the offset in terms of the computed position of the laser dot and its actual position, similar to zeroing in using a crosshair.
3. The system is ready to track the laser pointer. In this case, a much high threshold is used, from the fact that red laser beams have a much higher intensity from the surrounding background.

System has been shown to detect laser dot despite showing red noise. However, alternative algorithms are being devised fo9r the system for better background noise tolerance.

Do checkout the version shown at Shell Science Fair @ LINK. System is targeted at rhe Flash platform, and for home users.

For more enquiries,

Email: me {at} joeltong {dot} org.

Thanks!

Best regards,
Joel Tong

http://blog.joeltong.org/

Radial Thresholding in AS3 (Webcam)

Perhaps one of the things I would like to do before NS – build a radial threshold filter.

Conventional threshold filters are constant throughout. This is means that if let’s say the image threshold value is 170, then that threshold value is applied to the WHOLE image. That is pretty bad for some cameras.

Back when I was working on my DSI project, I suggested implementing a radial threshold. Bah, not enough time then. This time, modular approach, OOP-based, voila.

My aim is to implement a radial threshold with a 2D-based function. In some webcams, the distribution of light may not be even, even though it IS even. It’s just picked up with bias. For example, let’s say we want the threshold to be a logarithmic function. Then we would use y = ln (x) or something (sometimes this works especially if you want the threshold to level out sooner than later.

All we have to do is then input this expression into the code, then by doing per-pixel iteration, we would be able to map that certain value for the specific pixel with the corresponding threshold value onto the image. Now, in this case we will be plotting 2 graphs: one of the image and another of threshold versus the length of the line from the origin (centre of circle).

See the pic for more info ;)

Hopefully I can make an implementation fast enough to be used for video manipulation in AS3 =D

Random Filter Stuff

Been playing around with some filters in Flash.

Here’s a few:

Laplacian of Gaussians i.e. difference of Gaussians – subtract 2 images of varying gaussian blurs to produce image.

Color exchange – flipping the colors using ColorMatrixFilter class.

Enjoy!

PS Just got my new iPhone, I am really in need of an SDK for Windows.  XCode anyone?  Help! =P

Improved Image Viewer

Get Adobe Flash player

Happy Chinese New Year!! Been dabbling around with my image viewer class during my free time in the past few days. Still purely AS3, albeit with more stuff like:

  • Navigational bar
  • Caption support
  • Page left-page right flipping motion
  • Varied animations to choose from.  If you can’t decide, leave it blank and it will randomize it for you.
  • Quite dynamic, and (compiled in CS3) it’s only 15kB! xD
  • Auto screen-fit resizing

Screenshot as above! =D   Enjoy!

So, proprietary or open-source? =D