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 7182063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:41:27+00:00 2026-05-28T17:41:27+00:00

I used connected component labeling algorithm (bwconncomp) to label the different parts of a

  • 0

I used connected component labeling algorithm (bwconncomp) to label the different parts of a binary image (MATLAB). Now i need to calculate the area of different labels and remove the labels with smaller area. Can i use the default area finding command or is there any specific commands for that in matlab…Help..

  • 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-28T17:41:28+00:00Added an answer on May 28, 2026 at 5:41 pm

    From the documentation:

    CC = bwconncomp(BW) returns the connected components CC found in BW.
    The binary image BW can have any dimension. CC is a structure with
    four fields…

    The final field in CC is PixelIdxList, which is:

    [a] 1-by-NumObjects cell array where the kth element in the cell array is
    a vector containing the linear indices of the pixels in the kth object.

    You can find the area of each label by looking at the length of the corresponding entry in the cell array. Something like:

    areas_in_pixels = cellfun(@length, CC.PixelIdxList);
    

    The PixelIdxList is a cell array, each member of which contains the linear indexes of the pixels present in that connected component. The line of code above finds the length of each cell in the cell array – i.e. the number of pixels in each connected component.

    I’ve used cellfun to keep the code short and efficient. A different way of writing the same thing would be something like:

    areas_in_pixels = nan(1, length(CC.PixelIdxList);
    for i = 1:length(CC.PixelIdxList)
      areas_in_pixels(i) = length(CC.PixelIdxList{i});
    end 
    

    For each connected component, you can then find the size of that component in pixels by accessing an element in areas_in_pixels:

    areas_in_pixels(34)   %# area of connected component number 34
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the connected component labeling algorithm in Matlab. Is it possible to
I used jQuery to set hover callbacks for elements on my page. I'm now
Is it better to implement blob(connected component) handling manually in openCV or are there
I have a Rails 3 application connected to a MySQL-database. The encoding used is
I need to create UML-like block diagram with connected components dynamically in Silverlight. How
For example DbVisualizer can be used to connect to a DB and create nice
I used to use the standard mysql_connect(), mysql_query(), etc statements for doing MySQL stuff
I used BeautifulSoup to handle XML files that I have collected through a REST
Used to be quite happy with the Ctrl + Shift + F10 shortcut in
We used the undocumented xp_fileexist stored procedure for years in SQL Server 2000 and

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.