You are not logged in.

- Topics: Active | Unanswered

Who is the Original poster you're reffering to?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

That is a good question. He has glasses, a beard and short hair.

**In mathematics, you don't understand things. You just get used to them.**

**I agree with you regarding the satisfaction and importance of actually computing some numbers. I can't tell you how often I see time and money wasted because someone didn't bother to run the numbers.**

Offline

Anonymnistefy?

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

bobbym wrote:

He has glasses, a beard and short hair.

Like this?

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

I was talking about this fellow.

Anyway, did anyone try those commands on the OP's picture?

**In mathematics, you don't understand things. You just get used to them.**

Offline

Yes, I did whatever was on that help page replacing their picture with mine and it did not work

'And fun? If maths is fun, then getting a tooth extraction is fun. A viral infection is fun. Rabies shots are fun.'

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

I did it too but I do not understand enough about image processing and its commands to alter them for your problem. I am working on it though.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

I also tried it - M's 'Analyze Segmented Cells in an Image' ("ASCI") program - and failed.

I found something on the net and used it on Agnishom's image - see my first image. Pasting my image into ASCI gave the result "0".

The code is from here.

Just paste the cropped version of Agnishom's image from my post #35 into M immediately before the semicolon in the first line.

I haven't worked out how to include the white balls in the colour change operation, though, which is something I wanted to do and then somehow count all same-coloured balls, but maybe that's not critical.

The program from the second image numbered the cells that it found (including some that overlap), but the count numbering is wrong (see Edit below) and not all overlapping cells are identified. ASCI didn't count any overlapping cells, nor any that just touched (eg, #77 in the second image). And ASCI found #69 but not #38. Also, ASCI only found 31 cells compared with this program's 65.

ASCI can probably be tweaked to find touching/overlapping balls...and in Agnishom's image the overlapping is only slight.

The code is from here.

Just paste the cropped version of Agnishom's image from my post #35 into M immediately before the semicolon in the first line.

Where to go from here with that info or how to gauge if it's at all useful for us...

Edit: Adding the line "measures // Length" to the end of the program for the second image gives the actual count: 65. Maybe the missing numbers refer to marks (eg, blotches, incomplete cells) that the code deemed to be invalid but still included them in the numbering (invisibly).

*Last edited by phrontister (2014-01-28 01:06:37)*

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

Hi phrontister;

Link please.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

Here's another coding option I found on the net. This one, unlike others I've tried, at least recognizes (I think) some, but not all, of the balls.

It doesn't draw circles around the balls properly and the numbering is strange, but it found 199 objects (balls?)...and it drew about that number of circles (I didn't count them).

The code is from StackExchange, here.

StackExchange had .81 where I've got .7 in line 2. I played around with several options, and that was close to the best.

You'll need to paste Agnishom's image (just use my cropped one below) immediately before the semicolon in the first line.

The last image shows the result I got in M by pasting the StackExchange image into their code (with their .81 in the second line instead of my .7).

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

Hi;

Okay, I am looking at it now.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

Hi Bobby,

I included two links in post #33 just now.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

I do not remember but what was the actual count of the balls?

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

485

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

Because of the black background it looks like the programs are counting the spaces rather than the balls.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

But not with the green background in the third image of post #35...

...and the rings around those shapes are correctly positioned.

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

But not when you apply it to Agnishom's picture.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

I changed the background colour of the third image in post #35 and got these strange results. Hmm...

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

Hi;

Very confusing and doubly so because I have no idea what any of the commands are doing.

See you later, need some sleep.

**In mathematics, you don't understand things. You just get used to them.**

Offline

**phrontister****Real Member**- From: The Land of Tomorrow
- Registered: 2009-07-12
- Posts: 4,006

Ditto!

It's not making any sense to me either, and I think it would be a loooong, steeeep, uphill road to make this work...if that's even possible. What might have helped is a background of constant shade and of a colour quite different from the balls.

I'm at a total loss and would need to dive into M and graphics analysis/processing at the deep end before I could be of any real help, and of course that's not on.

I've probably spent enough time on this, and I'm soooo far out of my depth here that it's probably about time I called it quits...unless you can revive my flagging interest.

Catch you later, and sleep well (I'm about to tuck in too). You never know...in the a.m. I might wake up rejuvenated, rearing to have another crack at it. Ha!

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

Hi;

I will do a little reading on it and see what turns up. See you tomorrow.

**In mathematics, you don't understand things. You just get used to them.**

Offline

I have an idea how it can be done, but I do not know enough programming to do it.

1. Use something like what is called a magic wand in Image editing software. It selects all the pixels which it thinks is of the same color as a given pixel to a certain thresold.

2. Count the number of discontinuous pieces of the unselected region. This can be done by scanning the whole image pixel by pixel and incrementing the counter by one whenever the current pixel is outside a selection and a immediate neighbouring pixel is selected.

Alternate to 2: Divide the total unselected area by the average area of 1 ball

'God exists because Mathematics is consistent, and the devil exists because we cannot prove it'

'You have made another human being happy. There is no greater accomplishment.' -bobbym

Offline

**bobbym****Administrator**- From: Bumpkinland
- Registered: 2009-04-12
- Posts: 93,925

but I do not know enough programming to do it.

That is how I am trying but I know little about image processing so the commands are difficult to understand so how can the program be done?

**In mathematics, you don't understand things. You just get used to them.**

Offline