Search

顯示具有 CPP 標籤的文章。 顯示所有文章
顯示具有 CPP 標籤的文章。 顯示所有文章

2019年11月25日 星期一

ESP32-CAM MJPEG Stream Decoder and Control Library


  半年前在做自己的Computer Vision Board採買材料時,無意間知道ESP32-CAM這東西,買來放一段時間後,上週末有空拿出來測試這東西挺讓我驚艷,相見恨晚,主要是150NTD的價格加上已經有現成的Arduino相容範例,直接搞定SCCB設定跟DCMI Data還有一個4M PSRAM作為Frame Buffer,收到的MJPEG Stream在 UXGA 1600x1200解析度可以約10FPS每個JPEG 100Kb左右。
  就整體來說這東西在Wi-Fi環境感覺上非常具有淺力,一些多Camera Computer Vision的應用可以配合Raspberry Pi運算,或者簡單的Robot需要Computer Vision然後輔以別的控制器以UART通訊控制(GPIO扣掉SCCB+DCMI和SDIO只剩UART...)都是不錯的選擇。
  我把wxRovio的軟體改一改後主要是抽出C/C++ MJPEG Stream decode,還有示範POST參數給ESP32-CAM修改解析度,基本上相依OpenCV和libcurl,在Github有用OpenCV GUI和wxWidgets GUI的範例,後者順便放YOLO V3和OpenPose的DNN應用,Library在MAC和Win10+VS2017編譯x64版本都可以通過。




2019年9月29日 星期日

wxECGAnalyzer - cross platform ECG signal process tool

Detection of abnormal rhythm morphologies is more difficult than normal beat, therefore, we need to collect abnormal rhythm signals in clinical practice  to improve the detection of QRS-complex.

This project is for Electrocardiogram(ECG) signal algorithms design and validation, include preprocessing, QRS-Complex detection, embedded system validation, ECG segmentation, label your machine learning dataset, and clinical trial...etc.

For algorithm performance, in ANSI/AAMI EC38,it is required that the detected QRS shall in the 150ms range of the signed point from annotation by human exper.

目前僅用MIT-BIH等標準心律不整資料庫或是生理訊號挑戰賽提供的標註資料,理論上很難得到超越其標注的學習模型,實務上還是需要配合其他臨床實驗搜集更多案例強化模型,下個To-Do會用標準資料庫訓練分類模型增加基本的自動化標註,目前僅針對臨床實時運行的特殊案例配合人工選擇QRS-Complex演算法自動切片。






2019年7月21日 星期日

Cross-Platform Serial Port Library

This is cross-platform(build passing High-Sierra and Win10) serial port library written in C++ , and for demo application wxTerm.


SerialPortLibrary in more detail : Github 

2011年9月29日 星期四

有別於C++ Templates - The Complete Guide上的靜態多型



#include <iostream>

template<typename T>
class Base
{
   public:
      void Print();
      void Try(){
T *obj = static_cast<T*>(this);
obj->Print();
      }
};

class D1:public Base<D1>
{
   public:
      void Print(){std::cout << "D1" << std::endl;}
};

class D2:public Base<D2>
{
   public:
      void Print(){std::cout << "D2" << std::endl;}
};

int main(int argc,char**argv)
{
   D1 d1;
   D2 d2;

   d1.Try();
   d2.Try();

   return 0;
}


跟C++ Templates - The Complete Guide第十四章的靜態多型一樣,都是依靠傳入的template argument型別來決定,然後今天早上看到這篇才又想起來,基本上優缺點跟十四章的靜態多型一樣,不過寫成Class Template繼承體系又多了可以把實作跟介面分開的優點,書上是做Function Template。

2011年5月16日 星期一

stringizing and merging operator

既然說要紀錄了,那就順便把以前學MFC時兩組關聯執行時期型別鑑定(RTTI)的巨集,DECLARE_DYNAMIC、IMPLEMENT_DYNAMIC中看到的#和##運算子的使用說明一下,至於上面兩組巨集的實現可參考「深入淺出MFC」或是「Windows程式設計」(王豔平編著)有簡潔的說明。

#(stringizing)是"字串化"運算子,只能用在帶有參數的巨集,可以直接看範例比較快。

範例:


#include ‹cstdio›

#define str(x) printf(#x)

int main(int argc,char**argv)
{
    str(stringizing\n);

    return 0;
}





##(merging)是"合併"運算子,一樣直接看範例比較快。


範例:



#include ‹cstdio›

#define mer(s,n) printf(#s,val##n)
const int val1 = 7;

int main(int argc,char**argv)
{
    mer(%d\n,1);

    return 0;
}