I am working on a project which consist of a procedure of "reading diagram by computer" I will need to do image segmentation in order to identify the shapes and their locations in the image input. My professor said that I can use any public image segmentation library to do it. Is there any good image segmentation library which can serve this purpose?
thanks a lot
In JAVA for example these tools provide many algorithms for image segmentation:
ImageJ
http://rsbweb.nih.gov/ij/
Fiji
http://fiji.sc/wiki/index.php/Fiji
Rapidminer IMMI
http://www.burgsys.com/image-mining
Marvin Framework
http://marvinproject.sourceforge.net/
COMPLEMENT
Even being generic, I think it is possible to answer this question in some sense. Since this question is closed, I gonna complement @radim-burget answer for those people that get here looking for a simple example of image segmentation in Java.
Image Segmentation is an image processing task and is handled by most image processing frameworks. In the example below I'm using Marvin Framework.
Algorithm to segment diagram elements:
Input:

After Erosion:

Result:

Source Code:
import static marvin.MarvinPluginCollection.*;
public class SegmentDiagram {
public SegmentDiagram(){
MarvinImage originalImage = MarvinImageIO.loadImage("./res/diagram.png");
MarvinImage image = originalImage.clone();
MarvinImage binImage = MarvinColorModelConverter.rgbToBinary(image, 250);
morphologicalErosion(binImage.clone(), binImage, MarvinMath.getTrueMatrix(5, 5));
image = MarvinColorModelConverter.binaryToRgb(binImage);
MarvinSegment[] segments = floodfillSegmentation(image);
for(int i=1; i<segments.length; i++){
MarvinSegment seg = segments[i];
originalImage.drawRect(seg.x1, seg.y1, seg.width, seg.height, Color.red);
originalImage.drawRect(seg.x1+1, seg.y1+1, seg.width, seg.height, Color.red);
}
MarvinImageIO.saveImage(originalImage, "./res/diagram_segmented.png");
}
public static void main(String[] args) {
new SegmentDiagram();
}
}
The shape recognition is another topic, already discussed on Stack Overflow:
2D Shape recognition algorithm - looking for guidance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With