TransWikia.com

count stars from an image , is this possible with mathematica?

Mathematica Asked on June 17, 2021

I was wondering if "MATHEMATICA" with the amount of instructions it has has any to count points in an image, in this case stars, I imagine comparing contiguous pixels and if they are not black mark 1 or 0 if not with some percentage precision.
There is some instruction capable of processing an image under these conditions.
This concern stems from a documentary by the hubbe telescope, which points to a certain place and the program’s announcers say that there are 30,000 galaxies that are seen as points of light.
I would appreciate some example.
I attach some images

enter image description here

enter image description here

enter image description here

One Answer

A minimum solution is:

img = Import["https://i.stack.imgur.com/qAfcx.jpg"]; (*first image above*)

ComponentMeasurements[
  Binarize[img],
  "Count"] // Length (*returns: 1018*)

Binarize converts it into a black and white image. There are options to control the thresholding.

ComponentMeasurements with the property Count returns a list of rules describe the components and the number of pixels. In many cases, we get 1 pixel, but there are some larger values

Length just determines how many entries are in the returned list, i.e., how many components.

Certainly, one could also use MorphologicalComponents as well for a task like this.

Answered by Joshua Schrier on June 17, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP