Friday 24 April 2015

VB.NET :: Code Gallery Face Detection

VB.NET :: Image or Video Object Tracking Using SURF (Speeded Up Robust Features) On Visual Basic.Net 2012


  • Youtube user with id name “18F4550videos” at http://www.youtube.com/watch?v=zjxWpKCQqJc(OpenCV Tutorial 11: Object Detection and Tracking via SURF (Speeded Up Robust Features) in Emgu CV).
  • Paper Reference : ftp://ftp.vision.ee.ethz.ch/publications/articles/eth_biwi_00517.pdf
Interface Project Image-Video Object Tracking Using SURF :
Interface Project Image-Video Object Tracking Using SURF
Interface Project Image-Video Object Tracking Using SURF
This few steps that must be done is as follows run the code :
  1. Install the “libemgucv-windows-universal-gpu-2.4.9.1847.exe” on your computer.
  2. Make sure you have installed VS Visual Basic.Net 2012.
  3. Setting “. Net Framework Component” of the browse file “… \ bin \ Emgu.CV.UI.dll” according to where you extract the “libemgucv-windows-universal-gpu-2.4.9.1847.exe”. Right Click “Components -> Choose Items.. -> Browse file … \ bin \ Emgu.CV.UI.dll -> Open -> Click OK” as shown below :
    Add .Net Framework Component Emgu.CV.UI.dll
    Add .Net Framework Component Emgu.CV.UI.dll
    to add “HistogramBox, ImageBox, MatrixBox and PanAndZoomPictureBox”.
  4. Copy all files *.dll from “.. \ bin \ x86″ to “C: \ Windows \ System32″ if you are using Windows 32-bit, “.. \ bin \ x64″ for Windows 64-bit.
  5. Setting Project Properties part 1, Add Reference : “Right Click Project SURF->Click Add Reference… -> Browse Folder “..\Emgu\bin -> Choose .dll file -> Click Add Button”, as shown below :
    Select The Files To Reference..
    Select The Files To Reference..
    Then select All file .dll EmguCV -> Right Click -> Click Properties -> Set “Copy Local” become “True”, as shown below :
    Select All File .dll EmguCV Then Click Properties
    Select All File .dll EmguCV Then Click Properties
    Setting Project Properties part 2, Add Existing Items : “Right Click Project SURF->Click Add -> Click Existing Item… -> Browse Folder “..\Emgu\bin\x86″ -> Select All Files (*.*) -> Choose all file *.dll opencv -> Click Add Button”, as shown below :
    Add Existing Item All Files *.dll OpenCV
    Add Existing Item All Files *.dll OpenCV
    Then select All file .dll OpenCV -> Right Click -> Click Properties -> Set “Copy to Output Directory” become “Copy always”, as shown below :
    Select All File .dll OpenCV Then Click Properties
    Select All File .dll OpenCV Then Click Properties
  6. Download the all code from <Here : SURF_On_July_2013.zip>. Note : “After Download it, To Extract File (SURF_On_July_2013.zip), You must Rename Extension *.doc to *.zip” :). (We re-write the code from video above and with little modified, so it’s can be running on VS VisualBasic.Net 2012).
  7. To running, Right Click Project SURF -> Click Clean, Then Click Rebuild (Wait This Moment) -> Click Debug -> Click Start New Instance. Enjoy Use This Code. :)
This first preview interface code when running (Image Object Tracking) :
Demos 1. Tracking And Find Sub-Image Object On Large Image Scene
Demos 1. Tracking And Find Sub-Image Object On Large Image Scene
This second preview interface code when running (Image Object Tracking) :
Demos 2. Tracking And Find Sub-Image Object On Large Image Scene
Demos 2. Tracking And Find Sub-Image Object On Large Image Scene
This third preview interface code when running (Video Object Tracking):
Demos 3. Tracking And Find Sub-Image Object On Webcam Scene
Demos 3. Tracking And Find Sub-Image Object On Webcam Scene
This fourth preview interface code when running (Video Object Tracking):
Demos 4. Tracking And Find Sub-Image Object On Webcam Scene
Demos 4. Tracking And Find Sub-Image Object On Webcam Scene
This fifth preview interface code when running (Video Object Tracking):
Demos 5. Tracking And Find Sub-Image Object On Webcam Scene
Demos 5. Tracking And Find Sub-Image Object On Webcam Scene
This sixth preview interface code when running (Image Object Tracking):
Demos 6. Tracking And Find Sub-Image Object On Large Image Scene
Demos 6. Tracking And Find Sub-Image Object On Large Image Scene
This seventh preview interface code when running (Image Object Tracking):
Demos 7. Tracking And Find Sub-Image Object On Large Image Scene
Demos 7. Tracking And Find Sub-Image Object On Large Image Scene

OPEN CV :: OpenCVDotNet

DELPHI7 :: Menampilkan Tipe Data Text (Memo) di DBGrid Delphi



Salah satu masalah sederhana yang banyak terjadi adalah bagaimana menampilkan tipe data text mysql kedalam dbgrid di delphi. karena secara default, data yang ditampilkan bertuliskan (MEMO). Hal ini tentu saja dapat menjadi masalah tersendiri lebih lebih jika kita mengutamakan kenyamanan end-user. Perhatikan contoh berikut ini.

Menampilkan Tipe Data Text (Memo) di DBGrid Delphi

Pada gambar diatas terlihat bahwa nilai Field password pada DBGrid tidak ditampilkan karena merupakan tipe data text di mysql. Lantas bagaimana cara menampilkannya? 
Klik dua kali pada komponen ADOQuery. Lalu klik kanan dan Add All Field seperti gambar berikut

Menampilkan Tipe Data Text (Memo) di DBGrid Delphi

Berikutnya klik 1 kali pada field yang bertipe data text (bertuliskan memo di dbgrid) pada contoh ini adalah field password. masuk ke object inspector | event | OnGetText. Tambahkan Coding Berikut di dalam Event OnGetText
1Text := Copy(ADOQueryNamaField.AsString, 1, 200);
Menampilkan Tipe Data Text (Memo) di DBGrid Delphi

DELPHI7 :: Komponen Delphi Untuk Berkomunikasi dengan Modem USB



Sebagai gambaran, seperti yang telah saya katakan komponen ini dapat digunakan untuk berkomunikasi dengan modem USB, singkatnya anda dapat membuat aplikasi SMS Gateway dengan komponen ini. Jadi selain gammu anda dapat memanfaatkannya untuk kebutuhan membangun aplikasi SMS Gateway. komponen ini memiliki beberapa event seperti berikut

OnConnect = Event yang digunakan ketikan modem konek ke komputer. 
OnDetect = Event yang digunakan untuk mendeteksi perangkat modem.
OnDisconnect = Event ketika modem disconnect 
OnNewMessage = event ketika modem menerima SMS
OnReadMessage = event ketika SMS dibaca
OnSend = Event ketika SMS dikirim 

Komponen Delphi Untuk Berkomunikasi dengan Modem USB

Anda dapat meletakan coding anda pada event-event diata. Jika anda berminat untuk mencoba komponen ini silahkan Download disini. Mohon maaf karena saya belum sempat membuat projek untuk mencoba komponennya. anda dapat melihat contoh demo penggunaannya didalam folder master komponennya. selamat mencoba.

DELPHI7 :: Ebook Lengkap Pemrograman Delphi


Borland Delphi (Delphi) merupakan pemrograman berbasis Visual. Borlan Delphi merupakan pemrograman yang dikembangkan dari Turbo Pascal, sehingga bahsa yang digunakan juga bahasa pascal. Borlan delphi di luncurkan sekitar tahun 1995 pada system oprasi Windows.
Bagi temen-temen yang lagi belajar pemrograman Delphi, berikut ini beberpa koleksi ebook pemrograman Delphi yang mungkin bisa dijadikan referensi untuk belajar. Ebook ini lumayan lengkap, mulai dari tahap pemula sampai Master.
Berikut adalah beberapa Ebook yang bisa di download.


Silahkan di sownload sepuasnya, semoga bermanfaat.


DELPHI :: Contoh Software delphi Simulate the pressing of keyboard keys


{1. PostKeyEx32 function} 

procedure PostKeyEx32(key: Word; const shift: TShiftState; specialkey: Boolean); 
{************************************************************
* Procedure PostKeyEx32
*
* Parameters:
*  key    : virtual keycode of the key to send. For printable
*           keys this is simply the ANSI code (Ord(character)).
*  shift  : state of the modifier keys. This is a set, so you
*           can set several of these keys (shift, control, alt,
*           mouse buttons) in tandem. The TShiftState type is
*           declared in the Classes Unit.
*  specialkey: normally this should be False. Set it to True to
*           specify a key on the numeric keypad, for example.
* Description:
*  Uses keybd_event to manufacture a series of key events matching
*  the passed parameters. The events go to the control with focus.
*  Note that for characters key is always the upper-case version of
*  the character. Sending without any modifier keys will result in
*  a lower-case character, sending it with [ssShift] will result
*  in an upper-case character!
************************************************************}
 
type 
  TShiftKeyInfo = record 
    shift: Byte; 
    vkey: Byte; 
  end; 
  byteset = set of 0..7; 
const 
  shiftkeys: array [1..3] of TShiftKeyInfo = 
    ((shift: Ord(ssCtrl); vkey: VK_CONTROL), 
    (shift: Ord(ssShift); vkey: VK_SHIFT), 
    (shift: Ord(ssAlt); vkey: VK_MENU)); 
var 
  flag: DWORD; 
  bShift: ByteSet absolute shift; 
  i: Integer; 
begin 
  for i := 1 to 3 do 
  begin 
    if shiftkeys[i].shift in bShift then 
      keybd_event(shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0), 0, 0); 
  end; { For } 
  if specialkey then 
    flag := KEYEVENTF_EXTENDEDKEY 
  else 
    flag := 0; 
  keybd_event(key, MapvirtualKey(key, 0), flag, 0); 
  flag := flag or KEYEVENTF_KEYUP; 
  keybd_event(key, MapvirtualKey(key, 0), flag, 0); 
  for i := 3 downto 1 do 
  begin 
    if shiftkeys[i].shift in bShift then 
      keybd_event(shiftkeys[i].vkey, MapVirtualKey(shiftkeys[i].vkey, 0), 
        KEYEVENTF_KEYUP, 0); 
  end; { For } 
end; { PostKeyEx32 } 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  PostKeyEx32(VK_LWIN, [], False); 
  PostKeyEx32(Ord('D'), [], False); 
  PostKeyEx32(Ord('C'), [ssctrl, ssAlt], False); 
end; 
{************************************************************} 
{2. With keybd_event API} 

procedure TForm1.Button1Click(Sender: TObject); 
begin 
  {or you can also try this simple example to send any
   amount of keystrokes at the same time. }
 
  {Pressing the A Key and showing it in the Edit1.Text} 
  Edit1.SetFocus; 
  keybd_event(VK_SHIFT, 0, 0, 0); 
  keybd_event(Ord('A'), 0, 0, 0); 
  keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0); 
  {Presses the Left Window Key and starts the Run} 
  keybd_event(VK_LWIN, 0, 0, 0); 
  keybd_event(Ord('R'), 0, 0, 0); 
  keybd_event(VK_LWIN, 0, KEYEVENTF_KEYUP, 0); 
end; 
{***********************************************************} 
{3. With keybd_event API} 

procedure PostKeyExHWND(hWindow: HWnd; key: Word; const shift: TShiftState; 
  specialkey: Boolean); 
{************************************************************
* Procedure PostKeyEx
*
* Parameters:
*  hWindow: target window to be send the keystroke
*  key    : virtual keycode of the key to send. For printable
*           keys this is simply the ANSI code (Ord(character)).
*  shift  : state of the modifier keys. This is a set, so you
*           can set several of these keys (shift, control, alt,
*           mouse buttons) in tandem. The TShiftState type is
*           declared in the Classes Unit.
*  specialkey: normally this should be False. Set it to True to
*           specify a key on the numeric keypad, for example.
*           If this parameter is true, bit 24 of the lparam for
*           the posted WM_KEY* messages will be set.
* Description:
*  This
procedure sets up Windows key state array to correctly
*  reflect the requested pattern of modifier keys and then posts
*  a WM_KEYDOWN/WM_KEYUP message pair to the target window. Then
*  Application.ProcessMessages is called to process the messages
*  before the keyboard state is restored.
* Error Conditions:
*  May fail due to lack of memory for the two key state buffers.
*  Will raise an exception in this case.
* NOTE:
*  Setting the keyboard state will not work across applications
*  running in different memory spaces on Win32 unless AttachThreadInput
*  is used to connect to the target thread first.
*Created: 02/21/96 16:39:00 by P. Below
************************************************************}
 
type 
  TBuffers = array [0..1] of TKeyboardState; 
var 
  pKeyBuffers: ^TBuffers; 
  lParam: LongInt; 
begin 
  (* check if the target window exists *) 
  if IsWindow(hWindow) then 
  begin 
    (* set local variables to default values *) 
    pKeyBuffers := nil; 
    lParam := MakeLong(0, MapVirtualKey(key, 0)); 
    (* modify lparam if special key requested *) 
    if specialkey then 
      lParam := lParam or $1000000; 
    (* allocate space for the key state buffers *) 
    New(pKeyBuffers); 
    try 
      (* Fill buffer 1 with current state so we can later restore it. 
         Null out buffer 0 to get a "no key pressed" state. *) 
      GetKeyboardState(pKeyBuffers^[1]); 
      FillChar(pKeyBuffers^[0], SizeOf(TKeyboardState), 0); 
      (* set the requested modifier keys to "down" state in the buffer*) 
      if ssShift in shift then 
        pKeyBuffers^[0][VK_SHIFT] := $80; 
      if ssAlt in shift then 
      begin 
        (* Alt needs special treatment since a bit in lparam needs also be set *) 
        pKeyBuffers^[0][VK_MENU] := $80; 
        lParam := lParam or $20000000; 
      end; 
      if ssCtrl in shift then 
        pKeyBuffers^[0][VK_CONTROL] := $80; 
      if ssLeft in shift then 
        pKeyBuffers^[0][VK_LBUTTON] := $80; 
      if ssRight in shift then 
        pKeyBuffers^[0][VK_RBUTTON] := $80; 
      if ssMiddle in shift then 
        pKeyBuffers^[0][VK_MBUTTON] := $80; 
      (* make out new key state array the active key state map *) 
      SetKeyboardState(pKeyBuffers^[0]); 
      (* post the key messages *) 
      if ssAlt in Shift then 
      begin 
        PostMessage(hWindow, WM_SYSKEYDOWN, key, lParam); 
        PostMessage(hWindow, WM_SYSKEYUP, key, lParam or $C0000000); 
      end 
      else 
      begin 
        PostMessage(hWindow, WM_KEYDOWN, key, lParam); 
        PostMessage(hWindow, WM_KEYUP, key, lParam or $C0000000); 
      end; 
      (* process the messages *) 
      Application.ProcessMessages; 
      (* restore the old key state map *) 
      SetKeyboardState(pKeyBuffers^[1]); 
    finally 
      (* free the memory for the key state buffers *) 
      if pKeyBuffers <> nil then 
        Dispose(pKeyBuffers); 
    end; { If } 
  end; 
end; { PostKeyEx } 

procedure TForm1.Button1Click(Sender: TObject); 
var 
  targetWnd: HWND; 
begin 
  targetWnd := FindWindow('notepad', nil) 
    if targetWnd <> 0 then 
    begin 
      PostKeyExHWND(targetWnd, Ord('I'), [ssAlt], False); 
  end; 
end; 
{***********************************************************} 
{3. With SendInput API} 

procedure TForm1.Button1Click(Sender: TObject); 
const 
   Str: string = 'writing writing writing'; 
var 
  Inp: TInput; 
  I: Integer; 
begin 
  Edit1.SetFocus; 
  for I := 1 to Length(Str) do 
  begin 
    Inp.Itype := INPUT_KEYBOARD; 
    Inp.ki.wVk := Ord(UpCase(Str[i])); 
    Inp.ki.dwFlags := 0; 
    SendInput(1, Inp, SizeOf(Inp)); 
    Inp.Itype := INPUT_KEYBOARD; 
    Inp.ki.wVk := Ord(UpCase(Str[i])); 
    Inp.ki.dwFlags := KEYEVENTF_KEYUP; 
    SendInput(1, Inp, SizeOf(Inp)); 
    Application.ProcessMessages; 
    Sleep(80); 
  end; 
end; 

procedure SendAltTab; 
var 
  KeyInputs: array of TInput; 
  KeyInputCount: Integer; 
  
procedure KeybdInput(VKey: Byte; Flags: DWORD); 
  begin 
    Inc(KeyInputCount); 
    SetLength(KeyInputs, KeyInputCount); 
    KeyInputs[KeyInputCount - 1].Itype := INPUT_KEYBOARD; 
    with  KeyInputs[KeyInputCount - 1].ki do 
    begin 
      wVk := VKey; 
      wScan := MapVirtualKey(wVk, 0); 
      dwFlags := KEYEVENTF_EXTENDEDKEY; 
      dwFlags := Flags or dwFlags; 
      time := 0; 
      dwExtraInfo := 0; 
    end; 
  end; 
begin 
  KeybdInput(VK_MENU, 0);                // Alt 
  KeybdInput(VK_TAB, 0);                 // Tab 
  KeybdInput(VK_TAB, KEYEVENTF_KEYUP);   // Tab 
  KeybdInput(VK_MENU, KEYEVENTF_KEYUP); // Alt 
  SendInput(KeyInputCount, KeyInputs[0], SizeOf(KeyInputs[0])); 
end;



sumber