5
$\begingroup$

I am currently building a project that takes fisheye images from cameras and detects whether the picture contains a meteor, and if it does it tries to identify where the meteor is.

The images look like this:

I am currently building a project that takes fisheye images from cameras and detects whether the picture contains a meteor.

The images look like this: enter image description here

The 'circle' in the middle is the actual sky, everything outside it is just black pixels

The meteor is the long flash of light in the middle, the small flashes of light on the 'sides' are lights that come from the cities nearby.

Using opencv's HoughLines I was able to create a program that detects the meteors, however it also detects the lights on the 'sides', so my idea was to train a neural network to only detect the meteors.

How would I go about doing this? I was thinking of using a U-Net neural network, using the images and masks of the images where only the meteor is 'detected' for training, sort of like this example.

$\endgroup$
4
$\begingroup$

This is not a NN solution but can you adjust the parameters to opencv's HoughLine? There should be a way to find just the straight lines. There should be a way to adjust the minimum line length value to be considered a meteors. Meteors will always appear straight. So only keep the results when the points have similar slopes and are near each other?

See this example:

import cv2
import numpy as np

img = cv2.imread('dave.jpg')
gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
edges = cv2.Canny(gray,50,150,apertureSize = 3)
minLineLength = 100
maxLineGap = 10
lines = cv2.HoughLinesP(edges,1,np.pi/180,100,minLineLength,maxLineGap)
for x1,y1,x2,y2 in lines[0]:
    cv2.line(img,(x1,y1),(x2,y2),(0,255,0),2)

cv2.imwrite('houghlines5.jpg',img)

Source

$\endgroup$
3
  • $\begingroup$ Why will meteors always appear straight? $\endgroup$ – kbrose Dec 19 '18 at 23:46
  • $\begingroup$ Yes, the meteors will pretty much always be straight, or have only a very slight curvature $\endgroup$ – HmirceaD Dec 20 '18 at 6:26
  • $\begingroup$ Thank you for the opencv solution, I will try this along the nn :) $\endgroup$ – HmirceaD Dec 20 '18 at 6:28
1
$\begingroup$

A convolutional neural network will almost certainly work well for this problem. A U Net is overkill. You would use that if you need to identify where in the image the meteorite is.

Just make sure you augment your data set by rotating your example images.

$\endgroup$
6
  • $\begingroup$ And due to that, you need to augment the front layer to accommodate for the additional non rotation invariant filter you sill require. $\endgroup$ – Matthieu Brucher Dec 19 '18 at 19:07
  • $\begingroup$ I don't know what you mean. Can you explain what the "that" is in "And due to that"? $\endgroup$ – kbrose Dec 19 '18 at 23:45
  • $\begingroup$ Actually could you explain your whole comment? I don't know what you mean by any of it. $\endgroup$ – kbrose Dec 19 '18 at 23:48
  • $\begingroup$ Yes, I forgot to mention I also need the position of the meteor on the image in orded to get it's real life coordinates and to do some further analyzing $\endgroup$ – HmirceaD Dec 20 '18 at 6:25
  • $\begingroup$ To accommodate for the rotation, you need to get more nodes on your CNN layer. That means more training, more data, more chance for under or overfitting. $\endgroup$ – Matthieu Brucher Dec 20 '18 at 8:12
1
$\begingroup$

As you want some rotation invariance to your neural network, traditional convolutional layers will not be enough. Of course, you can try to see how much data you would need to use only traditional CNN layers.

I would advise to look at RIFD-CNN as a starting point (cited lots of times despite being "quite" recent).

To get the position, you can backtrace in your NN up to the pool layers to see which part where activated. Once you have the part that are activated, you can know the position of your object.

$\endgroup$
0
$\begingroup$

"detects whether the picture contains a meteor, and if it does it tries to identify where the meteor is."

This sounds like a classical object detection problem.

So you can find some existing object detection models and train them on your own dataset.

Tutorial about training existing object detection model on your dataset: https://tensorflow-object-detection-api-tutorial.readthedocs.io/en/latest/training.html

Another object detection model which could be trained on custom dataset: RetinaNet.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.