Solved

Image processing shape area calculation

Posted on 2001-07-10
8
309 Views
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!
0
Comment
Question by:porear
  • 3
  • 3
  • 2
8 Comments
 
LVL 22

Expert Comment

by:CJ_S
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...

Regards,
CJ
0
 
LVL 3

Expert Comment

by:ygal02
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...
0
 
LVL 5

Author Comment

by:porear
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.
0
 
LVL 22

Expert Comment

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

regards,
CJ
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 3

Expert Comment

by:ygal02
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 ?
0
 
LVL 5

Author Comment

by:porear
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.
0
 
LVL 3

Accepted Solution

by:
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;
        endif
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.
0
 
LVL 5

Author Comment

by:porear
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.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Problem to adjust sheet 1 81
matchUp  challenge 9 71
base64 decode encode 12 96
Eclipse Neon start with Admin account only 6 46
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
This is about my first experience with programming Arduino.
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 …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

708 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now