Background Subtraction On The Fly: Different from Flat-Field Correction

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

Background Subtraction On The Fly: Different from Flat-Field Correction

Micro-Manager mailing list

Hi,

 

I would like to use something similar to flat-field correction on some polarization contrast imaging. Currently, flat-field correction calculates on-the-fly:

 

Resulting image = (acquired image – background) / (flatfield image – background)

 

I want:

 

Resulting image = acquired image – background

 

Here the background would be the topographic information of my sample, and the resulting image after subtraction would highlight the polarization contrast due to strain/magnetic contrast/etc. Is there a plugin available to do that? Or would there be a way to massage the chosen flatfield image to enable that anyway?

 

I am using a Thorlabs camera, by the way.

 

Thanks,

 

Dan

 



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Background Subtraction On The Fly: Different from Flat-Field Correction

Vikram Kopuri
Hi Dan, 

OpenCv has tools for subtracting background. Check this out https://docs.opencv.org/3.4/db/d5c/tutorial_py_bg_subtraction.html 
~~~~~~~~~~~~~~~~~~~~~~
Vikram G Kopuri



On Thu, Feb 7, 2019 at 10:08 AM Gopman, Daniel (Fed) via micro-manager-general <[hidden email]> wrote:

Hi,

 

I would like to use something similar to flat-field correction on some polarization contrast imaging. Currently, flat-field correction calculates on-the-fly:

 

Resulting image = (acquired image – background) / (flatfield image – background)

 

I want:

 

Resulting image = acquired image – background

 

Here the background would be the topographic information of my sample, and the resulting image after subtraction would highlight the polarization contrast due to strain/magnetic contrast/etc. Is there a plugin available to do that? Or would there be a way to massage the chosen flatfield image to enable that anyway?

 

I am using a Thorlabs camera, by the way.

 

Thanks,

 

Dan

 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Background Subtraction On The Fly: Different from Flat-Field Correction

Vikram Kopuri
On second thought, opencv is an overkill. Looks like image calculator in Fiji will do basic image subtraction. 

"Fiji > Process > Image Calculator "



~~~~~~~~~~~~~~~~~~~~~~
Vikram G Kopuri



On Thu, Feb 7, 2019 at 10:12 AM Vikram G Kopuri <[hidden email]> wrote:
Hi Dan, 

OpenCv has tools for subtracting background. Check this out https://docs.opencv.org/3.4/db/d5c/tutorial_py_bg_subtraction.html 
~~~~~~~~~~~~~~~~~~~~~~
Vikram G Kopuri



On Thu, Feb 7, 2019 at 10:08 AM Gopman, Daniel (Fed) via micro-manager-general <[hidden email]> wrote:

Hi,

 

I would like to use something similar to flat-field correction on some polarization contrast imaging. Currently, flat-field correction calculates on-the-fly:

 

Resulting image = (acquired image – background) / (flatfield image – background)

 

I want:

 

Resulting image = acquired image – background

 

Here the background would be the topographic information of my sample, and the resulting image after subtraction would highlight the polarization contrast due to strain/magnetic contrast/etc. Is there a plugin available to do that? Or would there be a way to massage the chosen flatfield image to enable that anyway?

 

I am using a Thorlabs camera, by the way.

 

Thanks,

 

Dan

 

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Background Subtraction On The Fly: Different from Flat-Field Correction

Stuurman, Nico
In reply to this post by Micro-Manager mailing list
Hi Dan,

> I would like to use something similar to flat-field correction on some
> polarization contrast imaging. Currently, flat-field correction
> calculates on-the-fly:
>
> Resulting image = (acquired image – background) / (flatfield image –
> background)
>
> I want:
>
> Resulting image = acquired image – background
>

At least in 2.0-gamma, simply leave out the flatfield image, and you
will get on the fly background subtraction.  It can even be carried out
on the GPU (first GPU accelerated code in MM, more to follow). I don't
know/remember behavior in older MM versions, but you can easily test. 
Switching to gamma should be a good thing in any case.


Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general