COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Different Euler Numbers from regionprops and bweuler

• Email
• Follow

```I have two cases where the calculation of Euler Number using
4-connected neighborhoods that is done using regionprops and with
bweuler are different (0 and 1 in one case, -1 and 1 in the other).

Why would they every be different?

To calcluate Euler Number using regionprops, I read in a binary
file into I using imread. I label the areas and find the largest
area (there`s only one in this case). Then, I calculate the number.
Here is the code:

[L,num_areas] = bwlabel(I,4);
area = regionprops(L,'Area');
[biggest_area,big_area] = max([area.Area]);
Euler_Number = regionprops(L,'EulerNumber');
Euler_Number(big_area).EulerNumber

Here is the line using bweuler:

Euler_Number = bweuler(I,4)

In each case, there is only one region in the image.

Thanks, Alan
```
 0
Reply jalanthomas (126) 6/25/2007 5:51:35 PM

See related articles to this posting

```Alan wrote:
> I have two cases where the calculation of Euler Number using
> 4-connected neighborhoods that is done using regionprops and with
> bweuler are different (0 and 1 in one case, -1 and 1 in the other).
>
>   Why would they every be different?
>
>   To calcluate Euler Number using regionprops, I read in a binary
> file into I using imread. I label the areas and find the largest
> area (there`s only one in this case). Then, I calculate the number.
> Here is the code:
>
> [L,num_areas] = bwlabel(I,4);
> area = regionprops(L,'Area');
> [biggest_area,big_area] = max([area.Area]);
> Euler_Number = regionprops(L,'EulerNumber');
> Euler_Number(big_area).EulerNumber
>
>   Here is the line using bweuler:
>
> Euler_Number = bweuler(I,4)
>
>   In each case, there is only one region in the image.
>
>
>           Thanks, Alan

regionprops always performs the Euler number computation using
8-connected neighborhoods.

--
Steve Eddins
http://blogs.mathworks.com/steve
```
 0
Reply steve.eddins (785) 6/25/2007 6:40:19 PM

```Steve Eddins wrote:
>
> regionprops always performs the Euler number computation using
> 8-connected neighborhoods.
>

I did not see this in the documentation. Also, it would be good
in the future if MATLAB supported both, for flexibility and for
compatibility with whole image Euler Number calculation.

Alan
```
 0
Reply jalanthomas (126) 6/25/2007 10:52:46 PM

```Alan wrote:
> Steve Eddins wrote:
>> regionprops always performs the Euler number computation using
>> 8-connected neighborhoods.
>>
>
>    I did not see this in the documentation. Also, it would be good
> in the future if MATLAB supported both, for flexibility and for
> compatibility with whole image Euler Number calculation.
>
> Alan

I take your point about flexibility, but I'm not sure what you mean by
compatibility.  The default connectivity used by bweuler is 8, which is
consistent with what regionprops does.

--
Steve Eddins
http://blogs.mathworks.com/steve
```
 0
Reply steve.eddins (785) 6/26/2007 1:17:04 AM

```Steve Eddins wrote:
> I take your point about flexibility, but I'm not sure what you mean
> by
> compatibility. The default connectivity used by bweuler is 8,
> which is
> consistent with what regionprops does.

Just that it would make more sense if regionprops and bweuler
worked the same way, letting the user specify whether to use 4 or 8.

Thanks, Alan
```
 0
Reply jalanthomas (126) 6/26/2007 1:34:26 AM

4 Replies
50 Views

Similar Articles

12/11/2013 9:23:26 PM
[PageSpeed]

Similar Artilces:

Insert column different number
Dear all, I have a simple problem. From a lot of data files I am creating a file using awk like that awk "NR==\$n*\$n/2+\$1 {print }" evals.N\$n\H\$h\L\$L\.dat >> spec\$1\.dat Where lot of value is been fed from the bash script(\$n,\$h,\$L) (this is the single awk line I am using.) Now that gives me perfect one line column data which I want. data1 data2 data3 .. .. Now I want to modify this file by not only writing the data alone but also writing a variable of bash (\$h) before each data such that now my data will look like the following, \$h data1 \$h data2 \$h data3 ... and so on....

odd row and numbering with difference 20
Hi, I want to print only the odd rows from a file. Than I want to numbering it with difference 20. Is there anybody who could help me? Thanks in advance Regards, Beta Beta wrote: > Hi, > I want to print only the odd rows from a file. Than I want to numbering > it with difference 20. Is there anybody who could help me? > > Thanks in advance > > Regards, > Beta > Is this what you mean: \$ cat file 1 2 3 4 5 6 7 8 9 \$ awk 'NR%2{print c+=20,\$0}' file 20 1 40 3 60 5 80 7 100 9 Regards, Ed. Thanks a lot, Ed Beta Le Fri, 13 Jan 2006 06:55:44 -0600, Ed...

loop for, different numbers of values in solutions
In a loop "for' I have to do some calculation. After each passing through the loop a solution consisted of several values will be obtained. Number of values in each solution may be different. I have to have each solution remembered separately, or something like: solution after first passing is ..., after the second is ...,after the third is ... I don't know how to do that. Could somebody help please? "Vlado Mar" <marasv@verat.net> wrote in message <gi7vnp\$j26\$1@fred.mathworks.com>... > In a loop "for' I have to do some calculation. After each pa...

Varying the number of authors shown in different entries
Dear All, Using BibTeX with a LaTeX document, I would like to be able to make bibliographic entries be a little more complete than most. In particular, I usually just cite one author and then "et al.", but I would like to be able to choose some entries (in the .tex source) that would contain the full author list. I would very much appreciate any suggestions on how to do this. One thought that I had was to alter the BST file I use, so that I would e.g. \cite{!mykey} for those entries which should appear in full. However, since the BST "READ" command seems to atomically re...

Functions in partial differential equations with different number of
Hi, I was trying to solve the following set of PDE: s=0.01; NDSolve[{-I*D[R[x,t],x] + (s/(Pi (x^2+ s^2)))*F[t] ==I*D[R[x,t],t], 2 F[t] + R[0,t]== I*D[F[t],t], R[-20, t]==R[20,t], R[x,0]==Exp[-(x+5)^2], F[0]==0},{R, F}, {x,-20, 20}, {t, 0,10}] where I is the imaginary number Sqrt[-1]. However, Mathematica gave an error message saying that A and F have different number of dependent variables: "NDSolve::"dvlen" : "The function F[t] does not have the same number of arguments as independent variables (2)." This set of equations simulate a one-dimensional wa...

How to build a procedure that returns different numbers of columns as a result based on a parameter
/* Subject: How to build a procedure that returns different numbers of columns as a result based on a parameter. You can copy/paste this whole post in SQL Query Analyzer or Management Studio and run it once you've made sure there is no harmful code. Currently we have several stored procedures which final result is a select with several joins that returns many columns (150 in one case, maybe around 50 the average). We have analyzed our application and found out that most of the time not all the columns are used. We have identified 3 different sets of columns needed in different parts of ...

Fibonacci Numbers and Lucas Numbers
I'm having some problems with the below equation. I have no problems when it comes to positives. Negatives create the problem.. C 2 1 4 However, this doesn't work: C -60 37 -5 Any help? I appreciate it greatly!!! #include <iostream> #include <cstdlib> #include <cmath> using namespace std; bool isFibonacciNumber (int); unsigned findFibonacciNumber (int); bool isLucasNumber (int); unsigned findLucasNumber (int); bool isInSequence (int, int, int); unsigned findInSequence (int, int, int); int main() { char choice; int n, i; int var1; int var2; cout <&...

Different Syntax for Different Assemblers
Hi all, I've just started learing assembly language and have obtained some tutorials and the MASM assembler for use. However, the tutorials assume that the reader have the TASM. I just want to know whether different assemblers( here MASM and TASM) have different syntax for the assembly code or not. Also if the code written for TASM is incompatible with MASM then what can I do to solve the problem? Many thanks in advance, James "James" <spamtrap@crayne.org> wrote in message news:1118851680.920342.142400@g44g2000cwa.googlegroups.com... > Hi all, > I've just sta...

Different sessions in different windows?
Hi all, The title says it all - I'm doing sessions with cookies. I can divide the data within the session easily enough but I can't see when the user creates a new window or closes an old one. TIA, C. What happens on the client web browser is not necessarily communicated to the web server. You cannot tell when the user creates or closes a browser window as nothing is sent to the server. The only time that the server knows what happened is when it receives an HTTP request (using either the GET or POST methods). -- Tony Marston http://www.tonymarston.net "Colin McKinno...

Forecasting numbers based on number frequencies.
Hello, I've evaluated several examples of (semi-random-number) sequences for the ojectives of forecasting. On quite a few evaluations, I've noticed that forecasted numbers were plus or minus one-away from the most frequently occuring numbers in given sequences; especially if the more frequent numbers are clustered together in numerical order. Still, it is not always possible to determine which frequent numbers, adn clusters are favorable for analysis. What type of analysis attempts to predict next-occuring numbers based on number frequencies? Any downloads available? Thank-you so...

Choice Number vs. Chromatic number.
Can any one give me a graph whose choice number is strictly greater than its chromatic number? Where: Here graph means an undirected self-loops-free graph. The chromactic number of a graph G is the least integer k such that G is k-colorable. (Each vertex gets a color form {1, 2, .., k} suc that no two adjacent vertices get teh same color). The choice number of a a graph is the least integer k such that for every family of sets {S1, S2, ..., Sv} such that |Si|=k for every i in 1..v, there is a coloring C for the graph G where Ci in Si for every i in 1..v. The choice number of the complete...

getting the left 2 numbers of a number
if x=1234567 how can I get the first two left digits i.e 12 using matlab?. in excel it is easy : left(x,2) but I couldn't find a left function in matlab "joseph Frank" <josephfrank1969@hotmail.com> wrote in message <h575n6\$7vg\$1@fred.mathworks.com>... > if x=1234567 > how can I get the first two left digits i.e 12 using matlab?. in excel it is easy : left(x,2) but I couldn't find a left function in matlab one of the solutions x=1234567; % <- a DOUBLE s=sprintf('%d',x); s=s(1:2) % s = 12 % <- a CHAR string us "...

single random number (not a vector of numbers)
I'm fairly new to Simulink. I read a previous thread on how to produce a random number and it was helpful. However, I need to produce a single random number and not a series of random numbers. I would like for only 1 random number to be passed through to my function each time I run a simulation. I'm using Constant(1)-->function rand()-->scope. ...

FormatPercent rounds differently on different computers?
I have two machines, and FormatPercent() returns different values on the different machines. I'm using vb6. Machine 1 is an AMD64 laptop with XP sp2. ?formatpercent(.225,0) 23% Machine 2 is an intel pentium 4 desktop with XP, but no sp2 ?formatpercent(.225, 0) 22% Why is one machine rounding up, and the other rounding to even (banker's rounding)? ...

is it possible to specify different font for different buffer
Hi, there Sometimes I find it necessary to use one font (fixed pitch) for coding, and another font for other purpose. What can I do? thanks in advance. litchie On Apr 22, 10:21 am, litchie <licha...@gmail.com> wrote: > Sometimes I find it necessary to use one font (fixed pitch) for > coding, and another font for other purpose. What can I do? It's not clear exactly what you're trying to achieve, but you might want to try one of these: - M-x customize-face RET default RET, then change the font family setting. To apply the change, select one of the first two options (i....

FA: NAUTICAL NUMBER hunt Have fun with numbers
http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&rd=1&item=7106112554&ssPageName=STRK:MESE:IT -- Find this and more at our fully searchable EBAY shop: http://stores.ebay.co.uk/AUCTI0NST0P For Children's Games, Educational, Language & Recreational Software ...

Bitmap prints differently on different computers (repost)
I have a report with an OLE bound frame. A bitmap has been pasted into the bound field. The bitmap displays and prints differently on different computers. In particular, the alignment is different. Both computers are using the same printer. What can I do to work out why the bitmap rendering is different on different computers? (david) Do both computers use *exactly* the same version of the printer driver? -- HTH Van T. Dinh MVP (Access) "david epsom dot com dot au" <david@epsomdotcomdotau> wrote in message news:436a9d2b\$0\$66350\$c30e37c6@lon-reader.news.telstra.n...

How to input data from different column for different rows
I am wondering if there is a way to use "input" statement to read in data that are in different columns. For example, if I have the following data: 77343 A XX XX 2 7 B XX XX 2 2 2 c XX XX I want to start reading in the data from the letters, i.e. the first variable value for each obs will be A, B, and c respectively. However, A, B, C are not in the same column. The data before A, b, and c is really a mess so you can't use list\formatted input. I am new to SAS. please forgive me if this question is stupid. Thank you in advance. Read the entire record into a long charac...

The difference?
Hello I wanted to find out the difference between buying a laptop and an apple laptop? so for instance is the setup the only difference? The Apple iBook G4 and any other laptop? Can anyone give me detailed spec info on the Apple iBook G4 and how it compares to any other laptop? Thanks Bye :) ...

Different document classes rendering figures different?
Hello, I'm composing a thesis and an article at the moment. For some reason, figures I've created in MATLAB with the aid of LaPrint.m render perfectly in my document with \documentclass[12]{article}, as shown here: http://www.prism.gatech.edu/~gtg611a/TeX/good.jpg However, when using \documentclass[12]{gatech-thesis}, the legend font increases and I get this: http://www.prism.gatech.edu/~gtg611a/TeX/bad.jpg The gatech-thesis.cls files and all related files can be found here: http://www.prism.gatech.edu/~gtg611a/TeX/gatech-thesis.zip The figure created using the following input ...