I want to segment the image below (click for bigger image) into columns based on the natural gaps that exist in the columns. The article columns should be perfectly vertical and need not be the same size, but should split each article column by itself.

I have tried Hough Line Transform, Scipy Label, convolution filters, specifying manual cuts, etc. all with very limited success and nothing I would consider a "solution".

What approach should I take to segment these types of images into columns? Preferably a solution that I can code myself or exists in OpenCV or Python.

My output should be a set of images which are cut from the input. Here is a sample of my output.The set of images should be like this enter image description here enter image description here

  • $\begingroup$ Can you please clarify what exactly do you expect your output to be from this? What does "...segment these types of images into columns" mean? By "images" here, do you mean "images of newspapers" or images within the newspaper pages? Are you looking for a bounding box or just vertical lines delineating where a column starts and stops? How about the vertical direction? Are you looking for "start/stop" markers for columns there too? $\endgroup$
    – A_A
    Oct 1, 2020 at 10:12
  • $\begingroup$ I want to extract each article present in the image as a new image. Segment these types of images means i want to crop the given image into various segments where each segment has a article in it.I am looking for a bounding box. $\endgroup$ Oct 1, 2020 at 10:24
  • $\begingroup$ So what you are really after is not only a bounding box around text that is formatted more or less like a newspaper column, but also text that belongs to the same article. So the extraction algorithm is looking to put a border around the article itself. So, as an additional step, the text that belongs to the same article would have to be grouped too. Does this sound correct? The first part is straightforward (marking columns), the second one is more involved. $\endgroup$
    – A_A
    Oct 1, 2020 at 10:43
  • $\begingroup$ Put border around the article and crop that article too. Can i know what does the line "text that belongs to the same article means"? $\endgroup$ Oct 1, 2020 at 10:54
  • $\begingroup$ A column here is a column of text. But "cutting" a vertical column without reference to its content could result in an extracted column containing text from more than one articles. What you are after is a delineation of the space an article occupies (possibly formatted in one or more columns). I think that it is worth including this in your question because it makes a difference. $\endgroup$
    – A_A
    Oct 1, 2020 at 12:07


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.