Crop image after stitching

asked 2015-11-02 05:45:06 -0600

alexandra gravatar image

Hello, After i stitched 2 images using OpenCV C++, i want to crop the image to remove the black area around the stitched imgae.

image description

How can i do that ??

edit retag flag offensive close merge delete

Comments

Dose this help you? Especially warper_creator, line 592

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-02 07:15:31 -0600 )edit

Also check out the answer here might be helpful.

Haris gravatar imageHaris ( 2015-11-02 07:23:31 -0600 )edit

thanks, but it not helps. I don't need to do transformation, i need to select the right corners to crop the image without any black area left.

alexandra gravatar imagealexandra ( 2015-11-03 23:18:27 -0600 )edit

Have you tried:

  • to detect the mask of the image (using threshold with threshold 0, using the largest contour and fill it if there are black area inside the image)
  • detect all the corners in the mask (maybe using Harris corners).
  • search the lower corner in the top half (largest y that is not larger than half of the image)
  • search the higher corner in the bottom half (smallest y that is not smaller than half of the image)
  • do the same with left and right halfs and corners.

I suppose this should do it ;)

thdrksdfthmn gravatar imagethdrksdfthmn ( 2015-11-04 02:59:28 -0600 )edit