spatial filter help

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

spatial filter help

fulano
Hello!

I'm new using Imagej. I want to measure the points in the surface of water waves with a video (it's a two dimensional fluid, the water has dye so I can observe only the surface), but my final video (after filtering and make binary) has a lot of noise under the surface, so i need a filter that takes every x coordinate and eliminate all the activated pixels in the y coordinate that are under the surface (I managed to completly eliminate the noise over the surface, so the maximun activated value of y its the corresponded to surface) for each frame.

It's there an Imagej funtion that do that?  It's posible to program a macro for that?. I already made a filter in matlab but is increidbly slow, and i want to implementate others imagej filters after this.

Sorry for my bad english, thanks in advance.

In the image a semifiltered frame of the vids.


Reply | Threaded
Open this post in threaded view
|

Re: spatial filter help

Michael Schmid
H Fulano,

if your upper contour (the surface) is contiguous (no holes in it) you
could use the Wand Tool on the area above it, then Edit>Selection>Make
Inverse to select the water and clear (or Process>Math>Set) everything
below.

In your sample image, the 'surface' contour has quite a few gaps (also
rather large ones, so methods like binary close won't close the gaps.
I guess that you would need either better preprocessing or segmentation.
you could try trainable Weka Segmentation [1] in ImageJ2/Fiji or
(simpler, but less likely to work) the Versatile Wand plugin with
gradient detection [2].
Alternatively, if possible, have better illumination; e.g. if you record
the waves at the front side of an aquarium-like tank, you could have a
light source illuminating only the water from behind and maybe a wall
from frosted glass (then, total reflection will make sure that only the
water appears bright).

Concerning your original question:
I am not aware of such a plugin or macro. If you write one, I would
recommend a plugin (Java) or Javascript (the latter only if you have
Java 1.8). Otherwise it will be rather slow, because the code will be
interpreted, not compiled, and processing a video might take ages.


Michael

[1] http://imagej.net/Trainable_Weka_Segmentation
[2]
http://imagejdocu.tudor.lu/doku.php?id=plugin:segmentation:versatile_wand:start
________________________________________________________________
On 21/04/2017 17:58, fulano wrote:

> Hello!
>
> I'm new using Imagej. I want to measure the points in the surface of water
> waves with a video (it's a two dimensional fluid, the water has dye so I can
> observe only the surface), but my final video (after filtering and make
> binary) has a lot of noise under the surface, so i need a filter that takes
> every x coordinate and eliminate all the activated pixels in the y
> coordinate that are under the surface (I managed to completly eliminate the
> noise over the surface, so the maximun activated value of y its the
> corresponded to surface) for each frame.
>
> It's there an Imagej funtion that do that?  It's posible to program a macro
> for that?. I already made a filter in matlab but is increidbly slow, and i
> want to implementate others imagej filters after this.
>
> Sorry for my bad english, thanks in advance.
>
> In the image a semifiltered frame of the vids.
>
> <http://imagej.1557.x6.nabble.com/file/n5018585/dupi.png>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: spatial filter help

fulano
Wow, thanks for the help! I didn't spect such very detail response. I'm gonna try all the things, and try to report my results on this thread.

Respect to the record, is indeed from the side of a transparent open channel (a big acuarium), and the water is illuminated by a laser. The dye that I mention before is fluorescent to that laser, and the surface shines, but from the side  the water also shines due to the penetration of laser. The camera record the two efects, and is this the cause of the noise.  This is a standart method in fluid mechanics, but i'm no very skilled in that.

Thanks and sorry for my bad english.

Attached, a frame without processing


Reply | Threaded
Open this post in threaded view
|

Re: spatial filter help

fulano
In reply to this post by Michael Schmid
Problem solved!

I made a plugin using maven in java. I'm not an expert programing, but i think this do a pretty decent job. It procceses an stack of 1800 frames in aprox 4secs (in contrast to 8 hrs in matlab). I want to share the plugin with the comunity, but i'm very new and don't know how is the process, so I put it atached in this reply.

before


after


Fluid_Filter-0.jar
Reply | Threaded
Open this post in threaded view
|

Re: spatial filter help

ctrueden
Hi,

> I made a plugin using maven in java.

I see that you based it on the example-legacy-plugin [1]. That's great, but
please note that there are several things in the pom.xml you should go
through and replace, such as the <developers> list, groupId, etc.

> I want to share the plugin with the comunity, but i'm very new and
> don't know how is the process

Your options are described here:
    https://imagej.net/Distribution

Let us know if you have any questions about it!

Regards,
Curtis

[1] https://github.com/imagej/example-legacy-plugin


--
Curtis Rueden
LOCI software architect - https://loci.wisc.edu/software
ImageJ2 lead, Fiji maintainer - https://imagej.net/User:Rueden
Did you know ImageJ has a forum? http://forum.imagej.net/


On Mon, May 1, 2017 at 6:18 PM, fulano <[hidden email]> wrote:

> Problem solved!
>
> I made a plugin using maven in java. I'm not an expert programing, but i
> think this do a pretty decent job. It procceses an stack of 1800 frames in
> aprox 4secs (in contrast to 8 hrs in matlab). I want to share the plugin
> with the comunity, but i'm very new and don't know how is the process, so I
> put it atached in this reply.
>
> before
> <http://imagej.1557.x6.nabble.com/file/n5018650/Pre.png>
>
> after
> <http://imagej.1557.x6.nabble.com/file/n5018650/Post.png>
>
> Fluid_Filter-0.jar
> <http://imagej.1557.x6.nabble.com/file/n5018650/Fluid_Filter-0.jar>
>
>
>
> --
> View this message in context: http://imagej.1557.x6.nabble.
> com/spatial-filter-help-tp5018585p5018650.html
> Sent from the ImageJ mailing list archive at Nabble.com.
>
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html