Remove small objects from binary image without erode.

Is there a function that removes objects binary image based only on their pixel area?

I want to maintain lines, so erode or close is out of the question. Planning on using region props and check each area region, but that seems slow and inefficient...

Tks
0
Ironic
12/16/2009 12:17:03 AM
comp.soft-sys.matlab 209972 articles. 11 followers. lunamoonmoon (258) is leader. Post Follow

5 Replies
2789 Views

Similar Articles

[PageSpeed] 47

On Dec 15, 7:17=A0pm, "Ironic Prata" <lixodoiro...@hotmail.com> wrote:
> Is there a function that removes objects binary image based only on their=
 pixel area?
>
> I want to maintain lines, so erode or close is out of the question. Plann=
ing on using region props and check each area region, but that seems slow a=
nd inefficient...
>
> Tks
---------------------------------------------------------------------------=
---------------------------------------------------------------------------=
------------------------------------
You can use bwareaopen().  Despite the name it doesn't use a
morphological opening, but rather uses the regionprops method, that
you want to avoid.  I don't know of any faster methods.  Why do you
say it's slow?  It doesn't seem slow when I use it - just takes a
fraction of a second.  How large are your images, how many blobs are
in them, and how long is it taking on your computer?  Maybe you can
get a faster computer.
0
ImageAnalyst
12/16/2009 1:35:59 AM
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <99896c54-e824-4fc6-9b92-3eb8fa8c7704@x20g2000vbn.googlegroups.com>...
> On Dec 15, 7:17?pm, "Ironic Prata" <lixodoiro...@hotmail.com> wrote:
> > Is there a function that removes objects binary image based only on their pixel area?
> >
> > I want to maintain lines, so erode or close is out of the question. Planning on using region props and check each area region, but that seems slow and inefficient...
> >
> > Tks
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> You can use bwareaopen().  Despite the name it doesn't use a
> morphological opening, but rather uses the regionprops method, that
> you want to avoid.  I don't know of any faster methods.  Why do you
> say it's slow?  It doesn't seem slow when I use it - just takes a
> fraction of a second.  How large are your images, how many blobs are
> in them, and how long is it taking on your computer?  Maybe you can
> get a faster computer.

the problem is that this is to be used in a loop, so i want efficiency.

but at least that function will clear up the code. tks
0
Ironic
12/16/2009 2:28:03 AM
On Dec 15, 9:28=A0pm, "Ironic Prata" <lixodoiro...@hotmail.com> wrote:
> the problem is that this is to be used in a loop, so i want efficiency.
> but at least that function will clear up the code. tks
---------------------------------------------------------------------------=
----------------------
You're implying that the bwareaopen function is inefficient.  What's
the basis for saying that?  Do you have a more efficient method?  Why
is this method too slow for you?  Again, what kind of speed do you
require and what kind of speed are you getting?

0
ImageAnalyst
12/16/2009 2:54:06 AM
Hi

Other possibility, aside the suggestion made by ImageAnalyst, is to use a small median filter. You can "efficiently" apply it multiple times in a loop.

Igor 

"Ironic Prata" <lixodoironic@hotmail.com> wrote in message <hg98tv$2m$1@fred.mathworks.com>...
> 
> Is there a function that removes objects binary image based only on their pixel area?
> 
> I want to maintain lines, so erode or close is out of the question. Planning on using region props and check each area region, but that seems slow and inefficient...
> 
> Tks
0
Novae
12/18/2009 4:54:04 PM
"Ironic Prata" <lixodoironic@hotmail.com> wrote in message <hg98tv$2m$1@fred.mathworks.com>...
> 
> Is there a function that removes objects binary image based only on their pixel area?
> 
> I want to maintain lines, so erode or close is out of the question. Planning on using region props and check each area region, but that seems slow and inefficient...
> 
> Tks

Like this:

stats = regionprops(binary, 'Area', 'PixelIdxList');
cleaned = binary;
for region = 1 : length(stats)
    if stats(region).Area < MIN_AREA
        cleaned(stats(region).PixelIdxList) = 0;
    end
end

I can guarantee this is REALLY fast! ;)
0
Simone
4/13/2010 2:00:26 PM
Reply:

Similar Artilces:

How to remove small objects from binary images
I have a binary image containing many disconnected objects. What's the fastest way to remove objects whose pixel count is less than some threshold? At the moment I'm doing it by labeling the regions using bwlabel (image processing toolbox) and then looping through all the label values and finding out the pixel count of each one and then removing it if it's less than the threshold. This is slow and I need it to be fast because I'm doing this on each frame of a video. I thought about using an erosion technique but I don't want to erode the edges of any of the big objects. T...

removing large objects from a binary image
All, I'm wondering if anyone knows of a function or method to remove large objects from a binary image...what I want is something similar to bwareaopen, which removes images will less than a specified number of pixels, but in reverse. Thanks in advance for any help If nothing else I think you could subtract the bwareaopen from the original image and get only the larger ones... Daphne "Robert Maidhof" <rtm2001@columbia.edu> wrote in message <fub16i$jaf$1@fred.mathworks.com>... > All, I'm wondering if anyone knows of a function or meth...

removing large objects from a binary image #2
All, I'm wondering if anyone knows of a function or method to remove large objects from a binary image...what I want is something similar to bwareaopen, which removes images will less than a specified number of pixels, but in reverse. Thanks in advance for any help In article <fub16i$jag$1@fred.mathworks.com>, Robert Maidhof <rtm2001@columbia.edu> wrote: >All, I'm wondering if anyone knows of a function or method >to remove large objects from a binary image...what I want >is something similar to bwareaopen, which removes images >will less than...

Matlab 7: how to remove java object in Matlab?
Hi, I found that there are some GUI windows in Matlab 7 return Java objects directly instead of returnning figure handles or object handles. I want to delete them, but I tried "delete(handles.objJava)" where objJava is some Java object returned by these Matlab GUI windows..., I saved it to handles as a field... but it did not work. The error message is: ------------------------------------------ ??? Invalid handle object. Error in ==> ieMyProgram>myCallbackFcn at 162 delete(handles.objJava); ...

Save JPEG images in SQL as binary BLOB data from MATLAB without using DATABASE toolbox
clc; clear all; close all; %Connection credentials catalog = <Database Name>; table = <table name>; connection.user = '<user>'; connection.pass = '<pass>'; try %-- opens connection to the database --% conn = actxserver('ADODB.Connection'); openStr = ('Provider=sqloledb;Data Source=<Server Name/IP>; Initial Catalog=%s ;User Id=%s; Password=%s;'); openStr = sprintf(openStr,catalog,connection.user,connection.pass); conn.Open(openStr); catch ex rethrow(ex) end %Provide the so...

matlab command for converting binary image to color image
hi, anybody knows matlab command for converting binary image to color image ? I have searched in help, but i m unable to locate it. subramanya wrote: > > > hi, > anybody knows matlab command for converting binary image to color > image ? > > I have searched in help, but i m unable to locate it. In order to change current pixel color to another color for the whole image, create your own colormap. For example if the image is black and white (binary matrix), you can convert white pixels into red pixels by executing a code similar to the following: I = eye(100); imshow(I);...

[Q]Using Matlab COM Object(.dll) without Matlab
Is it possible using Matlab COM Object(.dll) without Matlab program? ...

removing an object from an image
As above, is there code about that, for example, removes a sheep from a field and replaces it with the grass around it. IE compares pixels with others and replaces them to create desired effect. cheers Nick In article <ef18bbb.-1@webx.raydaftYaTP>, nick <nky_84@hotmail.com> wrote: > As above, is there code about that, for example, removes a sheep from > a field and replaces it with the grass around it. > > IE compares pixels with others and replaces them to create desired > effect. A tool that specifically finds sheep in a field might be interesting. Though i...

Removing objects in an image
Hi Im new to Matlab, i hope some one could help me. I have an image which has musical notes in which i have to remove the staff lines & show only the staff notes. lease some help me out? ...

Remove small objects
How to remove small objects when is use from help bw2 = ismember(L, find([S.Area] >= P)); the errer occur from ismember.m please help me ...

Binary to image in Matlab
Dear All, I have 4000 x 3000 - 16-bit data stored as a binary file which I want to display as an image. How do I read this file into matlab and convert the binary file to image file (jpg,png,bmp - any format will do)? Bye, Satish Sat <satish.isro@gmail.com> wrote in message <6dcd0330-bfb5-4c99-b442-24ca90b39984@x1g2000prh.googlegroups.com>... > Dear All, > > I have 4000 x 3000 - 16-bit data stored as a binary file which I want > to display as an image. How do I read this file into matlab and > convert the binary file to image file (jpg,png,bmp - any format will ...

Binary Image to Indexed Image to RGB Image
How will we convert binary image to indexed image? And then the indexed image to RGB image in Matlab? ...

How to remove the small circle from Image?
Hello all: I have an image as follows: <http://danielmarkhot.googlepages.com/22019_bv.png> Can anyone give me some comments on how to remove those small circles? I would like to remove all circles from the image and only keep the curve left. Thank you in advance. -Daniel Use bwlabel function to locate each spot. Then for each of them calculate its eccentricity. If this value is below/above a threshold (and some addional thareshold about area) then consider/do no consider the object the undesired small circle. Matlab commands: - bwlabel - regionprops (to retrieve some additional i...

Removing small blobs from an image
How to remove small blobs from a RGB image? (suppose I want to remove the blobs with area less than 200). I was able to convert it into binary image and perform morphological processing but I dont want to convert it into binary image as I want the final image in RGB and not in binary format. Please help me. On Feb 2, 4:03=A0am, "Abhinay " <abhilab...@gmail.com> wrote: > How to remove small blobs from a RGB image? (suppose I want to remove the= blobs with area less than 200). I was able to convert it into binary image= and perform morphological processing but I dont wa...

Web resources about - Remove small objects from binary image without erode. - comp.soft-sys.matlab

Smart Personal Objects Technology - Wikipedia, the free encyclopedia
Smart Personal Object Technology (SPOT) was developed by Microsoft to personalize household electronics and other everyday devices, through "smart" ...

Cops Object to Beyonce’s Super Bowl Performance - Al Jazeera America
Sheriffs’ petty boycott of Super Bowl performance tells us about police culture, not the singer

Chrome for Android will let you interact with nearby smart objects
... car - and not have to download an app first. Everything should be just a tap away. Explained in the most basic form, Physical Web means objects ...

"The hard, jagged object... dark blue and small enough to be held in a closed hand" fell from the sky ...
... in India: The object slammed into the ground at an engineering college over the weekend, shattering a water cooler and sending splinters ...

This Advertising Executive Reminds Her Industry That Women Aren’t Objects
... Badger is facing. The advertising executive in charge of Badger & Winters created a video documenting just a few examples of women objectified ...

North Korean rocket puts object into space, angering neighbours and UN
Its neighbours and the United States denounced the launch as a missile test, conducted in defiance of UN sanctions and just weeks after a nuclear ...

India meteorite? Man killed by falling object - CNN.com
Indian scientists will examine the remains of an object that fell from the sky, causing a large explosion which killed a man, to determine if ...

VR is better when virtual objects feel real
... (the illusion of flight, the exhaustion of exercise and even the emotional fatigue of trauma), it still has one major flaw: Virtual objects ...

Delicate Robotic Fingers Pick Up Fragile Objects Using Electrostatic Force
... up with... broken eggs. But this pair of automated fingers uses an incredibly delicate thin film and some simple physics to grasp fragile objects ...

Mysterious Object Strikes Amtrak Train in Philadelphia
Amtrak officials are trying to determine what kind of mysterious object struck one of its trains in Philadelphia

Resources last updated: 2/13/2016 1:19:56 PM