writing a plugin that takes the first frame of an avi and saves it as jpeg

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

writing a plugin that takes the first frame of an avi and saves it as jpeg

John Soong
I'm writing a novice plugin for counting fruit flies, but the ImageJ
recorder's  for loading an avi file and saving the first frame as JPEG

IJ.run("AVI...", "select=["+aviFile+"] first=1 last=1 use convert");
IJ.saveAs(imp, "Jpeg", savePath+experimentName+"\\Vial "+vi+"\\Interval
"+ii+".jpg");

doesn't work because it makes reference to the ImagePlus imp, which is
undefined in my plugin.

So I looked at the code of AVI_Reader (
http://rsbweb.nih.gov/ij/plugins/download/AVI_Reader.java) and tried to use
their public  method makeStack(), which opens a given avi with arguments
and returns a stack,  however I get the error "Cannot make a static
reference to the non-static method makeStack(String, int, int, boolean,
boolean, boolean) from the type AVI_Reader" from my compiler. Are there any
static methods I can work with that reads AVI files ?

--
John Riemann Soong Lüwen
Biochem, Physics UVA '12

"Every difference of opinion is not a difference of principle. We have
called by different names brethren of the same principle. We are all
Republicans, we are all Federalists." -- Thomas Jefferson

We want stuctures that serve people, not people serving structures.
(l'Odéon, mai '68)
Reply | Threaded
Open this post in threaded view
|

Re: writing a plugin that takes the first frame of an avi and saves it as jpeg

John Soong
Thanks guys, I think I figured it out. Now I just have an issue with the
plugin calling gnu.io.* from RXTX and not compiling or running properly
(see previous email).

>
>
> 2012/4/8 John Soong <[hidden email]>
>
>> I'm writing a novice plugin for counting fruit flies, but the ImageJ
>> recorder's  for loading an avi file and saving the first frame as JPEG
>>
>> IJ.run("AVI...", "select=["+aviFile+"] first=1 last=1 use convert");
>> IJ.saveAs(imp, "Jpeg", savePath+experimentName+"\\Vial "+vi+"\\Interval
>> "+ii+".jpg");
>>
>> doesn't work because it makes reference to the ImagePlus imp, which is
>> undefined in my plugin.
>>
>> So I looked at the code of AVI_Reader (
>> http://rsbweb.nih.gov/ij/plugins/download/AVI_Reader.java) and tried to
>> use their public  method makeStack(), which opens a given avi with
>> arguments and returns a stack,  however I get the error "Cannot make a
>> static reference to the non-static method makeStack(String, int, int,
>> boolean, boolean, boolean) from the type AVI_Reader" from my compiler. Are
>> there any static methods I can work with that reads AVI files ?
>>
>>
>
>
> --
> John Riemann Soong Lüwen
> Biochem, Physics UVA '13
>
> "Every difference of opinion is not a difference of principle. We have
> called by different names brethren of the same principle. We are all
> Republicans, we are all Federalists." -- Thomas Jefferson
>
> We want structures that serve people, not people serving structures.
> (l'Odéon, mai '68)
>
>
>
>
>


--
John Riemann Soong Lüwen
Biochem, Physics UVA '12

"Every difference of opinion is not a difference of principle. We have
called by different names brethren of the same principle. We are all
Republicans, we are all Federalists." -- Thomas Jefferson

We want stuctures that serve people, not people serving structures.
(l'Odéon, mai '68)
Reply | Threaded
Open this post in threaded view
|

blob detection for dark and light blobs together

Franklin Shaffer-2
I have an application in which I have blobs in a camera frame.  Some of the blobs are dark, some are white, and some have half their surface white and the other half dark.   I would like detect all blobs.  
Just thought I would ask and see if anyone has solved this problem already, or if anyone has any suggestions?

Thanks!
Frank

Franklin Shaffer
Senior Research Engineer
USDOE National Energy Technology Laboratory
Computational Science Division
Mail Stop 84-202
626 Cochran's Mill Road
Pittsburgh, PA 15236
 
[hidden email]
Office:  412-386-5964
Cell:  724-970-7262



Franklin Shaffer.vcf (403 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: blob detection for dark and light blobs together

Michael Schmid
Hi Frank,

if you have a uniform background, convert the image to 32 bit (float) and
subtract the background value (maybe you can get it as the 'mode' of the
histogram statistics). Then use Process>Math>Abs.
Maybe use grayscale closing (Filter>Maximum, than Minimum) for merging
what have been light and dark portions of a single blob.

If the blobs cover only a small area fraction, you can also subtract a
Gaussian blurred version of the original image for background subtraction
(radius should be significantly larger than blob size).

Michael

____________________________________________________________________

On Tue, April 10, 2012 20:22, Franklin Shaffer wrote:

> I have an application in which I have blobs in a camera frame.  Some of
> the blobs are dark, some are white, and some have half their surface white
> and the other half dark.   I would like detect all blobs.
> Just thought I would ask and see if anyone has solved this problem
> already, or if anyone has any suggestions?
>
> Thanks!
> Frank
>
> Franklin Shaffer
> Senior Research Engineer
> USDOE National Energy Technology Laboratory
> Computational Science Division
> Mail Stop 84-202
> 626 Cochran's Mill Road
> Pittsburgh, PA 15236
>
> [hidden email]
> Office:  412-386-5964
> Cell:  724-970-7262
>
>
>