How to plot horizon line in sea images

I am trying to find the horizon line in sea images. I did svm training and classification. In every image, I labeled some random background locations as negative and some locations on the horizon as positive. The algorithm is working. My question is how can I show horizon line in every image (like as straight line)? Because the horizon line is located differently in every image and sometimes there are objects such as ships in the middle of the horizon line. Here is the example what I am doing;
The first image is comparison of predicted labels and tested labels. Second and third images showing HoG feature extraction and the last image is ground truth of the original image.
Thank you.

Answers (1)

Please attach the original image so we can replace the gantrycrane image in the hough() documentation example to see if it works with your images. Also attach your worst case where the horizon is broken by ships but still largely visible (not totally obscured).
If hough() doesn't work then take your green points and run RANSAC on them.

4 Comments

Elf
Elf on 3 Jul 2017
Edited: Elf on 3 Jul 2017
Thank you for the answer. This is the original of the image;
And one of the worst case;
Please attach the original image HERE with the paper clip icon or frame icon. We want everything here in one place, not on some third party web site where they might vanish some day.
If someone wrote code for you, would you want to have to go over to stackoverflow.com or github to get it? Or would you want it posted here?
By the way, did you try the hough() demo yet?
I have tried Hough before with canny edge but sometimes it considers waves as a line in the sea. I did not understand other question about websites.
Then order this paper and follow the algorithm in it:
El merabet, Y.[Youssef], Ruichek, Y.[Yassine], Ghaffarian, S.[Saman], Samir, Z.[Zineb], Boujiha, T.[Tarik], Touahni, R.[Raja], Messoussi, R.[Rochdi], Horizon Line Detection from Fisheye Images Using Color Local Image Region Descriptors and Bhattacharyya Coefficient-Based Distance, ACIVS16(58-70).

Sign in to comment.

Asked:

Elf
on 3 Jul 2017

Commented:

on 3 Jul 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!