Applying cluster nodes on images

Hi,

to process images with KNIME, I installed the imaging extension. I want to cluster the image using the node "Fuzzy c-Means". This node need a datatable as input. How I convert an image to a datatable? Is it possible to cluster images in KNIME?

Thanks for advice.

Best regards,

Oliver

Hi Oliver,

the clustering algorithms in KNIME assume, that the data comes in as a table, this means in each row there is one object of the set of all objects which you want to cluster.

In the cases of images you have several choices but the two most common ones are: Cluster based on "Intensity" or based on "Color".  Color means, that you take the R,G,B intensity values as a vector used for clustering.

You can transform images, cluster them, and finally transform them back to images. In the attached example workflow you find three different ways to cluster your images. Please note: if you want to process more than one image, use the "Chunk Loop Start" and "Loop End"  nodes to split of the set of image in single row tables.

Anyway, if you want to discuss the analysis of your images, we are happy to help. Maybe we have more straight-forward ways (dedicated image processing nodes) which might do the job, too. So if you wish, feel free to ask us.

I hope this helps,

Christian

Hi Christian,

thanks for your response and the example workflows.

I applied the Fuzzy c-Means of your example image "Lena.png" and my own image (a tooth) as described. The output "Cluster Memberships" of the node "Fuzzy c-Means" shows the belonging of each object to a cluster. I think, that is the expected result?! Unfortunately at both images, I got only grey images as result after grouping and converting the data row to image. You find the workflow, output of Fuzzy c-Means and the result image n the attachment.

Is anything wrong? Should I anything consider after clustering or converting to image?

Thanks.

Best regards,

Oliver

Hi Oliver,

the image is saved unormalized as floating point image. So the values are only between 0 and 1, but the rendering tries to render the image with full Float.Min/Max. If you want to take a look at the image you have three options:

a.) Use "Image Normalizer" to normalize the image persistenly. Then you can right-click and have a look at the table cell view.

b.) Convert the image to another image format (e.g. ByteType or ShortType). Use the option: "Normalize and Scale".

c.) Just use the node "Table Cell View", open its view, click on the image and select "normalize". Then you can see a normalized version of the image.

 

I hope this helps,

Christian

 

Hi Christian,

thanks for your response. I applied the Fuzzy c-Means-Algorithmus on my tooth images. For the first image, I got an accept result. But for the second one, I got a noisy image as result. You will see the original and clustered images in the attachment. I suppose, the noise in the second result is because of the small contrast. Do you also think so? Is it possible to apply the Fuzzy c-Means as texture-based clustering instead of color-based clustering?

Thanks.

Best regards,

Oliver

Hi Christian,

I apply the Data Row to Image-node in the right manner, now. The noisy image was because of wrong dimensions of the node. What a shame :-$ . Now, I get an image for further processing. Thanks.

Best Regards,

Oliver

Hi Oliver,

sorry for the late reply, I was on vacation. Nice to hear, that you figured out how to solve the problem.

Anyway, I think what you are doing or trying to do is something like a pixel-wise classfication and then identification of pixels which share certain features (texture, intensity, color etc).

Have you seen our SUISE Plugin?

http://tech.knime.org/supervised-image-segmentation

This might be very well suited to your problem I think. You find an example workflow on the posted link. If you need any assistance using the plugin, I would be happy help.

Cheers,

Christian

 

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.