Cut ROI of slightly moving pictures

Hi Everyone

I am new to Knime but would like to learn more about it. I have to Analyse a series of pictures and quantify the black dots on them (see attached pictures). I worked myself into Knime and I can do that task now. The problem is that there is a label field at the bottom of each field which interfers with the counting. I managed to get rid of most by filtering but there is still an overlap.

Ideally I would like to crop the image to the ROI and then process them with my workflow. I tried some tutorials but unfortunately failed so far. 

Maybe someone has an idea how to easily realize that or can point me to a good tutorial / example workflow for this?

Also I am failing to find the Tess4j node. I would love to trying to read out the labels on the pictures as quality control. Do I need to install a special version for this?

Thanks

Berni

Hi Berni,

I will look into creating a workflow that does the cropping for you during the next few days. I can answer your second question right away though:

The Tess4j node needs to be installed via the Trusted Comunity Contributions update site, you can find a tutorial on how to install that update site here: https://tech.knime.org/wiki/install-knime-image-processing under Step 2.2

best,

Gabriel

Hi Gabriel

Thanks a lot for looking into this. I am looking forward to your solution. 

I also found alread the Tess4j node and wonloaded it. Thanks a lot for the advice. I now can start playing with it.

Thanks 

Berni

Hi Berni,

We created a workflow that does a pretty good job at cropping to the desired ROI, I attached it to this post.

best,

Gabriel 

Hi Gabriel

Thanks a lot for looking into this. It already works pretty well but it seems that in some cases the node starts blackening the ROI. I think it might have to if the ROI is touching the side of the picture. I attached an example output.

I tried to look into it myself but that is beyond my skill level as a simple beginner user.

Thanks a lot

Berni

I am glad to hear the workflow works in the general case, if you can upload such a picture that is causing you the trouble we can try adapting the workflow to it.

best,

Gabriel

No problem. Here is one (S02). You can see that it is a tiny bit cut at the right side. I think this is what causes the filling.

I also noticed that if the scanned area has a lot of white background the picture gets cut into two pieces one with the ROI and one only white (example S04). This would not be a pressing issue as I can easily filter that later in the workflow but if its easy to fix it would be great if you could look into that as well.

Thanks a lot

Berni 

Hi Berni,

I  set the Background setting in the Segment Cropper node  from Min Value of Result to Source and I no longer have problems with images that touch the border.

To filter the accidentally I used the assumption that the secondary images is smaller than the desired one, if this holds the filtering is very easy.

I attached the updated workflow.

best,

Gabriel

Hi Gabriel

Thanks a lot. I tested it on some pictures and this workflow works like a charm!

I have one more "stupid" question. You mentioned that you changed the background setting. in the segment cropper. In my setup I just see 3 nodes Image reader, crop roi and view. If I right click on the crop ROI I can't adjust much (I attached screenshot). 

Is there somewhere a hidden layer underneath it? or is that in the coding of the node. How do I get there to try different settings? For me it is black box at the moment but I would love to play with the parameters to understand a bit better how it works and as I want to see if I also can tackle one more complicated task with it.

Thanks a lot

Berni

 

No worries, that is not a dumb question there is indeed a "hidden layer underneath",  Crop Roi is a Wrapped Metanode which is a way you can pack up parts of the workflow into one package that also offers configuration.

You can look inside by either holding down the CTRL key while clicking on such a meta node, or rightclicking it and selecting Wrapped Metanode -> Open.

best,

Gabriel