niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » Programming » C
Center of Contour
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
Author Message
Speed
*nix forums beginner


Joined: 16 Feb 2006
Posts: 4

PostPosted: Thu Jul 20, 2006 1:49 pm    Post subject: Center of Contour Reply with quote

Hi,

Could you please tell me what is the most efficient way of finding the
center of mass of the area enclosed by a closed contour.

I have a considerable circular region with streaks coming out of it in
either direction. Basically i want to find the center of the circular
region but it is getting offset due to the presence of connected
outlier segments.

I am working with binary images only.

Thanks a ton,
Soumyadip.
Back to top
Walter Roberson
*nix forums Guru


Joined: 19 Feb 2005
Posts: 1300

PostPosted: Thu Jul 20, 2006 3:35 pm    Post subject: Re: Center of Contour Reply with quote

In article <1153403385.696050.78980@i42g2000cwa.googlegroups.com>,
Speed <lostandhappy@gmail.com> wrote:

Quote:
Could you please tell me what is the most efficient way of finding the
center of mass of the area enclosed by a closed contour.

That's an algorithm, which could be implemented in most any language.
It is not a C specific question, so you should ask in an
algorithms newsgroup, or possibly a graphics newsgroup.


Quote:
I have a considerable circular region with streaks coming out of it in
either direction. Basically i want to find the center of the circular
region but it is getting offset due to the presence of connected
outlier segments.

I am working with binary images only.

<OT>
The "most efficient way" is going to depend upon the size of the images,
upon whether you assume constant density, and upon the complexity
of the outlier segments (e.g., simplier if you know they are
strictly convext); also upon how you determine whether a segment
is connected or not (if it only touches on a single diagnonal, is
it connected?)

The "most efficient way" may also depend upon architecture details
of the computer system being used to solve the problem. For example,
if the entire image easily fits within primary cache, then the efficient
algorithms available are going to differ from situations in which the
images are large and all of the data for one row (or column) is
consequative in memory, and are going to differ again from situations
in which the images are large but are stored as "tiles" in memory.

Thus the "most efficient way" is going to depend greatly on the details
of the assumptions you can make about your images and their internal
representation and about the characteristics of your computer system.

Finding "the most efficient way" could potentially be a matter of weeks
or months of research.

You'd probably have more success if instead you asked about
"reasonably efficient ways" instead of "the most efficient way".
</OT>
--
All is vanity. -- Ecclesiastes
Back to top
Morris Dovey
*nix forums addict


Joined: 22 Jun 2005
Posts: 90

PostPosted: Thu Jul 20, 2006 4:58 pm    Post subject: Re: Center of Contour [OT] Reply with quote

Speed (in 1153403385.696050.78980@i42g2000cwa.googlegroups.com) said:

| Could you please tell me what is the most efficient way of finding
| the center of mass of the area enclosed by a closed contour.
|
| I have a considerable circular region with streaks coming out of it
| in either direction. Basically i want to find the center of the
| circular region but it is getting offset due to the presence of
| connected outlier segments.
|
| I am working with binary images only.

Soumyadip...

It's not really a difficult problem; but the answer would depend on
what you mean by "efficiency". Are you looking for the smallest code
footprint - or are you looking for fastest execution time?

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Back to top
Morris Dovey
*nix forums addict


Joined: 22 Jun 2005
Posts: 90

PostPosted: Fri Jul 21, 2006 5:05 am    Post subject: Re: Center of Contour [VOT] Reply with quote

Morris Dovey (in FFOvg.3$HO.119@news.uswest.net) said:

| It's not really a difficult problem; but the answer would depend on
| what you mean by "efficiency". Are you looking for the smallest code
| footprint - or are you looking for fastest execution time?

I thought it might be an interesting exercise. Including some #defines
to parameterize the problem, the solution took fewer than 2 dozen
statements. It was compact _and_ fast.

Pleased with myself, I leaned back and thought about possible/probable
uses for the code...
....and then deleted the files.

Sometimes life just sucks.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
Back to top
Soumyadip Rakshit
*nix forums beginner


Joined: 21 Jan 2006
Posts: 9

PostPosted: Fri Jul 21, 2006 11:06 am    Post subject: Re: Center of Contour [OT] Reply with quote

I am working with a 120x160 binary edge image and by efficient I mean -
mostlly speed of execution.


"Morris Dovey" <mrdovey@iedu.com> wrote in message
news:FFOvg.3$HO.119@news.uswest.net...
Quote:
Speed (in 1153403385.696050.78980@i42g2000cwa.googlegroups.com) said:

| Could you please tell me what is the most efficient way of finding
| the center of mass of the area enclosed by a closed contour.
|
| I have a considerable circular region with streaks coming out of it
| in either direction. Basically i want to find the center of the
| circular region but it is getting offset due to the presence of
| connected outlier segments.
|
| I am working with binary images only.

Soumyadip...

It's not really a difficult problem; but the answer would depend on
what you mean by "efficiency". Are you looking for the smallest code
footprint - or are you looking for fastest execution time?

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto

Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [5 Posts] View previous topic :: View next topic
The time now is Sun Nov 23, 2008 12:35 pm | All times are GMT
navigation Forum index » Programming » C
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Center of Contour Speed C++ 3 Thu Jul 20, 2006 1:50 pm
No new posts Bug#377777: ITP: elisa -- media center solution Loïc Minier devel 0 Tue Jul 11, 2006 9:20 am
No new posts Linux (SuSE) multimedia center Esben Taersker Suse 1 Fri Jun 30, 2006 9:01 pm
No new posts [OT] Python programmer resource center Paolo Pantaleo Debian 4 Sun May 28, 2006 10:40 am
No new posts How to control color of contour lines? Grant Edwards python 2 Sat May 27, 2006 5:45 pm

MPAA | Loan | Adverse Credit Remortgage | Western Union Money Transfer | Credit Cards
Copyright © 2004-2005 DeniX Solutions SRL
 
Other DeniX Solutions sites: Unix/Linux blog |  electronics forum |  medicine forum |  science forum | 
Privacy Policy


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1798s ][ Queries: 16 (0.0916s) ][ GZIP on - Debug on ]