Monday, December 6, 2010

Why RON95 is bad

Work in progress...lots of duplicate stuff...I may clean this up as I read more and have time to back to this article.

This article is a rebuttal of Paul Tan's "Research Octane Number: What is RON95?", which contains several misleading information.

RON is actually short form for Research Octane Number. It is a rating for unleaded petrol. Higher Research Octane Number mean the petrol have higher resistance toward pre-ignition or detonation. In very basic terms, it's a measure of how hard the fuel is to ignite.

If you run your vehicle on low octane petrol you might notice a 'knocking', 'rattling', or 'pinging' sound (as it’s often called), which means the fuel is detonating instead of burning smoothly. This is not only a waste of energy, but it can also damage your engine in the long run. Burning is the desired effect of any internal combustion engine (not an explosion per se).

Fuel with a higher octane number suitable for your vehicle's engine will eliminate knocking. Older cars that were designed to run on a lower RON fuel can also benefit from a higher RON, because the older the car and the higher the kilometres, means the engine will have a greater propensity to knock. This is mainly caused by a build-up of contaminants and carbon deposits which, when hot, can cause pre-ignition.

Lower RON numbers means the fuel is more likely to ignite spontaneously, in minor accidents.

In a gasoline engine, ignition is controlled by adjusting the timing and/or intensity of the spark. Providing a spark at exactly the right moment gives you maximum power and efficiency and minimizes pollution. But any compressed air-fuel mixture will spontaneously ignite, or "detonate." This is also known as "knocking," and can destroy your engine in addition to damaging your bank account and the environment. We want gasoline to burn when the spark plug fires, but not when the piston compresses it.

What does this mean to you? If you drive a high-performance sports car that uses high compression and high RPMs, you probably have a minimum safe octane rating for your engine. Using fuel with too low an octane rating may cause your engine to fail prematurely.

Knock Sensors

Some engines are fitted with a device called a knock sensor. Regardless of whether your vehicle has a knock sensor or multiple knock sensors, if it has high mileage, a higher RON fuel would be the most mechanically sympathetic thing to do. Why is that?

You see the knock sensors in your engine (if equipped) have a job to do. They protect your engine from knock by retarding timing; but here is the thing - your car ‘has’ to knock first before the knock sensors can do their job! This is not a good start in the first place. When an engine ‘knocks’ the engine temperature soars, and with most modern engines using an all alloy block, heat is bad... very bad.

Of course, modern cars have very advanced fuel control systems and can deal with a much greater variety of fuels than old carburetor models.

The manufacturer of your car does not get kickbacks from the oil companies, and they do not benefit in any way from you spending more money on gas. However, they do see fewer damaged engines that have been run on high-octane gas so they are reasonable in suggesting that you use it.

It may also be that people who spend more money on fuel generally have more money to spend, so they are more likely to conduct regular maintenance and keep their car happy.

Bottom line: If you hear knocking (it's a subtle noise, you might want to get a mechanic to demonstrate it for you), use a higher octane gas. It happens most frequently when climbing a steep hill under heavy acceleration. It can happen to cheap clunkers too and is just as destructive.

So what does all this RON nonsense mean to the average motorist? Does it give you more power like many people suggest? Can you really ‘feel’ that extra power via the driver’s seat? Does a higher RON fuel equal better fuel consumption? The answer to these questions is somewhere between “maybe” and “yes”, but it depends a lot on your car, its state of tune, and how you drive.

Will lower quality petrol damage the engine?

This depends on your vehicle’s engine compression ratio. The compression ratio is a value that represents the ratio of the volume of its combustion chamber from its largest capacity to its smallest capacity. A high compression ratio is desirable because it allows an engine to extract more mechanical energy from a given mass of air-fuel mixture due to its higher thermal efficiency. Higher compression ratios will however make gasoline engines subject to engine knocking if lower octane rated fuel is used. This can reduce efficiency or damage the engine.

The compression process caused temperature variation inside the combustion chamber. This will lead to premature ignition of oil, which we refer as knocking. Heavy knocking occurs equal to low performance, equal to serious engine damage as well. The main point here is you must select the petrol with RON suitable to your engine compression ratio.

My advice is reach for the better stuff. Not only are you “spreading the love” to your engine, but you will likely see better mileage and you will be doing your bit for the environment. On the whole, the higher the RON, the cleaner the emissions.
Till next time, Happy and safe motoring.

References:

Sunday, October 31, 2010

Wednesday, October 20, 2010

Clean Up MP3 Filenames

import os

base = '/home/maczulu/Music'
os.chdir(base)
filelist = os.listdir(base)
for file in filelist:
  if '_' in file:
    newname = file.replace('_',' ')
    print file,newname
    os.rename(file, newname)

GNOME of course!

Monday, October 18, 2010

Convert IPLImage (OpenCV) to QImage (Qt) vice versa

This snippet will convert QImages into iplImage with depth 8 and 3 channels. QImage can store data in several formats. This code accepts just 24-bit QImage::Format_RGB888 and the QImage::Format_RGB32. Alpha values in the 32-bit format will be removed during the conversion.

static IplImage* qImage2IplImage(const QImage& qImage)
{
  int width = qImage.width();
  int height = qImage.height();
  // Creates a iplImage with 3 channels
  IplImage *img = cvCreateImage(cvSize(width, height), IPL_DEPTH_8U, 3);
  char* imgBuffer = img->imageData;
  //Remove alpha channel
  int jump = (qImage.hasAlphaChannel())? 4 : 3;
  for(int y=0;yheight;y++){
    QByteArray a((constchar*)qImage.scanLine(y), qImage.bytesPerLine());
  for(int i=0; i<a.size(); i+="jump){
    //Swap from RGB to BGR
    imgBuffer[2]= a[i];
    imgBuffer[1]= a[i+1];
    imgBuffer[0]= a[i+2];
    imgBuffer+=3;
  }
}
return img;

This snippet will convert a iplImage with depth 8 and 3 channels into a 24-bit QImage.

static QImage IplImage2QImage(const IplImage *iplImage) 
{ 
  int height = iplImage->height; 
  int width = iplImage->width; 
  if (iplImage->depth == IPL_DEPTH_8U && iplImage->nChannels == 3) 
  { 
      const uchar *qImageBuffer =(const uchar*)iplImage->imageData; 
      QImage img(qImageBuffer, width, height, QImage::Format_RGB888); 
      return img.rgbSwapped(); 
  }else{ 
    qWarning() << "Image cannot be converted."; 
   return QImage(); 
  } 
} 


http://wiki.forum.nokia.com/index.php?title=Special:PdfPrint&page=Using_OpenCV_with_Qt

Another method here:

http://umanga.wordpress.com/2010/04/19/how-to-covert-qt-qimage-into-opencv-iplimage-and-wise-versa/

Do they work for you?
Please leave a comment.

Tuesday, October 12, 2010

Good Features to Track using OpenCV and Python

import cv

filename =  "burke94.jpg" # replace w/ your filename
grayImage = cv.LoadImage(filename, 2)
eigImage = cv.CreateImage(cv.GetSize(grayImage), cv.IPL_DEPTH_32F, 1)
tempImage = cv.CreateImage(cv.GetSize(grayImage), cv.IPL_DEPTH_32F, 1)

cornerMem = []
cornerCount = 300
qualityLevel = 0.1
minDistance = 5
cornerMem = cv.GoodFeaturesToTrack(grayImage, eigImage, tempImage,  cornerCount, qualityLevel, minDistance, None, 3, False)

print len(cornerMem), " corners found"
print cornerMem


for point in cornerMem:
    center = int(point[0]), int(point[1])
    cv.Circle(colorImage, (center), 2, (0,255,255))
cv.SaveImage("savedcolor.jpg",colorImage)

Laplacian filter using OpenCV and Python

import cv

# Load the image, replace filename with any JPG you like
img = cv.LoadImage("olympus.jpg")
# create buffer for grayscle
tmp = cv.CreateImage(cv.GetSize(img), cv.IPL_DEPTH_8U, 1)
#  convert color to grayscale
cv.CvtColor(img, tmp, cv.CV_BGR2GRAY)
# create destination buffer
dst = cv.CreateImage(cv.GetSize(img), cv.IPL_DEPTH_32F, 1)
# execute the filter: 3rd parameter is mask size, default = 3
cv.Laplace(tmp, dst)
# save image to disk
cv.SaveImage("saved.jpg", dst)

You can shorten the code by converting to grayscale on the fly like so:
import cv

img = cv.LoadImage("olympus.jpg", 2)
dst = cv.CreateImage(cv.GetSize(img), cv.IPL_DEPTH_32F, 1)
cv.Laplace(img, dst) # 3rd parameter is mask size, default = 3
cv.SaveImage("saved.jpg", dst)
Instead of saving to disk, you may want to display the result on a new window. Not shown here..

Replacing Panasonic HDD in Panasonic DVD Recorder

Minggu lepas, Panasonic DVD recorder tiba-tiba tak mau rakam. Dah sah hard disk rosak. Habislah rakaman Shin Chan dan Doraemon yang dikumpul beberapa tahun tu. Cari punya cari, terjumpa posting yg kata boleh ganti dengan sebarang hard disk IDE. Ada hard disk spare, maka terjadilah projek 15 minit berikut.

DVD recorder dari luar.

Part number DMR EH-60.

DVD recorder setelah dibuka.

Hard disk yang rosak: Western Digital 200GB. Memang brand ni kurang baik.

Hard disk baru: Hitachi 320GB.

DVD recorder setelah dipasang HDD baru.

Operasi format HDD baru.

Kapasiti 200GB ialah 355 jam EP mode. Tapi default mode ialah SP.

Setelah diformat, hanya 200GB digunakan dari 320GB disebabkan saiz telah ditetapkan oleh firmware. Dengan 200GB, masa rakaman dalam SP mode ialah 184 jam. Darab 2 utk EP mode iaitu lebih kurang 355 jam.

Tuesday, July 20, 2010

Thursday, July 15, 2010

Streamyx 1Mbps blockbuster in test mode

TMnet is giving me 2 Mbps for this week. I'm using it to upgrade from Karmic Koala to Lucid Lynx.

Tuesday, July 13, 2010

Error downloading package

If you hit Ctrl-C while apt-get is running, you may see this message if you run it again:

E: Could not get lock /var/lib/dpkg/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?

Solution:

$ sudo rm -rf /var/lib/dpkg/lock
$ sudo rm -rf /var/cache/apt/archives/lock 
$ sudo rm -rf /var/lib/apt/lists/lock

Tuesday, May 4, 2010

Image Database Collection

Senarai Image Database

  • http://datasets.visionbib.com/info-index.html
  • http://www.elec.qmul.ac.uk/staffinfo/andrea/avss2007_d.html 
  • http://www.visionbib.com/bibliography/keyword/d.html
     

Sunday, March 7, 2010

An overview ARM in SoC

Put a SoC in it

Analysis ARM-based system-on-chip PCs might rule

By Clive Akass

"ARM processor cores, thanks largely to their low power drain, now outnumber by far those using the PC's x86 architecture. Twelve billion of them have been used in mobile devices alone, 2.5 billion of them last year; they are in an estimated 99 out of 100 mobile phones, which use an average of 2.2 ARM cores each."

Friday, February 26, 2010

SIFT and RANSAC

http://web.engr.oregonstate.edu/~hess/index.html

http://en.wikipedia.org/wiki/RANSAC

Wednesday, February 3, 2010

Remote Shooting dengan Nikon

Selama ni, ingatkan hanya Canon beri perisian percuma utk kawal kamera menggunakan USB. Rupanya Nikon pun ada, cuma bukan dari Nikon.
Dah download Sofortbild, tapi dengan D90 nampak gelaap je.

Friday, January 15, 2010

Installing PyQt4

Currently, the best combination is:
  • Python 2.6.4 - more compatible with third party packages than Python 3.0
  • PyQt4 version 4.6.2
Most importantly, get the 32-bit installer for Python even if your machine & OS are 64 bit -- PyQt4 only works with 32 bit Python.

    Wednesday, January 13, 2010

    RANSAC dan good features to track

    http://en.wikipedia.org/wiki/RANSAC

    http://mrl.nyu.edu/~bregler/classes/vision_fall06/shi_tomasi_94.pdf

    Thursday, January 7, 2010

    How to install pyqt4 on ubuntu linux

    Install and run "hello world" example
    • Install it
    $ sudo apt-get install python-qt4
    • Create a file ~/tmp/helloworld.py
    import sys
    from PyQt4.QtGui import *
    app = QApplication(sys.argv)
    button = QPushButton("Hello World", None)
    button.show()
    app.exec_()
    

    • Run it:
    $ python ~/tmp/helloworld.py



  • You should see a window with a single button pop up.








  • Install additional examples
    • For more examples, install the python-qt4-doc package: 

    $ sudo apt-get install python-qt4-doc

    • After installation, the examples are located at: 
    /usr/share/doc/python-qt4-doc/examples

    Friday, January 1, 2010

    Merry New Year

    Merry New Year.
    Maksiat tinggalkan.
    Dinihari ada gerhana bulan.


    Nak ikutkan hati, nak keluar ambil foto bunga api dsb tapi ni kan hari Jumaat...

    Objek foto paling popular : Masjid Putrajaya.
    Teknik pre-processing paling popular: HDR (high-dynamic range).
    Moment paling ditunggu: ROL (ray-of-light)