Hi Everyone,
First I have no extensive knowledge about image processing but I want to apply a process which will detect the background color of some item photos. Basically, I want to know if the item’s background is white or not.
Currently I apply masking to my images but I don’t know what should I do next, after the masking I want to learn dominant color out of the masking.
Can you please guide me, I am willing to learn more.
Hi @caceter,
The tutorial Workflow you linked creates a binary image, you can use the Connected Component Analysis node to create a labeling from that. A labeling is like a mask image that you can use for different operations, one of which is regionally restricted calculation of image measurements (features). Using the Image Segment Features node you can extract measurements for each region in the labeling, e.g. the mean pixel value per color channel. This would give you an approximation of the mean color in that region. If you can provide us with a sample picture from you data, I can help you further.
best,
Gabriel
Hi @caceter,
I am sorry for the delayed reply, but I was finally able to take a look at these images.
I created a simple workflow that applies the mask to the image and then extracts the median pixel value of the background in each channel. background-color.knwf (474.7 KB)
best,
Gabriel
I’d like to look at your solution but got an error on Gaussian Convolution:
ERROR Gaussian Convolution 2:11 Error in row image1-mask.jpeg: java.io.IOException: No externalizer available with id ImageMetadataExt3
ERROR Gaussian Convolution 2:11 Execute failed: java.lang.RuntimeException: java.io.IOException: No externalizer available with id ImageMetadataExt3
Oh sorry this workflow was created using a nightly version of KNIME Image Processing, you can just reset the Image reader nodes, and read the following two images:
Hi Gabriel,
Many thanks again, I don’t know how much time you spent on the workflow but huge respect
I didn’t understand one thing, Splitter Node splits image according to which rules ? Because output is for one image sometimes coming like this:
Row0#4
Row0#8
Row0#11
Row0#12
Which part is presenting the background? Or should I take mean of groups?
Just a few minutes, I have been working on and with Image Processing in KNIME for years .
The Splitter node splits the images as described in the node description:
Dimension selection
Select those dimensions here, which should stay together. I.e. for each selected subset, the non-selected dimensions will be split completely.
In this case this should mean the images are split into their color channels.
This looks like the joining of the different rows did not succeed correctly. The output of the metanode should look like the following for a single picture:
Take a look into the Metanode (just double click it). There you can investigate the contained join nodes to find out where it goes wrong.
best,
Gabriel
Ok this means that the Connected Component Analysis node finds more than one segment in your image,
you can either try filtering out these extra segments (if they are small) using the Segment Filter node, or improve the pre-processing of the masks, e.g. by increasing the sigma of the Gauss filter.