Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Size of the objects

Subject: Size of the objects

From: sarah

Date: 13 Jun, 2011 15:21:05

Message: 1 of 13

Hi,
My problem is that I have images in which object have different size. In some images these objects are small and in some images these objects are big. I have calculated ares and I want to remove unwanted objects on the basis of area. Now If I set pixel value to remove them then in some images useful objects are also deleted. I have used imresize function for this purpose but I did not get accurate results. Now what can I do now? How to get objects of same area?

Subject: Size of the objects

From: ImageAnalyst

Date: 13 Jun, 2011 15:34:13

Message: 2 of 13

On Jun 13, 11:21 am, "sarah " <sarahrq...@gmail.com> wrote:
> Hi,
> My problem is that I have images in which object have different size. In some images these objects are small and in some images these objects are big. I have calculated ares and I want to remove unwanted objects on the basis of area. Now If I set pixel value to remove them then in some images useful objects are also deleted. I have used imresize function for this purpose but I did not get accurate results. Now what can I do now?  How to get objects of same area?  

------------------------------------------------------------------------------------------
No, you don't use imresize unless you're trying to get the same number
of pixels per mm (or whatever) because you need the same spatial
calibration in every image. If you want to do it based on pixels,
either
(1) use bwareaopen(), or
(2) use ismember() after you've gotten the measurements from
regionprops, like in my BlobsDemo in the File Exchange.

Are all your images taken with the same magnification (spatial
calibration)?

Subject: Size of the objects

From: sarah

Date: 13 Jun, 2011 15:46:04

Message: 3 of 13

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <4430bada-aef4-48fc-b101-1f43476a97c7@c41g2000yqm.googlegroups.com>...
> On Jun 13, 11:21 am, "sarah " <sarahrq...@gmail.com> wrote:
> > Hi,
> > My problem is that I have images in which object have different size. In some images these objects are small and in some images these objects are big. I have calculated ares and I want to remove unwanted objects on the basis of area. Now If I set pixel value to remove them then in some images useful objects are also deleted. I have used imresize function for this purpose but I did not get accurate results. Now what can I do now?  How to get objects of same area?  
>
> ------------------------------------------------------------------------------------------
> No, you don't use imresize unless you're trying to get the same number
> of pixels per mm (or whatever) because you need the same spatial
> calibration in every image. If you want to do it based on pixels,
> either
> (1) use bwareaopen(), or
> (2) use ismember() after you've gotten the measurements from
> regionprops, like in my BlobsDemo in the File Exchange.
>
> Are all your images taken with the same magnification (spatial
> calibration)?

No that's what the problem is. And I can't think how to get over this problem because all my work is based on this.

Subject: Size of the objects

From: sarah

Date: 14 Jun, 2011 12:09:05

Message: 4 of 13

"sarah" wrote in message <it5bbs$oma$1@newscl01ah.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <4430bada-aef4-48fc-b101-1f43476a97c7@c41g2000yqm.googlegroups.com>...
> > On Jun 13, 11:21 am, "sarah " <sarahrq...@gmail.com> wrote:
> > > Hi,
> > > My problem is that I have images in which object have different size. In some images these objects are small and in some images these objects are big. I have calculated ares and I want to remove unwanted objects on the basis of area. Now If I set pixel value to remove them then in some images useful objects are also deleted. I have used imresize function for this purpose but I did not get accurate results. Now what can I do now?  How to get objects of same area?  
> >
> > ------------------------------------------------------------------------------------------
Is there any method through which we can get images of same
magnification(spatial calibration). And there is any function by which we can check the
magnification of images.

Subject: Size of the objects

From: ImageAnalyst

Date: 14 Jun, 2011 12:34:03

Message: 5 of 13

On Jun 14, 8:09 am, "sarah " <sarahrq...@gmail.com> wrote:
> Is there any method through which we can get images of same
> magnification(spatial calibration). And there is any function by which we can check the
> magnification of images.
-------------------------------------------------------------------------
Sure:
1) use the same camera setup for all images.
2) put an object of know size in the field of view that you can use
for spatial calibration.

Subject: Size of the objects

From: sarah

Date: 16 Jun, 2011 15:10:20

Message: 6 of 13

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <5e72214e-40e5-4c34-a3d1-89e011ed3591@d1g2000yqm.googlegroups.com>...
> On Jun 14, 8:09 am, "sarah " <sarahrq...@gmail.com> wrote:
> > Is there any method through which we can get images of same
> > magnification(spatial calibration). And there is any function by which we can check the
> > magnification of images.
> -------------------------------------------------------------------------
> Sure:
> 1) use the same camera setup for all images.
> 2) put an object of know size in the field of view that you can use
> for spatial calibration.
----------------------------------------------------------------------------
Can you think that normalizing the pixel value to 0 to 1 can solve my problem of resolution. If yes then how can I do that?

Subject: Size of the objects

From: Jeff

Date: 16 Jun, 2011 18:46:20

Message: 7 of 13

"sarah" wrote in message <it5bbs$oma$1@newscl01ah.mathworks.com>...
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <4430bada-aef4-48fc-b101-1f43476a97c7@c41g2000yqm.googlegroups.com>...
> > On Jun 13, 11:21 am, "sarah " <sarahrq...@gmail.com> wrote:
> > > Hi,
> > > My problem is that I have images in which object have different size. In some images these objects are small and in some images these objects are big. I have calculated ares and I want to remove unwanted objects on the basis of area. Now If I set pixel value to remove them then in some images useful objects are also deleted. I have used imresize function for this purpose but I did not get accurate results. Now what can I do now?  How to get objects of same area?  
> >
> > ------------------------------------------------------------------------------------------
> > No, you don't use imresize unless you're trying to get the same number
> > of pixels per mm (or whatever) because you need the same spatial
> > calibration in every image. If you want to do it based on pixels,
> > either
> > (1) use bwareaopen(), or
> > (2) use ismember() after you've gotten the measurements from
> > regionprops, like in my BlobsDemo in the File Exchange.
> >
> > Are all your images taken with the same magnification (spatial
> > calibration)?
>
> No that's what the problem is. And I can't think how to get over this problem because all my work is based on this.

If your images always contain at least one object which you want to keep, and you can identify at least one of these objects, then you could set up your bwareaopen (or whatever filter you use), based upon that one object's size.

In whatever field you're looking at, lets say the largest object you identify is one you want to keep, and everything above 70% of that value is something you want to keep. Everything below 70% is garbage. In this scenario you don't have to know the absolute size of anything. Everything is relative to the largest object.

Does this sound even remotely helpful, or along the lines of what you're trying to do?

Subject: Size of the objects

From: sarah

Date: 17 Jun, 2011 15:08:04

Message: 8 of 13

Jeff
The problem is the I have images of different resolution. I have taken measurements of the objects using regionprops but as images are of different resolution so some objects have small objects and some images have big objects. Due to this difference in the measurements occurs.Something this this
threshold>0.99
this object is circular.
I want to identify the objects due to their measurements but differences in the size of the objects creates the problem.
So I want to make all images of same type. Do you have any idea how I will do that?
Someone has told me that this problem will be solve by normalizing the pixel values. Do this work?

Subject: Size of the objects

From: ImageAnalyst

Date: 17 Jun, 2011 15:19:51

Message: 9 of 13

sarah:
Circularity does not depend on spatial calibration. You will know
that both a ball and a full moon are circular in your image. However
if you want to know which object is less than 100 meters in diameter,
you will need to have a known object of known size taken with the same
image capture parameters, otherwise there's no way you would know that
the moon shape is larger than the ball shape, regardless if the moon
photo had more or less pixels than the ball photo.

Subject: Size of the objects

From: sarah

Date: 17 Jun, 2011 15:30:21

Message: 10 of 13

Any other measurements which do not depend upon spatial calibration? Any idea?

Subject: Size of the objects

From: dpb

Date: 17 Jun, 2011 15:40:05

Message: 11 of 13

sarah wrote:

> Any other measurements which do not depend upon spatial calibration? Any
> idea?

Yeah, I have an idea.

You can't create information that has been lost in the measurement
process from nothing.

IA is correct; if you want/need size information you _MUST_ have a
calibration facility of some sort.

--

Subject: Size of the objects

From: sarah

Date: 17 Jun, 2011 15:57:02

Message: 12 of 13

I know that but I want my code to work on images having different spatial calibrations what is why I was asking that

Subject: Size of the objects

From: ImageAnalyst

Date: 17 Jun, 2011 16:14:42

Message: 13 of 13

On Jun 17, 11:57 am, "sarah " <sarahrq...@gmail.com> wrote:
> I know that but I want my code to work on images having different spatial calibrations what is why I was asking that
-------------------------------------------------------------------------------------
You can want all you want but it's not going to happen until you say
how many pixels correspond to one "real world" unit such as a meter.
Otherwise there is no way to do it. One meter might be 10 pixels in
one image but 100 pixels in another image. There's no way of knowing
unless you tell it.

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us