The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
Basic Image Clustering by Color
Hello everyone,
I'm pretty new to Rapidminer and Data Mining in general and wanted to try to cluster a collection of color images by color. After some time experimenting with rapidminer I managed to create a somewhat correct looking process, but I still get unidentified errors.
Below is the xml of my process.Note that this process is atm just clustering by general image features, not color in particular. Basically what I tried is loading images from multiple sources using the MCIO operator. As a subprocess of this, I use local feature extraction with POIs generated from an integral image source.
The resulting exampleset is then used for clustering by SVM.
Where did I go wrong with this process? Would you mind pointing out my mistakes and propose a possible solution?
I'm pretty new to Rapidminer and Data Mining in general and wanted to try to cluster a collection of color images by color. After some time experimenting with rapidminer I managed to create a somewhat correct looking process, but I still get unidentified errors.
Below is the xml of my process.Note that this process is atm just clustering by general image features, not color in particular. Basically what I tried is loading images from multiple sources using the MCIO operator. As a subprocess of this, I use local feature extraction with POIs generated from an integral image source.
The resulting exampleset is then used for clustering by SVM.
Where did I go wrong with this process? Would you mind pointing out my mistakes and propose a possible solution?
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="5.3.013">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="5.3.013" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="imageprocessing:multiple_color_image_opener" compatibility="1.4.001" expanded="true" height="60" name="MCIO" width="90" x="45" y="30">
<list key="images">
<parameter key="birne" value="C:\Users\nick\Pictures\fruitveggiecollection\JPG\AbateFetelPear"/>
<parameter key="acorn" value="C:\Users\nick\Pictures\fruitveggiecollection\JPG\Acorn"/>
<parameter key="almond" value="C:\Users\nick\Pictures\fruitveggiecollection\JPG\Almond"/>
</list>
<parameter key="assign_label" value="true"/>
<process expanded="true">
<operator activated="true" class="multiply" compatibility="5.3.013" expanded="true" height="94" name="Multiply" width="90" x="45" y="30"/>
<operator activated="true" class="imageprocessing:color_to_grayscale" compatibility="1.4.001" expanded="true" height="60" name="Color to grayscale (3)" width="90" x="179" y="120"/>
<operator activated="true" class="imageprocessing:integral_image" compatibility="1.4.001" expanded="true" height="60" name="Integral Image" width="90" x="313" y="120"/>
<operator activated="true" class="imageprocessing:interest_poin_detector" compatibility="1.4.001" expanded="true" height="60" name="interest_poin_detector" width="90" x="447" y="120">
<parameter key="point_count" value="800"/>
</operator>
<operator activated="true" class="imageprocessing:feature_extraction_operator2" compatibility="1.4.001" expanded="true" height="94" name="Local Feature Extractor with Points" width="90" x="581" y="30">
<process expanded="true">
<operator activated="true" class="imageprocessing:color_to_grayscale" compatibility="1.4.001" expanded="true" height="60" name="Color to grayscale (4)" width="90" x="45" y="30"/>
<operator activated="true" class="imageprocessing:contrast_of_gray_level_values" compatibility="1.4.001" expanded="true" height="60" name="contrast_of_gray_level_values" width="90" x="179" y="30"/>
<connect from_port="image 1" to_op="Color to grayscale (4)" to_port="color image plus"/>
<connect from_op="Color to grayscale (4)" from_port="grayscale image" to_op="contrast_of_gray_level_values" to_port="grayscale image plus"/>
<connect from_op="contrast_of_gray_level_values" from_port="feature" to_port="feature 1"/>
<portSpacing port="source_image 1" spacing="0"/>
<portSpacing port="source_image 2" spacing="0"/>
<portSpacing port="sink_feature 1" spacing="0"/>
<portSpacing port="sink_feature 2" spacing="0"/>
</process>
</operator>
<connect from_port="color image plus" to_op="Multiply" to_port="input"/>
<connect from_op="Multiply" from_port="output 1" to_op="Local Feature Extractor with Points" to_port="color image plus"/>
<connect from_op="Multiply" from_port="output 2" to_op="Color to grayscale (3)" to_port="color image plus"/>
<connect from_op="Color to grayscale (3)" from_port="grayscale image" to_op="Integral Image" to_port="grayscale image plus"/>
<connect from_op="Integral Image" from_port="integral image" to_op="interest_poin_detector" to_port="Integral Image"/>
<connect from_op="interest_poin_detector" from_port="Points" to_op="Local Feature Extractor with Points" to_port="points"/>
<connect from_op="Local Feature Extractor with Points" from_port="example set" to_port="Example set"/>
<portSpacing port="source_color image plus" spacing="0"/>
<portSpacing port="sink_Example set" spacing="0"/>
</process>
</operator>
<operator activated="true" class="support_vector_clustering" compatibility="5.3.013" expanded="true" height="76" name="Clustering (2)" width="90" x="246" y="30"/>
<connect from_op="MCIO" from_port="example set" to_op="Clustering (2)" to_port="example set"/>
<connect from_op="Clustering (2)" from_port="cluster model" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
if you want to cluster images by color, it is maybe better to use global image features. If you want to use your process, what error appears?
Best,
Vaclav
when running my process I get a promt basically saying 'no obvious error encountered but something went wrong' . To have a better look at it I activated debug mode and got a 3744 error that shows that a Array Out of Bounds exception happened.
I'll use global features as suggested and come back here with my progres
Taking a closer look at the attributes of different images in this one cluster, I can see that the attribute distribution is pretty dense which explains why there is only one cluster.
Does anyone have an idea how I can fix this? Is it possible to automatically crop the images viewed by the process to the center of the image?
maybe you can use segmentation, select segments which are not background, merge them and then use Crop Image By Mask Operator.
Best,
Vaclav
Also, what do I do with the segments I recieve? Would you mind elaborating what you mean by 'select segments which are not background' ?
you can use this process: Unfortunately it works only for gray scale images. But you can use the Evaluation version from http://www.burgsys.com/mumi-image-mining.php#tabs-1. It is free for non commercial use.
Best,
Vaclav
Also, I downloaded the evaluation version which is a really great addition. My problem atm is, that I need an exampleset for the clustering process Here I use the feature extraction operators in the evaluation version which use the 'ima' input. I was forced to use 'read image set' because the rest of the data import operators for images do not return the necessary formats
if you want to read multiple images from multiple folders, you have to use process similar to this one: Best,
Vaclav