Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:38:00+00:00 2026-05-25T15:38:00+00:00

I am new to image analysis. Do you know how to binarize this image

  • 0

I am new to image analysis. Do you know how to binarize this image in such a way to get the fibers only?

Fibers in the liquid

I have tried different threshold techniques etc, but I was not successful. I do not mind what tool I should use but I prefer .NET or Matlab.

PS: I did not know where to put my answer, so I put it at StackOverflow.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:38:01+00:00Added an answer on May 25, 2026 at 3:38 pm

    Based on the comments, it seems you are having difficulty translating the proposed Mathematica solutions into MATLAB. Here is my attempt:

    @Nakilon solution

    %# read image
    I = im2double(imread('https://i.stack.imgur.com/6KCd1.jpg'));
    
    %# ImageAdjust[]
    II = I;
    for k=1:size(II,3)
        mn = min(min( II(:,:,k) )); mx = max(max( II(:,:,k) ));
        II(:,:,k) = ( II(:,:,k) - mn ) ./ (mx-mn);
    end
    
    %# Sharpen[]
    II = imfilter(II, fspecial('unsharp'));
    
    %# MinDetect[], MaxDetect[]
    II = rgb2gray(II);
    mn = imextendedmin(II,0.3,8);
    mx = imextendedmax(II,0.7,8);
    
    %# pad image because Mathematica handles border cases differently than MATLAB
    pad = 30;
    q = padarray(mn, [pad pad], 'symmetric', 'both');
    
    q = medfilt2(q, [5 5]*2+1, 'symmetric');                 %# MedianFilter[]
    q = ordfilt2(q, 1, ones(2*5+1), 'symmetric');            %# MinFilter[]
    q = ordfilt2(q, (25*2+1)^2, ones(25*2+1), 'symmetric');  %# MaxFilter[]
    q = ordfilt2(q, 1, ones(20*2+1), 'symmetric');           %# MinFilter[]
    
    %# un-pad image
    q = q(pad+1:end-pad, pad+1:end-pad, :);
    
    %# ImageSubtract[], ImageMultiply[], ImageAdd[]
    a = imsubtract(mn,q)==1;    %# a = mn; a(q) = false;
    b = immultiply(mx,q);       %# b = mx & q;
    c = imadd(a,b);             %# c = a | b;
    
    %# show images
    figure(1)
    subplot(121), imshow(mn)
    subplot(122), imshow(mx)
    figure(2), imshow(q)
    figure(3)
    subplot(121), imshow(a)
    subplot(122), imshow(b)
    figure(4), imshow(c)
    

    Note that there are differences at the edges. In the Mathematica documentation, it vaguely says:

    At the edges of an image, MedianFilter/MinFilter/MaxFilter uses smaller neighborhoods.

    But there is no direct match for this behavior, instead MATLAB gives you the option to customize the padding at the boundaries of the images.

    screenshot1


    @belisarius solution

    %# read image
    I = im2double(imread('https://i.stack.imgur.com/6KCd1.jpg'));
    
    %# LaplacianGaussianFilter[]
    II = imfilter( I , fspecial('log', [2 2]*2+1, (2*2+1)/2) );
    
    %# ImageAdjust[]
    for k=1:size(II,3)
        mn = min(min( II(:,:,k) )); mx = max(max( II(:,:,k) ));
        II(:,:,k) = ( II(:,:,k) - mn ) ./ (mx-mn);
    end
    
    %# Binarize[]
    BW = im2bw(II, 0.6);
    
    %# DeleteSmallComponents[]
    BW = bwareaopen(BW, 2, 8);
    
    %# show images
    figure
    subplot(121), imshow(BW)
    subplot(122), imshow( imoverlay(I,BW,[0 1 0]) )
    

    screenshot2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I create image in this way: var orc = new Image(); orc.src = ./orc.png;
I have this code private void saveImage() { Bitmap bmp1 = new Bitmap(pictureBox.Image); bmp1.Save(c:\\t.jpg,
I have this code: if (document.images) { preload_image = new Image(25,25); preload_image.src=http://mydomain.com/image.gif; } First
If I write something like this: var img = $(new Image()).attr('src', image.src); How can
I have a webpage where I want the user to see a new image
I have loaded image into a new, initialized Oracle ORDImage object and am processing
I'm pretty new to Java and SWT, hoping to have one image dissolve into
I sometimes need to add elements (such as a new link and image) to
I have an UIImageView with an image. Now I have a completely new image
I have a canvas in my webpage; I create a new Image data in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.