Ask Your Question
1

Detecting earth limb

asked 2017-01-03 16:16:35 -0600

image detective gravatar image

updated 2017-01-04 19:43:39 -0600

The original image is : C:\fakepath\limb_edge_fl28_iss3628.jpg

I would like to detect whether the earth limb (the curvature of the earth from space) is in an image taken from space. An example image is :C:\fakepath\SmallISS043-E-3097.jpg

I could use edge detection to get the earth limb, and get the contour line, but how can I determine if the contour line is the curvature of the earth?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
1

answered 2017-01-03 18:54:29 -0600

Tetragramm gravatar image

Hmm, lots of ways, but what's the best?

Do fitEllipse and then see what percentage of the contour is on the ellipse? You'd have to reconstruct the ideal ellipse and decide what's "close enough" to the ideal to count as on the ellipse.

MatchShapes on an idealized earth limb? Possibly too much variation.

Find the convexHull and convexityDefects and make sure there's only one large one? What's large and how many small defects are ok?

My bet is on fitEllipse being the best, but it's a fair amount of work. I'd give them a try and find out.

edit flag offensive delete link more

Comments

I tried using MatchShapes on the contours, but the trouble is that the moments of the earth limb all come out 0 (why?)

print "Hu moments of cnt1, cnt2" print cv2.HuMoments(cv2.moments(cnt1)).flatten() print cv2.HuMoments(cv2.moments(cnt2)).flatten()

image detective gravatar imageimage detective ( 2017-01-04 11:43:44 -0600 )edit

Not enough information for me to guess. Do you actually have a contour 1 and 2? I mean, they aren't empty or something, are they?

Tetragramm gravatar imageTetragramm ( 2017-01-04 18:08:01 -0600 )edit

They are definitely not empty, I've drawn them, and also measured the arc length.

image detective gravatar imageimage detective ( 2017-01-04 19:01:31 -0600 )edit

Can you include the images and code you're using to make the contours in the question?

Tetragramm gravatar imageTetragramm ( 2017-01-04 19:09:26 -0600 )edit

Here's the code to get moments of the limb contour : img2 = cv2.imread(r'limb_edge_fl28.jpg') gray2 = cv2.cvtColor(img2, cv2.COLOR_BGR2GRAY) thresh2 = cv2.threshold(gray2, 127, 255, cv2.THRESH_BINARY)[1] (_,contours,hierarchy) = cv2.findContours(thresh2,2,cv2.CHAIN_APPROX_SIMPLE) cnt2 = contours[0] print cv2.moments(cnt2)

image detective gravatar imageimage detective ( 2017-01-04 19:28:38 -0600 )edit

I added the image to the original question

image detective gravatar imageimage detective ( 2017-01-04 19:31:36 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-01-03 16:16:35 -0600

Seen: 354 times

Last updated: Jan 04 '17