Skip to content

Sample code for basically using python and writing only image processing algorithm in C ++

Notifications You must be signed in to change notification settings

flow-dev/ctypes_for_Image_processing

Repository files navigation

ctypes_for_Image_processing

基本はpythonで組んで,画像処理アルゴリズムだけC++で書きたい用のサンプルコード

Point

  • ctypesを使う
  • Windows/LinuxでC++ファイルの作り方,呼び方が異なる.
  • numpy配列をポインタ型にしてC++関数に渡せるが,numpyの型指定必須.
  • .cppの関数は,"extern "C" __declspec(dllexport)"つけないとpythonから外部参照できない
  • Image_processing.pyから実行

DLLの作り方Tips

実行結果

python .\Image_processing.py (array([10, 20, 30], dtype=uint8), array([40, 50, 60], dtype=uint8), array([10, 20, 30, 40, 50, 60, 70, 80, 90], dtype=uint8), array([0, 0, 0, 0, 0, 0, 0, 0, 0], dtype=uint8)) (<main.LP_c_ubyte object at 0x000000000210FBC8>, <main.LP_c_ubyte object at 0x0000000002A12A48>, <main.LP_c_ubyte object at 0x0000000002AB0AC8>, <main.LP_c_ubyte object at 0x0000000002B548C8>) 210 [11 21 31 41 51 61 71 81 91]

About

Sample code for basically using python and writing only image processing algorithm in C ++

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published