Find meteor trails in noisy images

I have several hundred images from a timelapse of the night sky. My goal is to detect meteors, which basically appear as streaks that are green at one end and reddish at the other. Example:

What’s the right way to do this? After a bunch of tinkering, I’ve gotten this far:

  1. Resize image using pyrDown(). The softer image results in a less noisy image, which seems to help with line detection. Otherwise, I think a median blur really helped with removing most of the stars and ISO noise.
  2. Use cv::ximgproc::FastLineDetector to detect lines:

Result (sorry I can’t embed more than one image)

I know I can probably focus on a particular ROI to ignore the horizon. But instead of one line for the meteor streak, there are multiple line segments along the “sides” of the meteor streak.

  1. I had stumbled on the idea dilation and erosion to create a skeleton. After tweaking the kernel sizes, I get something like this:


So, it sort of works, but I’m really questioning my approach, especially since I don’t want to be manually tweaking parameters for every image.

Furthermore, if there are clouds or airplanes at the same time, this approach falls apart. I’ll post a reply with a link to those images since I can’t post more than two links. But basically, the part of the meteor streak that’s behind the clouds isn’t detected, and tweaking the FLD parameters didn’t seem to help. Also, the airplane trail wasn’t detected as a line in this particular image, but I could see it being an issue.

Any ideas? Willing to do something completely different, of course.

Here’s that other image:

And here’s the FLD result:

Are you operating on the raw image, or have you already done some processing before the pyrDown()?

Depending on how frequently you are capturing images, one possible approach would be to use image differencing as a first step - the resulting image will be almost entirely black (or at least low values) and you can apply a threshold so that only the differences show up. You could end up with speckle noise or leading/trailing edge artifacts (say if the clouds moved between frames), and you might try cleaning that up with a median filter or some morphological steps - but I think you’d risk “erasing” your meteor streak if you aren’t careful.

I’d probably find contours and then see if you can come up with some basic attributes that let you filter good from bad. Like how well a line fits to the contour, minimum area of the contour, aspect ratio of the (rotated, not axis aligned) bounding box, etc. Kind of hacky / ad-hoc methods, but I bet you can get pretty far with that.

1 Like

I’m operating on the raw image (first converted to TIF so that OpenCV can open it).

The images are captured every 20 seconds, so there are lots of differences due to the stars moving. I tried tinkering with image differencing, with median filtering to clean up the diffs, but the streaks do get lost in the process as you suspected. Link to source images in case anyone’s interested: meteor detection help - Album on Imgur

I’ll try tinkering with finding contours. Thanks for the ideas!