IJ-OpenCV is a Java library that allows the communication of ImageJ - a software for image analysis that is widely employed in life sciences - and OpenCV - a well-known computer vision library.
There are several benefits provided by the communication of ImageJ and OpenCV. From the ImageJ perspective, this tool is enhanced with several computer vision and machine learning algorithms, avoiding the re-implementation of methods and the connection with several external libraries. From the OpenCV point of view, this library is improved with a simple-to-use GUI and with the functionality to manage regions of interest.
This new version of IJ-OpenCV has been built on top of SciJava Common using SciJava converters.
IJ-OpenCV is free to use and licensed under the license GNU GPL 3.0.
You can download and install the IJ-OpenCV library using maven; namely, including the following dependency in your pom.xml file:
<dependency>
<groupId>io.github.joheras</groupId>
<artifactId>IJ-OpenCV</artifactId>
<version>1.0</version>
</dependency>
The ImageJ plugins that have been developed using this library can be downloaded using the ImageJ Update site.
You can download several images to test the plugins at the following link. In order to execute the FaceDetection plugin it is necessary to download the following file and copy it to the plugins folder of ImageJ.
The recommended installation procedure to include IJ-OpenCV in your project is the use of maven, but you can also directly download the IJ-OpenCV 1.0 binary archive IJ-OpenCV-1.0.jar. You will also need to install the binary files of JavaCV.
IJ-OpenCV requires that ImageJ works with Java 8.
The source files of the IJ-OpenCV library are available at the following link.
The source code of the following plugins can be found in the examples folder.
- Adaptive threshold: Given an image, it applies either the adaptive Gaussian threshold or the adaptive mean threshold. OpenCV link to the topic.
- BGR histogram comparison: Given a stack of images, it compares the images using the BGR histogram and employing different measures . OpenCV link to the topic.
- Black hat: Given a grayscale image, it returns such an image after applying the black hat morphological operation. OpenCV link to the topic.
- Canny edge detection: Given an image, it detects its using the Canny edge detection algorithm. OpenCV link to the topic.
- Convex hull from polygon: Given a polygonal selection, it returns its convex hull . OpenCV link to the topic.
- Detect circles: Given an image, it detects the circles of such an image using the Hough Circle transform. OpenCV link to the topic.
- Face detection: Given an image, it detects the faces of the image. OpenCV link to the topic.
- Find contours: Given an image, it detects the contours of the objects of such an image. OpenCV link to the topic.
- High dynamic range imaging: Given a stack of images, it creates a high dynamic range image using the exposure fusion. OpenCV link to the topic.
- Hough Lines: Given an image, it computes the lines of the image using the Hough transform. OpenCV link to the topic.
- HSV histogram comparison: Given a stack of images, it compares the images using the HSV histogram and employing different measures . OpenCV link to the topic.
- Keypoint detector: Given an image, it detects its keypoints using different algorithms. OpenCV link to the topic.
- Kmeans clustering: Given a stack of images, it groups them using the BGR histogram as features and the Kmeans clustering algorithm. OpenCV link to the topic.
- Non local means denoising: Given an image, it applies non local means denoising. OpenCV link to the topic.
- RotatedRect from a polygon ROI: Given a polygonal selection, it returns the associated rotated rectangle. OpenCV link to the topic.
- Stitching: Given an array of images, it stitches them creating a panoramic view. OpenCV link to the topic.
- Template Matching: Given an image, and a selection (template) in that image, it finds all the other regions of the image that match with the template. OpenCV link to the topic.
- White Hat: Given a grayscale image, it returns such an image after applying the white hat morphological operation. OpenCV link to the topic.
We include several videos showing how the plugins developed with the IJ-OpenCV library work.
This first video shows how the "adaptive thresholding", "BGR Histogram Comparison" and "HSV Histogram comparison" plugins work.
This second video shows how the following plugins work:
- BlackHat and White Hat morphological operators
- Canny edge detection
- Convex hull from polygon ROI
- Circle detection
- Measure oxidation
- Face detection
- Find Contours
- High Dynamic Range Imaging
Jónathan Heras ([email protected])