•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Computer Science and Software Design section within the Software Development category of DaniWeb, a massive community of 429,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,662 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Computer Science and Software Design advertiser: Programming Forums
Views: 14564 | Replies: 12
![]() |
•
•
•
•
Originally Posted by big_k105
edit: i guess i should tell everyone why im trying to figure this out. i need to know cause i have been given a project at work to see if i can do with visual basic and the project invovles finding out the area of spaces like this so that they can do other info with the info. there is a program out there that can do this so i figure some how some way i must beable to do it. but the program they have found to do this will cost the company $50,000.00 :eek: and they dont want to pay that. but hopefully i will figure it out
I understand that this is a seriously aged thread, but thought I'd contribute a possible solution anyway.
It makes sense that you'd want to figure out how to process this on your own, but if your employer needs a simple, accurate and inexpensive digital solution for measuring real-size area, then peek over here.
the NIH uses, and makes freely available, a program called NIH IMAGE for Macs - which is also available for Windows from Scion Corp called Scion Image. I have used both for research and find that they measure area accurately to 0.1cm^2.
you can get NIH Image through the National Institues for Health (the mac version) and you can get Scion Image from Scion Corporation (www.scioncorp.com) (the windows version)
I hope that this might apeal to you as a possible solution, and that someone else with a similar requirment might benefit. I have also written several papers on this program's use, email me at maths@iq-data.net if you want some elaboration on their use.
-gkd
Last edited by gkdmaths : Jan 3rd, 2004 at 1:10 am. Reason: edited for sleeping, er...I mean spelling.
•
•
Join Date: Jan 2004
Posts: 17
Reputation:
Rep Power: 5
Solved Threads: 0
If you just want the area in pixels, then I can suggest a simpler method:
if the region you want to measure contains pixels of a similar colour, then you could implement this recursively:
you need firstly:
a list of all the pixels in the image (ie a 2D array), where you store whether they have been visited or not.
a count of the area initialised to 0
Start with a pixel in the image and look at its 8 neighbours. If their colour is similar to the center pixel, and they have not been visited yet, increment the count, and start the procedure again from each of those pixels. In c like pseudocode:
if the region you want to measure contains pixels of a similar colour, then you could implement this recursively:
you need firstly:
a list of all the pixels in the image (ie a 2D array), where you store whether they have been visited or not.
a count of the area initialised to 0
Start with a pixel in the image and look at its 8 neighbours. If their colour is similar to the center pixel, and they have not been visited yet, increment the count, and start the procedure again from each of those pixels. In c like pseudocode:
void checkPixel(x, y){
for(pixels surrounding x,y){
if(pixelColor(x,y) == pixelColor(x2,y2)){
count++;
checkPixel(x2,y2);
}
}
}•
•
Join Date: Jan 2004
Posts: 17
Reputation:
Rep Power: 5
Solved Threads: 0
Deciding whether a color is similar is the hardest part of this algorithm. The most accurate way to do this is with a gaussian-type function. By recollection, the theoretical optimum is C=exp[(I-Io)/t]^6, where t is the maximum number of pixels diference, and I and Io are the intensities of the comparison pixel and the base pixel respectively. C will range from 0 to 1.
To put this into the above algorithm, you should have the count as a floating point, and incriment it by the value of C, and call checkPixel if C is above 0.5.
t sets the sensitivity of the algorithm, and you will ahve to set this by trial and error.
The effect of using C instead of a cutoff is that pixels that are at the edge, and blurred between the area you are interested in and the rest of the image, are still counted in a userful way.
To put this into the above algorithm, you should have the count as a floating point, and incriment it by the value of C, and call checkPixel if C is above 0.5.
t sets the sensitivity of the algorithm, and you will ahve to set this by trial and error.
The effect of using C instead of a cutoff is that pixels that are at the edge, and blurred between the area you are interested in and the rest of the image, are still counted in a userful way.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Computer Science and Software Design Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
ajax asp blog business software computer dell design developer development erp systems experiment firefox howto india intel internet it java linux media microsoft mmorpg msdn networking news office open open-source operating programming project management rss science security software software selection source sql sun super system technology evaluation toread vista warez web wiki windows xp
Other Threads in the Computer Science and Software Design Forum
- Previous Thread: Creating files defined by ME :-)
- Next Thread: Problem about grammar rules


Linear Mode