Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Image processing shape area calculation

Posted on 2001-07-10
Last Modified: 2008-03-17
I need a software tool that can calculate the area of a solid object in a digital image.  This will be used to measure the difference in area of two shadows.

Any ideas of where I can find such a solution?

I'm asking this question for a couple of co-op students at my work, so budget is basically nonexistent.  Thanks!
Question by:porear
  • 3
  • 3
  • 2
LVL 22

Expert Comment

ID: 6272641
Actually I wanted to create such a thing a while again. Not similar, but from a face. ANd it is pretty damn hard to create such a thing. Since you need to check the whole image, and assume where objects may be located in the image. What shadows may be, etc etc. The closest examples I got to examine in my own project where some samples from a medical institute. Hospitals use such programs but those images are easier. They are black, and only the bones of people show up. Without knowing what objects are on the image it is (almost) impossible to know where and how big shadows are supposed to be. I think you are out of luck, just like me  (*pouts*). You'd better look into a graphical SDK like DirectX to create a scene and use the LPDIRECT3DVERTEXBUFFER to create objects and calculate the size etc etc. From a digital image I'd say impossible...


Expert Comment

ID: 6283369
Actually it's hard, but I wouldn't say impossible.
I don't know any commertial program that do what you want but I can help you develop the algorithm if you will give me more details about the nature of your images (what they contain, what is the background, do you have a picture without the shadows of the same backgound, etc.)
Good Luck...

Author Comment

ID: 6293832
I really don't have much more and have been unable to contact those who need it.  I know the basics are this:

These guys are trying to measure the difference in surface area of a shadow cast in 2 test cases.

The first case involves draping a covering over an object, and letting it "fluff out" at the bottom at what could be called the "hem of the skirt".

The second case involves wrapping a restraint at the bottom such that the hem is bound closely to the covered object.

Presently these guys are tracing the shadows on paper, cutting them out, and weighing the cutouts to obtain a ratio in shadow size, but we thought there had to be a better way (this is for the space program, for Pete's sake! ;).

Sorry, thats all I have.  Thanks for your time, if nothing else we'll let them continue on their current path.
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 22

Expert Comment

ID: 6293842
Nothing to add from my side....sorry...


Expert Comment

ID: 6295021
I just want to make sure I understood you well.
These guys actually photograph the object (image1), then put some "skirt" on it and try to measure the amount of pixels of the shadowed object, which are the pixels from the part of the object that can still be seen in the image but now covered with shadow.
Now they change the state of the "skirt" and measure this shadow again, and then calculate the difference.
The problem is then, how to know what is a "shadowed object" pixel and what not ?

I'll have to assume that the image contains only the object or have a totally black background otherwise this will be a much more complicated story.

Am I right so far ?

Author Comment

ID: 6296404
At present they are not using digital images, but are tracing the shadows on paper to weigh.  

They are not looking for shadows on the object itself, only the shadow cast below the object from a light source above with the covering in its loose and bound configurations.  

For an analogy:  imagine a table with a long tablecloth draped over.  Look at its shadow on the floor.  Now take a cord and wrap around the tablecloth at the bottom, and observe the shadow on the floor again.

I would assume that for photos a white background could be used, such that pixels in shadow will have stark contrast.

Accepted Solution

ygal02 earned 100 total points
ID: 6297507
If so I believe the problem is not so hard.
Assuming you photographed the state of the floor before (I1) and after (I2) the change in the shadows you have to do the following:
1. in order to eliminate camera and movement noise (as much as possible) perform a gausian blur (say with 5 pixels size filter)
2. I3 = abs(I2 - I1);
3. m = mean(I3);
4. count = 0
5. foreach pixel (x,y) of I3:
        if I3(x,y) > m
            count = count + 1;
6. print "the diference in shadow is :", count
7. end

The trick here is to take the avarege difference as a treshold and assume that major changes in the intensity level ar related to the shadow.
In different conditions the algorithm might need to be changes slightly (for example for big images or very noisy one you might want to take a bigger gausian filter, etc.)
You can write the whole thing in c/c++ but I personaly recommands MATLAB, which will make your life much easier.

Good Luck.

Author Comment

ID: 6317219
Thanks for the help.  I've got no time at the moment to actually throw this together, but i I can nab a resource I'll pass the algorithm along.

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I know it’s not a new topic to discuss and it has lots of online contents already available over the net. But Then I thought it would be useful to this site’s visitors and can have online repository on vim most commonly used commands. This post h…
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question