I am working on a task where I need to find and label connected components in an image. I am using Python script (1=>1) node and I wanted to convert output (column type: Image) to Labeling type. Could you please advise if I have done this correctly because I am having issue where only one from two images I loaded using Image reader node is successfully converted to labeling type.
Here is my workflow: Python_ConnectedComponentsLabeling.knwf (58.4 KB)
Thank you in advance
Welcome to the KNIME Forum! The GroupBy node aggregates all rows into one, this is not what you want. I think you need the Image to Labeling node.
Thank you very much for your reply @AlexanderFillbrunn
I wasn’t sure about that node because it basically does what I wrote in python script (assigns label/color), right? So it didn’t make sense for me to use that node. But if there are no other options I will use Image to labeling node.
Your Python script returns another image, while the Image to Labeling node produces a Segmentation. You can see the difference in the icon in the column header, where it says IMG for images and SEG for segmentations.
Just to add a little more detail: The Image to Labeling node takes a “regular” input image and assigns all pixels with the same pixel value to the same segment and assigns the pixel value as label to each segment. Hence, it can wrap “labeling” images from as generated by other tools, like Python, into Labeling Images (as denoted by the different icon in the column header).
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.