Image Segmentation of ... Roots

Tags: #<Tag:0x00007fb881c247f0> #<Tag:0x00007fb881c245e8> #<Tag:0x00007fb881c24430>


Hi guys, I’m trying to analyze a plug of roots and soil. I’d like to measure root development or root coverage on the plug.

The problem is that my plug have shiny dirt that can easily be taken for root.

Steps of what I tried :

  • 8 bits
  • Median filter (2.0)
  • Subtract background
  • Otsu automatic thresholding
  • Watershed (because analyze particles was not fully working without oddly)
  • Analyze Particles (Without the small particles)

Result :

I think I have some “not so bad” results for the amount of tinkering I did but is there a more elegant manner to do it ? Any idea of what I should do for some more “professional” results ?

How would you get the perimeter of the plug ?

Thank you in advance,

J. Ben


It’s me again, I went with another approach reading the forum : Weka.

It worked quite well and I was able to get an idea of the roots coverage.


However, as I’m trying to write a script.js I can’t use Weka :frowning:
I used what I found here :


var imp = IJ.openImage("/home/jbenetti/Documents/");
var weka = WekaSegmentation(imp);
var classifierFile = "/home/jbenetti/Documents/";
var result = weka.getClassifiedImage();;

I have this issue :

Scripts/Script_.js:19 TypeError: [JavaClass trainableSegmentation.WekaSegmentation] is not a function

What do I do wrong ?

Thank you in advance,

J. Ben


In Javascript, you need the new keyword to initialize an object:

var weka = new WekaSegmentation(imp);

I realize that this was missing in my post in the topic you linked (possibly due to copy-pasting from python). But if you read that topic to the end, @iarganda actually replied with a working version of the code:

Hope that helps.


Hi thanks for the answer.

I tried both of them (with and without new) and I had another error so I thought I was wrong.

I switched to Python in the meantime and it is correctly working.


J. Ben