I have to detect 'star' like shape in a image with php.Also the star is not fixed and may be at other position next time.I cannot use any external software or library.I have tried all methods like edge detection and grayscaling but all in vain.this is the image:
the main problem is I cannot clear the background. if image background is cleared than i can read all pixels color row wise as well as column wise and detect.please help me.this is the image after brightness_filter and edge detection.
For this particular image would suggest to perform a low amount of lowpass filtering (Gaussian blur) to attenuate those lines. That should work because thin lines have high frequencies at their transistions. And then you can try increasing the contrast and the brightness.
I just did a quick test and the result is something like that
Then just calculate the cross-correlation of your resulting image with images of different stars.
If the star itself isn't scaled or rotated, then you should be able to detect it from the 2D convolution of a clean star image with your source image.
If you are trying to find stars with different scales and rotations, it would probably be better to clean up the image with an erosion filter, then use edge detection and a Hough transform to find the edges.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With