I have an aerial image, like thisship on top-right

I want to detect the outline of the ship without shadow. How can I do it? I tried threshold in both graylevel, RGB and HSV. It doesn't work perfectly.


Laplacian of Gaussian

  1. I have used Laplacian of a gaussian filtered image with sigma value of 3.

  2. I have thresholded the LoG image with a high-pass filter.

  3. I have used gray closing morphologic operator.

  4. I have filtered the blobs according to their area.

There are several more ways to do it depending on the images, conditions(sea), illumination, ships etc. For this image, non-color methods are preferable as shadows are not always predictable.

  • $\begingroup$ I have a question. Do you use RGB image in step 1, or use graylevel image? $\endgroup$ – user10433 Aug 14 '14 at 11:13
  • $\begingroup$ I used MATLAB fspecial('log') and filtered the image in each RGB channels. But MATLAB returns only the mask, not the LOG image. $\endgroup$ – user10433 Aug 14 '14 at 11:38
  • $\begingroup$ I used RGB image but it would not be different if you use grayscale. You can just filter the grayscale image with "fspecial". You need to use the filter that you have created with "fspecial" in "imfilter" to see the LoG image. $\endgroup$ – Tyathalae Aug 14 '14 at 11:44
  • $\begingroup$ I tried H = fspecial('log',[5 5],3). and filtered the image using imLOG = imfilter(im,H,'replicate'). After that, I used imshow but it showed only black image. I thought maybe sigma is too large. $\endgroup$ – user10433 Aug 14 '14 at 12:00
  • $\begingroup$ Yes, sigma values are somewhat different to the software that I am using. You can experiment with the values to tailor algorithm for your needs. $\endgroup$ – Tyathalae Aug 14 '14 at 12:22

How's this: This is what I managed.

I converted it to LAB space, took only the A channel, sharpened the contrast, and used a sobel edge detection. The outline is kind of rough, but pretty much only the ship shows up. If you are trying to find ships, then that seems like a good direction to start from.

Or how does this suit you: Blurred and sharpened This is the first image aftr blurring, sharpening the contrast and doing an unsharp mask.


I would suggest to go for a larger scale approach with pretrained object detection models building on top of convolutional neural networks.

If you do not want to train your own, you will find on our platform (www.picterra.ch) a ship detector in the detector library that you could simply apply on your image.

Hope this helps, Best


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.