473,402 Members | 2,055 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

Mathematical Morphology Program in c/c++

I have a binary array representing an edge points image. The useful edge
points are generally 8 connected. There are some noise which are 8
connected in a group smaller than 10. So I want to remove all the
isolated noise group which contains less than 10 edge points from the
array.

Can any one give some code to cope it ?

Thanks

Stonny
Sep 26 '06 #1
4 2732
stonny wrote:
>
.... snip ...
>
Can any one give some code to cope it ?
[1] c:\c\junk>cat junk.c
#include <stdio.h>

int main(void)
{
int c, sum;

c = 1; sum = 0;
while (c < 9) {
sum += c/c++;
putchar(sum + '0'); putchar(' ');
}
puts("Establishing the meaning of c/c++");
return 0;
}

[1] c:\c\junk>cc junk.c
junk.c: In function `main':
junk.c:9: warning: operation on `c' may be undefined

[1] c:\c\junk>.\a
1 2 3 4 5 6 7 8 Establishing the meaning of c/c++

With that out of the way, maybe someone can translate the rest of
your subject line.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>

Sep 26 '06 #2
In article <J6********@bath.ac.uk>, stonny <ee***@bath.ac.ukwrote:
>I have a binary array representing an edge points image. The useful edge
points are generally 8 connected. There are some noise which are 8
connected in a group smaller than 10. So I want to remove all the
isolated noise group which contains less than 10 edge points from the
array.
>Can any one give some code to cope it ?
It sounds as if you need an algorithm, rather than assistance
with the meaning of the C language. You should contact an
algorithm newsgroup.

[Off topic]

When you repost there, you should probably clarify what it
means for an edge point to be "8 connected".

It also appears to me that your third sentance does not properly
follow from the first and second. Consider a noise group in
which the points are all only 2 connected, but the grouping includes
at least 10 points. According to your third sentance this is not
a candidate for removal, even though not even one member of the
group is 8 connected, because your third sentance talks only
about the size of the group and not about the properties of the group
members (other than that they are connected to each other.)
I would also ask what you would wish to have happen to the points
which are not at least 8 connected and yet are connected through
a chain (possibly an immediate adjacency) to a grouping that has
sufficiently many 8 connected points.

For example, if I take a 3 x 4 sub-array of edge points, fill that
in, and then surround it by a wall 1 deep of edge points, then
the result is a 4 x 5 sub-array in which 3 x 4 = 12 10 are 8
connected, but the outer wall is not 8 connected. What should happen
to that outer wall?

One can likely come up with topologies in which the overall group
is big enough to survive and yet the removal of a single "less useful"
point (one that is not 8 connected itself), by affecting the connection
counts of up to 7 of the 8-connected points, drops the number of 8
connected points in the group to less than the viable population of 10.
This group could have started with 16 8-connected points, along with
a cast of supporting points of less than 8 connectivity each (but which
are important in establishing the 8 connectivty of the important
points), and yet the loss of a single supporting point could result
in your criteria deeming the whole grouping to be noise. Is that really
want you would want to have happen?
--
All is vanity. -- Ecclesiastes
Sep 26 '06 #3

"Walter Roberson" <ro******@ibd.nrc-cnrc.gc.cawrote in message
news:ef**********@canopus.cc.umanitoba.ca...
In article <J6********@bath.ac.uk>, stonny <ee***@bath.ac.ukwrote:
>>I have a binary array representing an edge points image. The useful edge
points are generally 8 connected. There are some noise which are 8
connected in a group smaller than 10. So I want to remove all the
isolated noise group which contains less than 10 edge points from the
array.
>>Can any one give some code to cope it ?

It sounds as if you need an algorithm, rather than assistance
with the meaning of the C language. You should contact an
algorithm newsgroup.

[Off topic]

When you repost there, you should probably clarify what it
means for an edge point to be "8 connected".

It also appears to me that your third sentance does not properly
follow from the first and second. Consider a noise group in
which the points are all only 2 connected, but the grouping includes
at least 10 points. According to your third sentance this is not
a candidate for removal, even though not even one member of the
group is 8 connected, because your third sentance talks only
about the size of the group and not about the properties of the group
members (other than that they are connected to each other.)
I would also ask what you would wish to have happen to the points
which are not at least 8 connected and yet are connected through
a chain (possibly an immediate adjacency) to a grouping that has
sufficiently many 8 connected points.

For example, if I take a 3 x 4 sub-array of edge points, fill that
in, and then surround it by a wall 1 deep of edge points, then
the result is a 4 x 5 sub-array in which 3 x 4 = 12 10 are 8
connected, but the outer wall is not 8 connected. What should happen
to that outer wall?

One can likely come up with topologies in which the overall group
is big enough to survive and yet the removal of a single "less useful"
point (one that is not 8 connected itself), by affecting the connection
counts of up to 7 of the 8-connected points, drops the number of 8
connected points in the group to less than the viable population of 10.
This group could have started with 16 8-connected points, along with
a cast of supporting points of less than 8 connectivity each (but which
are important in establishing the 8 connectivty of the important
points), and yet the loss of a single supporting point could result
in your criteria deeming the whole grouping to be noise. Is that really
want you would want to have happen?
This sounds like something I SHOULD know, but don't. I've heard you make
references to algorithm newsgroups before, but it just so happens I had a
complexity issue queued up tonight before I went on-line. The ng's that
came up on searching didn't seem to have any life in them. Did you have a
particular one in mind? EC
Sep 27 '06 #4
Elijah Cardon wrote:
>
.... snip ...
This sounds like something I SHOULD know, but don't. I've heard
you make references to algorithm newsgroups before, but it just so
happens I had a complexity issue queued up tonight before I went
on-line. The ng's that came up on searching didn't seem to have
any life in them. Did you have a particular one in mind? EC
comp.programming would be suitable. Cross-posted and follow-ups
set. Don't forget to snip material that is not germane to your
reply.

--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>
Sep 27 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: gelong | last post by:
Hi there, I have a problem in writing a mathematical function using C++ programming. How to write an input that can insert whole equation? Example is the input are x˛ + 3y - 4zł = 0. In maple, it...
1
by: Jerry chapman | last post by:
Does C# have the standart mathematical functions such as sin,cos etc.? Or does one have to use pinvoke>
0
by: Juan R. | last post by:
I have updated some basic requirements for a generic mathematical markup language for scientific requirements at the next link. ...
4
by: Xah Lee | last post by:
i've long time been interested in algorithmic mathematical art. That is, mathematical or algorithmic visual art works that are generated by computer such that the program's source code reflects the...
6
by: reshmidoudou | last post by:
I am new to c++ and have to write a program that takes a line of characters as its inout and represents a mathematical eqaution of the form a + b = c and checks whether it is correct. example 2 + 3 =...
3
by: newbprogrammer | last post by:
I just started programming in c++ and i tried to explore and do programs on my own... So i wanted to do a program that would help me in my daily school work ... a program to solve quadratic...
13
by: jacek.strzelczyk | last post by:
Hello, I'm looking for a C library that provides the notation of n- dimensional mathematical functions. Or is there any other way to decode that kind of functions in C language? Thanks in...
2
by: Madmartigan | last post by:
Hi Operating system is WinXP using SharpDevelop version 1.1.0 and build 2124. I'm new to C# and have a problem trying to get a user to enter 3 mathematical operators of choice, then 2 numbers...
2
by: madahmad1 | last post by:
prepare a report which contains the C source code, the documentation and the flow charts, along with drawings explaining the mathematical background related to the calculation of- F(x)= 5.x^2 + e...
2
by: paragdi | last post by:
Hi Experts! I am developing heavy mathematical engineering windows application in VB.NET (VS2005) with MSAccess Db. This application has resource files in English, Spanish and German Language. I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.