Sensor Garis Menggunakan Webcam

Berikut project yang akan menggunakan library image processing AForge.NET dengan bahasa pemrograman C# dan menggunakan software Visual C# Express 2010. Berikut tampilan GUI-nya.

Project ini bermaksud sebagai sensor pendeteksi garis pada robot pengikut garis (line follower robot) sebagai pengganti sensor proximity photodioda.

Berikut kodenya.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using AForge;
using AForge.Controls;
using AForge.Video;
using AForge.Video.DirectShow;
using AForge.Imaging;
using AForge.Imaging.Filters;

namespace line_tracker2
{
    public partial class Form1 : Form
    {
        //reference sudah ditambahkan
        private FilterInfoCollection VideoCaptureDevices;//mengumpulkan setiap perangkat video yg terdeteksi
        private VideoCaptureDevice FinalVideoSource;//menampung perangkat video yang akan digunakan
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            //pertama add reference semua Aforge.video.dll dan Aforge.video.directshow.dll
            VideoCaptureDevices = new FilterInfoCollection(FilterCategory.VideoInputDevice);
            //sekarang perangkat video sudah tersimpan pada array di atas
            foreach (FilterInfo VideoCaptureDevice in VideoCaptureDevices)
            {
                comboBox1.Items.Add(VideoCaptureDevice.Name);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //tambahkan kode berikut untuk menentukan perangkat sumber dari video
            FinalVideoSource = new VideoCaptureDevice(VideoCaptureDevices[comboBox1.SelectedIndex].MonikerString);
            FinalVideoSource.NewFrame += new NewFrameEventHandler(FinalVideoSource_NewFrame);
            FinalVideoSource.Start();
        }
        private Rectangle objectRect;
        int x1, y1,x1_bawah, y1_bawah;
        void FinalVideoSource_NewFrame(object sender, NewFrameEventArgs eventArgs)
        {
            //sekarang kita tambahkan kode berikut untuk menampilkan new frame event (frame dari webcam) untuk menampilkan gambar pada picturebox
            Bitmap image = (Bitmap)eventArgs.Frame.Clone();//bitmap boxing
            Bitmap image_unfilter = (Bitmap)eventArgs.Frame.Clone();
            Bitmap image_bawah = (Bitmap)eventArgs.Frame.Clone();//bitmap boxing
            Bitmap image_unfilter_bawah = (Bitmap)eventArgs.Frame.Clone();

            Crop filter = new Crop(new Rectangle(0, 0, image.Width, (image.Height/8)));
            // apply the filter
            image = filter.Apply(image);
            image_unfilter = filter.Apply(image_unfilter);

            Crop filter_bawah = new Crop(new Rectangle(0, 320, image_bawah.Width, (image_bawah.Height / 8)));
            // apply the filter
            image_bawah = filter_bawah.Apply(image_bawah);
            image_unfilter_bawah = filter_bawah.Apply(image_unfilter_bawah);

            // create filter
            ColorFiltering filtercr = new ColorFiltering();
            // set color ranges to keep
            filtercr.Red = new IntRange(200, 255);
            filtercr.Green = new IntRange(200, 255);
            filtercr.Blue = new IntRange(200, 255);
            filtercr.FillOutsideRange = true;
            // apply the filter
            filtercr.ApplyInPlace(image);
            filtercr.ApplyInPlace(image_bawah);

            // create blob counter and configure it
            BlobCounter blobCounter = new BlobCounter();
            blobCounter.MinWidth = 20;                    // set minimum size of
            blobCounter.MinHeight = 20;                   // objects we look for
            blobCounter.FilterBlobs = true;               // filter blobs by size
            blobCounter.ObjectsOrder = ObjectsOrder.Size; // order found object by size
            // locate blobs
            blobCounter.ProcessImage(image);
            Rectangle[] rects = blobCounter.GetObjectsRectangles();
            // draw rectangle around the biggest blob
            if (rects.Length > 0)
            {
                objectRect = rects[0];
                Graphics g = Graphics.FromImage(image_unfilter);

                using (Pen pen = new Pen(Color.YellowGreen, 3))
                {
                    g.DrawRectangle(pen, objectRect);
                }

                g.Dispose();
                // calculate X,Y coordinates of object's center
                x1 = (objectRect.Left + objectRect.Right - image.Width) / 2;
                y1 = (image.Height - (objectRect.Top + objectRect.Bottom)) / 2;
            }

            blobCounter.ProcessImage(image_bawah);
            Rectangle[] rects_bawah = blobCounter.GetObjectsRectangles();
            // draw rectangle around the biggest blob
            if (rects_bawah.Length > 0)
            {
                objectRect = rects_bawah[0];
                Graphics g = Graphics.FromImage(image_unfilter_bawah);

                using (Pen pen = new Pen(Color.YellowGreen, 3))
                {
                    g.DrawRectangle(pen, objectRect);
                }

                g.Dispose();
                // calculate X,Y coordinates of object's center
                x1_bawah = (objectRect.Left + objectRect.Right - image_bawah.Width) / 2;
                y1_bawah = (image_bawah.Height - (objectRect.Top + objectRect.Bottom)) / 2;
            }

            pictureBox1.Image = image_unfilter;
            pictureBox2.Image = image_unfilter_bawah;
        }

        private void Form1_FormClosed(object sender, FormClosedEventArgs e)
        {
            //kita tambahkan kode untuk membuat webcam berhenti bekerja
            //kapanpun form telah ditutup maka webcam akan berhenti bekerja secara automatis
            if (FinalVideoSource.IsRunning)
            {
                FinalVideoSource.Stop();
            }
            //selesai
            //sekarang kita jalankan
        }

        private void timer1_Tick(object sender, EventArgs e)
        {
            label1.Text = String.Format("koordinat_atas: x={0}y={1} koordinat_bawah: x={2}y={3} delta_x = {4}", x1, y1, x1_bawah, y1_bawah,(x1-x1_bawah));
        }
    }
}

Berikut link file download dari project di atas. file

Mengukur Koordinat Menggunakan Mouse Komputer

Berikut link download project file VS C# di atas . http://www.mediafire.com/file/5lt774t9sjh7550/mouse.rar

Untuk mengukur koordinat tempat sebuah mobile robot berada, biasanya menggunakan rotary encoder untuk menghitung putaran roda yang kemudian diolah menjadi koordinat perpindahan robot dari titik asalnya. Beberapa solusi lainnya bisa menggunakan mouse komputer sebagai pengganti sebuah rotary encoder. Berikut kode aplikasi yg saya buat menggunakan Visual C# 2010 Express.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace mouse
{
    public partial class Form1 : Form
    {
        public const UInt32 SPI_SETMOUSESPEED = 0x0071;

        [DllImport("User32.dll")]
        static extern Boolean SystemParametersInfo(
            UInt32 uiAction,
            UInt32 uiParam,
            UInt32 pvParam,
            UInt32 fWinIni);
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            SystemParametersInfo(SPI_SETMOUSESPEED, 0, 1, 0);

            this.Cursor = new Cursor(Cursor.Current.Handle);
            Cursor.Position = new Point(632, 358);
        }

        private void Form1_FormClosing(object sender, FormClosingEventArgs e)
        {
            SystemParametersInfo(SPI_SETMOUSESPEED, 0, 20, 0);
        }
        int x, y,count_x,count_y;
        private void Form1_MouseMove(object sender, MouseEventArgs e)
        {
            this.Cursor = new Cursor(Cursor.Current.Handle);
            x = Cursor.Position.X;
            y = Cursor.Position.Y;

            if (x > 732)
            {
                Cursor.Position = new Point(532, y);
                count_x++;
            }
            if (x < 532)
            {
                Cursor.Position = new Point(732, y);
                count_x--;
            }
            if (y > 458)
            {
                Cursor.Position = new Point(x, 258);
                count_y++;
            }
            if (y < 258)
            {
                Cursor.Position = new Point(x, 458);
                count_y--;
            }

            label1.Text = Convert.ToString(x);
            label2.Text = Convert.ToString(y);
            label3.Text = Convert.ToString(count_x);
            label4.Text = Convert.ToString(count_y);
        }
    }
}

Me-Repair Install Windows XP

XP Repair install

Please read carefully and make sure you followed the warning links before initiating the Repair Install. You can print a text version for reference. repair.txt

  1. Boot the computer using the XP CD. You may need to change the boot order in the system BIOS so the CD boots before the hard drive. Check your system documentation for steps to access the BIOS and change the boot order.
  2. When you see the “Welcome To Setup” screen, you will see the options below  This portion of the Setup program prepares Microsoft
    Windows XP to run on your computer:
    To setup Windows XP now, press ENTER.To repair a Windows XP installation using Recovery Console, press R.To quit Setup without installing Windows XP, press F3.
  3. Press Enter to start the Windows Setup.

    Do Not choose “To repair a Windows XP installation using the Recovery Console, pressR“,(you Do Not want to load Recovery Console). I repeat, Do Notchoose “To repair a Windows XP installation using the Recovery Console, press R“.

  4. Accept the License Agreement and Windows will search for existing Windows installations.
  5. Select the XP installation you want to repair from the list and press R to start the repair. If Repair is not one of the options, END setup. After the reboot read Warning#2!
  6. Setup will copy the necessary files to the hard drive and reboot.  Do not press any key to boot from CD when the message appears. Setup will continue as if it were doing a clean install, but your applications and settings will remain intact. If you get files not found during the copying stage.Blaster worm warning: Do not immediately activate over the internet when asked, enable the XP firewall before connecting to the internet. You can activate after the firewall is enabled. Control Panel – Network Connections.  Right click the connection you use, Properties and there is a check box on the Advanced page.KB 833330u Blaster removalWhat You Should Know About the Sasser Worm and Its Variants

    If the Repair Option is not Available

    What should I do? Most important do not ignore the information below!

    If the option to Repair Install is NOT available and you continue with the install; you will delete your Windows folder and the Documents and Settings folders.  All applications installed that place keys in the registry will need to be re-installed and will require the original install media.

    You should exit setup if the repair option is not available and consider other options. I have found if the Repair option is not available, you have a few paths I have listed below to try before XP  requires a Clean install.

    Another option to consider (since the cost of 100 + gig hard drives has dropped to well under $75) would be to disconnect the current hard drive and install a clean XP from retail disks or restore media to a new hard drive. You can then connect the original hard drive after configuring the jumpers to a slave drive. You can retrieve important files. One thing to remember, if a hard drive has not been formatted or written over by reinstalling, the data is accessible. The less you access a hard drive after a non-boot episode; the better your chances of retrieving your data.

    Very important!!

    If you still have the ability to access the Windows XP installation, backup all important files not restorable from other sources before attempting any recovery console or other trouble shooting attempts.

    Possible Fix by reconfiguring boot.ini using Recovery Console.

    1.Boot with XP CD or 6 floppy boot disk set.

    2. Press R to load the Recovery Console.

    3. Type bootcfg.

    4. This should fix any boot.ini errors causing setup not to see the  XP OS
    install.

    5. Try the repair install.

    One more suggestion from MVP Alex Nichol

    “Reboot, this time taking the immediate R option and if the CD letter is say K: give these commands

    copy K:\i386\ntldr C:\
    copy K:\i386\ntdetect.com C:\

    (two other files needed – just in case)

    1. Type: attrib -h -r -s C:\boot.ini del C:\boot.ini

    2. Type: BootCfg /Rebuild

    which will get rid of any damaged boot.ini, search the disk for systems and make a new one. This might even result in a damaged windows reappearing; but gives another chance of getting at the repair”

    Microsoft Security Bulletin MS04-011

  7. Reapply updates or service packs applied since initial Windows XP installation. Please note that a Repair Install using an Original pre service pack 1 or 2 XP CD used as the install media will remove SP1/SP2 respectively and service packs plus updates issued after the service packs will need to be reapplied.
ATAU
To resolve this issue, start the computer from the Windows XP CD, start the Recovery Console, and then use the Bootcfg.exe tool to rebuild the Boot.ini file. To do this, follow these steps:

  1. Configure the computer to start from the CD-ROM or DVD-ROM drive. For information about how to do this, see your computer documentation, or contact your computer manufacturer.
  2. Insert the Windows XP CD-ROM into your CD-ROM or DVD-ROM drive, and then restart your computer.
  3. When you receive the “Press any key to boot from CD” message, press a key to start your computer from the Windows XP CD-ROM.
  4. When you receive the “Welcome to Setup” message, press R to start the Recovery Console.
  5. If you have a dual-boot or multiple-boot computer, select the installation that you have to use from the Recovery Console.
  6. When you are prompted, type the administrator password, and then press ENTER.
  7. At the command prompt, type bootcfg /list, and then press ENTER. The entries in your current Boot.ini file appear on the screen.
  8. At the command prompt, type bootcfg /rebuild, and then press ENTER. This command scans the hard disks of the computer for Windows XP, Microsoft Windows 2000, or Microsoft Windows NT installations, and then displays the results. Follow the instructions that appear on the screen to add the Windows installations to the Boot.ini file. For example, follow these steps to add a Windows XP installation to the Boot.ini file:
    1. When you receive a message that is similar to the following message, press Y:
      Total Identified Windows Installs: 1[1] C:\Windows
      Add installation to boot list? (Yes/No/All)

    2. You receive a message that is similar to the following message:
      Enter Load Identifier

      This is the name of the operating system. When you receive this message, type the name of your operating system, and then press ENTER. This is either Microsoft Windows XP Professional or Microsoft Windows XP Home Edition.

    3. You receive a message that is similar to the following:
      Enter OS Load options

      When you receive this message, type /fastdetect, and then press ENTER.

      Note The instructions that appear on your screen may be different, depending on the configuration of your computer.

  9. Type exit, and then press ENTER to quit Recovery Console. Your computer restarts, and the updated boot list appears when you receive the “Please select the operating system to start” message.

_______________________________

sumber:

http://www.michaelstevenstech.com/XPrepairinstall.htm

http://support.microsoft.com/kb/330184

Spy and Anti-Terror Robot Project

_____________________________________________________________________________________

System

_____________________________________________________________________________________

Software di PC operator 

Dibangun menggunakan Visual C# Express 2010

________________________________________________________________________________

Project Author:

Wangready and Edy Cahyono

Device Doctor Software yang Mudah Digunakan Untuk Mengupdate/Mencari Driver Perangkat Komputer

Device Dokter adalah aplikasi freeware Windows yang memindai perangkat keras komputer Anda dan memeriksa untuk melihat apakah ada update driver baru tersedia untuk perangkat Anda. Hal ini juga menempatkan driver untuk “perangkat tak dikenal” di Windows Device Manager.

CATATAN: Alat ini dirancang untuk menjadi sangat sederhana dan mudah digunakan.

Cukup klik pada ‘Begin Scan’ untuk mendeteksi hardware anda; Device Dokter akan mencarikan pada database driver kami dan segera mengambil file driver yang tepat untuk komputer Anda.

CATATAN:

– Extract terlebih dahulu jika file dalam bentuk .rar, .zip atau dsb. agar program dapat bekerja maksimum.

– Syarat scan driver: komputer terkoneksi dengan internet.

Jika driver untuk network belum terinstal sehingga komputer tidak bisa terkoneksi dengan internet yang menyebabkan DeviceDoctor tidak bisa bekerja semestinya, maka bisa digunakan software UnkownDevices untuk mencari informasi spesifik dari driver network agar bisa dicari driver yang tepat (Googling di komputer lain untuk mencari driver networknya).

Link http://www.devicedoctor.com/

UnknownDevices Sebuah Software Untuk Membantu Mengenali Driver Hardware

Unknown Devices membantu Anda menemukan perangkat apa yang tidak dikenal di Device Manager dengan benar-benar.

Dengan memeriksa Device Manager untuk perangkat yang tidak dikenal dan penggalian informasi dari itu, program ini mencoba untuk mencari tahu informasi  perangkat lebih detail. Anda mungkin tidak harus membuka hardware Anda atau mencari nomor seri dari kartu PCI untuk mencari tahu informasi dari hardware.

CATATAN:

– Extract terlebih dahulu jika file dalam bentuk .rar, .zip atau dsb. agar program dapat bekerja maksimum.

Link web asal http://www.halfdone.com/ukd/

Link download http://www.halfdone.com/ukd/UnknownDevices.zip

Driver Compaq Presario C501TU Windows XP

Terkadang kita mengalami kesulitan jika saat meng-install OS CD driver bawaan tidak ada atau hilang. Searching di google pun membutuhkan perjuangan dan terkadang tidak sesuai dengan hardware. Berikut adalah kumpulan driver untuk Compaq Presario C501TU untuk OS Windows XP. Mungkin juga bisa sesuai untuk tipe seri lainnya. Berikut linknya http://www.4shared.com/file/HqA1dmt5/Driver_Compaq_C501TU.html.