C++ Image Processing Dev C++
Jan 30, 2013 Low pass filters (blurring) in Image Processing using C. By Programming Techniques Published January 30, 2013 Updated January 30, 2019. Low pass filtering also called “blurring” & “smoothing” is very basic filtering operations in image processing. The simplest low-pass filter just calculates the average of a pixel. ImageMagick Magick API. Magick is the object-oriented C API to the ImageMagick image-processing library, the most comprehensive open-source image processing package available. Read the latest NEWS and ChangeLog for Magick. Magick supports an object model which is inspired by PerlMagick.Images support implicit reference counting so that copy constructors and assignment. CImg stands for Cool Image: It is easy to use, efficient and is intended to be a very pleasant toolbox to design image processing algorithms in C. Due to its generic conception, it can cover a wide range of image processing applications. The Digital Image Processing Library (dimple) is a C class/algorithm library for image processing. Dimple consists of a wide range of image processing routines which can be viewed as low- to mid- level vision tasks. Digital Image Processing Library in C download SourceForge.net.
基本はpythonで組んで,画像処理アルゴリズムだけC++で書きたい用のサンプルコード
Point
- ctypesを使う
- Windows/LinuxでC++ファイルの作り方,呼び方が異なる.
- numpy配列をポインタ型にしてC++関数に渡せるが,numpyの型指定必須.
- .cppの関数は,'extern 'C' __declspec(dllexport)'つけないとpythonから外部参照できない
- ctypesポインタに変換した配列をnumpy配列にする方法はとりあえず,xrangeにした.
- Image_processing.pyから実行

DLLの作り方Tips
Windows OS
- Download https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/rubenvb/gcc-4.8-release/
- 'x86_64-w64-mingw32-gcc-4.8.0-win64_rubenvb.7z'
- Build Dll for Windows 64bit System.
- Reference https://kakurasan.blogspot.jp/2015/07/debianubuntu-mingw-crosscompile.html
- Command
x86_64-w64-mingw32-g++ -c Image_processing.cpp
x86_64-w64-mingw32-g++ -shared -o Image_processing.dll Image_processing.o
Usps annapolis md 21401. Linux OS
- Build .so for linux System.
- Command
g++ -g -Wall -fPIC -o Image_processing.o -c Image_processing.cpp
g++ -shared Image_processing.o -o Image_processing.so

C Image Processing Dev C File
実行結果
C++ Image Processing Tutorial
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]