⭐
Counting Stars
Week 18
You have been contacted by some scientists about the ability to process astronomical images - first, they want you to be able to determine an approximate count of both the number of stars in an image and the percentage of that image (star coverage - given as a percentage) that contains stars (as opposed to the void of space)
The following extremely small, 10x10 and 16x10 images (can be downloaded here and here) can be used for testing/as an example, to make sure your program is working
If you save the images from the links above, you will see the first image contains:
- 6 stars: (the 4 small stars, the 1 bigger square star and the diagonal star in the top right)
- 10% star coverage i.e. 10% of the image is considered to be stars, while 90% is considered to be empty space
While for the second image:
- 3 stars
- 31.25% star coverage
The exact method of calculation isn't given, since for real projects you won't be given a pre-known algorithm or step by step sequence to solve it. It is down to you to choose a reasonable approach and experiment until you have a solution you believe to be giving accurate answers
The two images you should use are shown below - make sure to right click and download them so they are saved in full resolution, rather than e.g. taking a screenshot
Note: you don't need to get an exact answer for this challenge - as long as your answer falls within a range, it will be marked correct and you will be awarded the challenge points :)
Image 1
Image 2
Hints
Hints will be released at the start of each of the following days - e.g. the start of day 3 is 48 hours after the challenge starts
| Release Day | Hint |
|---|---|
| 2 | |
| 3 | |
| 4 | |
| 5 |