ImageJ调用OpenCV

这篇博客主要介绍ImageJ插件开发,调用我们熟悉的OpenCV来进行图像处理。本博客是对官方调用OpenCV的教程 的细节补充。

参考链接

ImageJ/openv官网: https://imagej.net/software/opencv

ImageJ opencv封装的开源仓库:https://github.com/joheras/IJ-OpenCV

ImageJ 官方调用opencv教程:官方调用OpenCV的教程

安装ImageJ OpenCV

官网推荐几种安装方式

help->update->IJ-OpenCV

OpenCV Mat和 ImageJ Image格式转换

#@ ImagePlus ImP
from ijopencv.ij      import ImagePlusMatConverter
from ijopencv.opencv  import MatImagePlusConverter
from ij               import ImagePlus

# Convert ImagePlus (actually the contained ImageProcessor) to Matrix object
imp2mat = ImagePlusMatConverter()
ImMat = imp2mat.toMat(imp.getProcessor())
print ImMat

# Convert Matrix object to ImageProcessor
mat2ip = MatImagePlusConverter()
NewIP  = mat2ip.toImageProcessor(ImMat)
NewImp = ImagePlus("Matrix converted back to ImagePlus", NewIP)
print NewImP

发表评论