PIXNET Logo登入

天天向上

跳到主文

程式外包服務  E-mail: me1237guy@yahoo.com.tw 歡迎來信洽談, 請附上相關文件或問題說明, 謝謝

專長:  ※自動光學檢測 ※人臉辨識 ※車牌辨識 ※錄影監控系統 ※自動控制I/O相關 
      ※演算法開發 ※基因演算法 ※類神經網路 
      ※MATLAB  ※VISUAL C++/C# ※Xamarin ※OpenCV ※Emgu ※Unity ※QT4/5
-----------------------------------------------------------------------------------------------
   SA (模擬退火法)     GA (基因演算法)    ACO (蟻群演算法)    PSO (粒子最佳化演算法)   
   排列組合問題最佳化   TSP  Scheduling  K-means, Fuzzy C-means, KNN, DBSCAN分群  
   Fuzzy Control (模糊控制)  Neural Networks (類神經網路) Object Tracking (Kalman Filter, Optical Flow)  
   Object Recognition (Pattern Match, Haar-Like Features, EigenFace)  Human Pose Recognition
   人臉偵測     移動物偵測   車牌辨識    智慧型監控攝影  XBOX Kinect影像處理及應用 體感互動應用  
   自動光學檢測(AOI) 玻璃檢測  NVIDIA CUDA平行運算處理
   TI-DSP 6xxx系列 雙影像輸入   / Raspberry PI 樹莓派 / Arduino控制  自走車避障礙物(GPS/機器視覺)

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 4月 29 週一 201320:38
  • 寫入和讀出檔案

使用Windows API: CreateFile, WriteFile, ReadFile, CloseHandle
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(811)

  • 個人分類:Visual Studio
▲top
  • 4月 26 週五 201321:16
  • 安裝 Basler pylon SDK 3.2.3

安裝下載
Basler pylon SDK x86 3.2.3.3215.exe
Basler pylon SDK x64 3.2.3.3215.exe
在Win7 x64 作業系統只能安裝x64版本, 無法安裝x86版本
開啟pylon IP Configuration Tool查詢關於Basler攝影機硬體相關資訊
控制台 -> 變更介面卡設定
滑鼠點選區域連線設定, 按右鍵<內容>
選擇<網際網路通訊協定第四版 TCP/IPv4>, 按下<內容>按鈕
設定與攝影機相同網段192.168.11.xxx, 其中xxx為1~253, 但不可以和攝影機設定成相同的網址192.168.11.13
開啟Pylon Viewer, 可以看到剛才偵測到的攝影機裝置 Basler raL2048-48gm
開啟檔案總管, 安裝路徑為 C:Program FilesBasler
進入Samples目錄夾, 選擇C語言次目錄, 開啟PylonCSamples
對應的User guide for C Programming為PylonCSDK
開啟PylonCSDK使用手冊
選擇[Link]->Input下拉選單, Object/Library輸入PylonC_MD_vc100.lib

Include路徑加入 $(PYLONC_ROOT)include
其中PYLONC_ROOT為系統環境變數
C:\\Program Files\\Basler\\pylon 3.2\\pylonc\\include
----------------------------------------------------------------------------------------------------
研究 SimpleGrab.c
/*
This sample illustrates how to use the PylonDeviceGrabSingleFrame() convenience
method for grabbing images in a loop. PylonDeviceGrabSingleFrame() grabs one
single frame in single frame mode.
Grabbing in single frame acquisition mode is the easiest way to grab images. Note: in single frame
mode the maximum frame rate of the camera can't be achieved. The full frame
rate can be achieved by setting the camera to the continuous frame acquisition
mode and by grabbing in overlapped mode, i.e., image acquisition is done in parallel
with image processing. This is illustrated in the OverlappedGrab sample program.
*/
#include <stdlib.h>
#include <stdio.h>
#include <malloc.h>
#include <pylonc/PylonC.h>
---------------------------------------------------------------------------------------------------
    /* Before using any pylon methods, the pylon runtime must be initialized. */
    PylonInitialize();                    // 初始化
    /* Enumerate all camera devices. You must call
    PylonEnumerateDevices() before creating a device! */
    res = PylonEnumerateDevices( &numDevices );
    CHECK(res);
    if ( 0 == numDevices )
    {
        fprintf( stderr, "No devices found!n" );
        /* Before exiting a program, PylonTerminate() should be called to release
           all pylon related resources. */
        PylonTerminate();   
        pressEnterToExit();
        exit(EXIT_FAILURE);
    }
    /* Get a handle for the first device found.  */
    res = PylonCreateDeviceByIndex( 0, &hDev );
    CHECK(res);
    /* Before using the device, it must be opened. Open it for configuring
    parameters and for grabbing images. */
    res = PylonDeviceOpen( hDev, PYLONC_ACCESS_MODE_CONTROL |   
                                                 PYLONC_ACCESS_MODE_STREAM );
    CHECK(res);
    /* Print out the name of the camera we are using. */
    {
        char buf[256];
        size_t siz = sizeof(buf);
        _Bool isReadable;
        isReadable = PylonDeviceFeatureIsReadable(hDev, "DeviceModelName");
        if ( isReadable )
        {
            res = PylonDeviceFeatureToString(hDev, "DeviceModelName", buf, &siz );
            CHECK(res);
            printf("Using camera %sn", buf);  // 印出裝置名稱
        }
    }
    /* Set the pixel format to Mono8, where gray values will be output as 8 bit values for each pixel. */
    /* ... Check first to see if the device supports the Mono8 format. */
    isAvail = PylonDeviceFeatureIsAvailable(hDev, "EnumEntry_PixelFormat_Mono8");
    if ( !isAvail )
    {
        /* Feature is not available. */
        fprintf(stderr, "Device doesn't support the Mono8 pixel format.");
        PylonTerminate();
        pressEnterToExit();
        exit (EXIT_FAILURE);
    }
   
    /* ... Set the pixel format to Mono8. */
    res = PylonDeviceFeatureFromString(hDev, "PixelFormat", "Mono8" );
    CHECK(res);
    /* Disable acquisition start trigger if available */
    isAvail = PylonDeviceFeatureIsAvailable( hDev, "EnumEntry_TriggerSelector_AcquisitionStart");
    if (isAvail)
    {
        res = PylonDeviceFeatureFromString( hDev, "TriggerSelector", "AcquisitionStart");
        CHECK(res);
        res = PylonDeviceFeatureFromString( hDev, "TriggerMode", "Off");
        CHECK(res);
    }
 
    /* Disable frame start trigger if available */
    isAvail = PylonDeviceFeatureIsAvailable( hDev, "EnumEntry_TriggerSelector_FrameStart");
    if (isAvail)
    {
        res = PylonDeviceFeatureFromString( hDev, "TriggerSelector", "FrameStart");
        CHECK(res);
        res = PylonDeviceFeatureFromString( hDev, "TriggerMode", "Off");
        CHECK(res);
    }
    /* For GigE cameras, we recommend increasing the packet size for better
       performance. If the network adapter supports jumbo frames, set the packet
       size to a value > 1500, e.g., to 8192. In this sample, we only set the packet size
       to 1500. */
    /* ... Check first to see if the GigE camera packet size parameter is supported
        and if it is writable. */
    isAvail = PylonDeviceFeatureIsWritable(hDev, "GevSCPSPacketSize");
    if ( isAvail )
    {
        /* ... The device supports the packet size feature. Set a value. */
        res = PylonDeviceSetIntegerFeature( hDev, "GevSCPSPacketSize", 1500 );
        CHECK(res);
    }
    /* Determine the required size of the grab buffer. */
    res = PylonDeviceGetIntegerFeatureInt32( hDev, "PayloadSize", &payloadSize );
    CHECK(res);
   
    /* Allocate memory for grabbing. */
    imgBuf = (unsigned char*) malloc( payloadSize );
    if ( NULL == imgBuf )
    {
        fprintf( stderr, "Out of memory.\n" );
        PylonTerminate();
        pressEnterToExit();
        exit(EXIT_FAILURE);
    }
    /* Grab some images in a loop. */
    for ( i = 0; i < numGrabs; ++i )
    {
        unsigned char min, max;
        PylonGrabResult_t grabResult;
        _Bool bufferReady;
        /* Grab one single frame from stream channel 0. The
        camera is set to single frame acquisition mode.
        Wait up to 500 ms for the image to be grabbed. */
        res = PylonDeviceGrabSingleFrame( hDev, 0, imgBuf, payloadSize,
            &grabResult, &bufferReady, 500 );
        if ( GENAPI_E_OK == res && !bufferReady )
        {
            /* Timeout occurred. */
            printf("Frame %d: timeout\n", i+1);
        }
        CHECK(res);
        /* Check to see if the image was grabbed successfully. */
        if ( grabResult.Status == Grabbed )
        {
            /* Success. Perform image processing. */
            getMinMax( imgBuf, grabResult.SizeX, grabResult.SizeY, &min, &max );
            printf("Grabbed frame #%2d. Min. gray value = %3u, Max. gray value = %3u\n", i+1, min, max);
            /* Display image */
            res = PylonImageWindowDisplayImageGrabResult(0, &grabResult);
            CHECK(res);
        }
        else if ( grabResult.Status == Failed )
        {
            fprintf( stderr,  "Frame %d wasn't grabbed successfully.  Error code = 0x%08X\n",
                i+1, grabResult.ErrorCode );
        }
    }
    /* Clean up. Close and release the pylon device. */
    res = PylonDeviceClose( hDev );
    CHECK(res);
    res = PylonDestroyDevice ( hDev );
    CHECK(res);
    /* Free memory for grabbing. */
    free( imgBuf );
    pressEnterToExit();
    /* Shut down the pylon runtime system. Don't call any pylon method after
       calling PylonTerminate(). */
    PylonTerminate();
    return EXIT_SUCCESS;
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(4) 人氣(5,300)

  • 個人分類:攝影機
▲top
  • 4月 23 週二 201318:57
  • Visual Studio新增ActiveX控制項

專案類型 -> MFC -> MFC ActiveX控制項
專案名稱: ActiveXTest
類別檢視->CActiveXTestCtrl->新增兩個成員變數 _a 和 _b
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(1) 人氣(1,904)

  • 個人分類:Visual Studio
▲top
  • 4月 21 週日 201323:15
  • 改變StringGrid Cell顏色

假設針對一個StringGrid名稱為SaveStringGrid
假設GridColor 為用於儲存對應SaveStringGrid陣列的每一個顏色值(Pixel Value)
首先, 在Unit1.h先宣告一個 TColor **GridColor;    
Form1的OnCreate事件加入下列程式碼:
     //建立與StringGrid相同大小的顏色陣列
     GridColor = new TColor* [SaveStringGrid->ColCount];
     for (int i=0; i<SaveStringGrid->ColCount; i++)
     GridColor[i] = new TColor[SaveStringGrid->RowCount];
     //設定顏色的初始值
     for (int i=0; i<SaveStringGrid->ColCount; i++)
     for (int k=0; k<SaveStringGrid->RowCount; k++)
     if (k==0) GridColor[i][k] = 0x00FFFF00;
     else        GridColor[i][k] = clWhite;
     SaveStringGrid->DefaultDrawing= false;
SaveStringGrid的OnDrawCell加入下列程式碼:
    SaveStringGrid->Canvas->Brush->Color = GridColor[ACol][ARow];
    SaveStringGrid->Canvas->FillRect(Rect);   
結果如下
此範例僅設定第一列成淺藍色, 可以延伸至設定每一個cell成不同顏色
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(3,184)

  • 個人分類:其他語言
▲top
  • 4月 19 週五 201305:59
  • Visual Studio 2005 如何從DLL輸出C++ Class

專案名稱:MyMathDLL
選擇DLL, 按下完成
MyMathDLL.cpp為專案的入口點, 內容為VC專案自動產生, 可以不用理他~
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(2,555)

  • 個人分類:Visual Studio
▲top
  • 4月 15 週一 201323:37
  • Visual Studio (1) 創建Dll Library專案 (2) 呼叫所創建的Dll Library

參考資料:   Walkthrough: Creating and Using a Dynamic Link Library (C++)
dll的使用時機及意義:
強調重複使用程式碼, 而不必每次重新造輪子,只需要撰寫一次, 之後把這些函式庫引入並參考它們。
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(7,806)

  • 個人分類:Visual Studio
▲top
  • 4月 12 週五 201321:22
  • Wiifit - Willyourself code study

#ifdef LOOK_FOR_ADDITIONAL_WIIMOTES
    // try to connect any additional wiimotes (just to show the code)
    _tprintf(_T("\n\n"));                                                              // [1]
    wiimote  *extra_motes [7] = { NULL }; // 7 should cover it  [2]
    unsigned detected          = 0;
    while(detected < 7)
        {
        wiimote *next = new wiimote;                                      // [3]
        if(!next->Connect(wiimote::FIRST_AVAILABLE))            // [4]
            break;
        extra_motes[detected++] = next;                                // [5]
        
        WHITE        ; _tprintf(_T("   also found wiimote "));       // [6]
        BRIGHT_GREEN; _tprintf(_T("%u"), detected+1);         // [7]
        if(next->IsBalanceBoard()) {                                       // [8]
            WHITE; _tprintf(_T("  (Balance Board)"));
            }
        _tprintf(_T("\n\n"));
# ifdef USE_BEEPS_AND_DELAYS
        Beep(1000 + (detected*100), 100);                             // [9]
        Sleep(500);
# endif
        }
    WHITE; _tprintf( ((detected == 7)? _T("     (can't detect any more).") :
                                       _T("    (no more found).")) );
# ifdef USE_BEEPS_AND_DELAYS
    Sleep(2000);
# endif
    // clean up
    for(unsigned index=0; index<detected; index++)
        delete extra_motes[index];
    
    SetConsoleCursorPosition(console, cursor_pos);
#endif // LOOK_FOR_ADDITIONAL_WIIMOTES
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(38)

  • 個人分類:工業應用
▲top
  • 4月 12 週五 201309:43
  • WiiYourself + WDK

1. 安裝WinDDK  Windows Driver Kit Version 7.1.0   
2. 安裝Balance Board C API   Wiiyourself1.15    
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(34)

  • 個人分類:工業應用
▲top
  • 4月 11 週四 201308:54
  • WIN32專案類型

#include <afxwin.h>
class MyApp : public CWinApp
{
    public:
        BOOL InitInstance()
        {
              CFrameWnd *Frame = new CFrameWnd(); 
              m_pMainWnd = Frame;                              //繼承CWinThread 類別的m_pMainWnd屬性
            
              Frame->Create(NULL, "Hello Win32");
              Frame->ShowWindow(SW_SHOW);
              return true;
        }
};
MyApp aApp;
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(92)

  • 個人分類:Visual Studio
▲top
  • 4月 09 週二 201322:40
  • MFC目前應用程式執行路徑

string ExePath() {
    char buffer[MAX_PATH];
    GetModuleFileName( NULL, buffer, MAX_PATH );
    string::size_type pos = string( buffer ).find_last_of( "\\/" );
    return string( buffer ).substr( 0, pos);
}
(繼續閱讀...)
文章標籤

me1237guy 發表在 痞客邦 留言(0) 人氣(118)

  • 個人分類:Visual Studio
▲top
«1...84858689»

個人資訊

me1237guy
暱稱:
me1237guy
分類:
數位生活
好友:
累積中
地區:

熱門文章

  • (1,143)MFC程式架構
  • (8,478)分水嶺影像分割Marker-based Image Segmentation Algorithm Using OpenCV2.4.7 with Visual Studio 2010
  • (441)Install e2v Line Scan CCD with Camera Link
  • (3,999)Pylon Live View C# Sample Code Review
  • (14,163)網路上提供測試 RTSP 的伺服器
  • (23,895)Adding Something to DataGridView
  • (4,358)安裝PLC學習軟體 FX-TRN-BEG-T
  • (3,658)安裝Open eVision 1.2.5.8549
  • (25,022)C# 如何創建, 暫停, 繼續, 終止一個執行緒(Thread)
  • (2,809)安裝ONVIF Device Manager

文章分類

  • wordpress (2)
  • 雲端計算 (1)
  • 邊緣運算 (5)
  • MPI (2)
  • Git & Github (6)
  • Unity (2)
  • Android Studio (10)
  • Deep Leraning (35)
  • LaTex (2)
  • Linux (6)
  • jetson nano (3)
  • Qt (20)
  • Docker (4)
  • Office (1)
  • OpenTK (1)
  • WPF (8)
  • SQL (4)
  • Revit (6)
  • MATLAB (13)
  • R Language (8)
  • Design Pattern & Implementation by Using C# (48)
  • RaspberryPI (5)
  • Python (77)
  • 其他語言 (40)
  • 攝影機 (45)
  • 工業應用 (50)
  • 家庭 (12)
  • Mobile (31)
  • 工作日誌 (2)
  • Linux (5)
  • C/C++ (15)
  • AOI (41)
  • Emgu CV (42)
  • C# (147)
  • Visual Studio (48)
  • OpenCV (118)
  • 未分類文章 (1)

最新文章

  • Gemini API Key 低成本 Nano Banana Pro作圖
  • DMK 37AUX226
  • wafer基礎術語
  • 將資料夾中多個mp4影片合併成一個mp4檔案
  • 如何用沙子制造芯片:从冶炼硅锭到晶圆打磨|芯片工艺合集
  • yolov9安裝
  • ActionEngine, ActionTask and ActionWorker
  • @dataclass裝飾子
  • IO控制卡安裝驅動器後無法在此裝置載入驅動程式
  • How you put and then get items from a queue.Queue

動態訂閱

文章精選

文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: