Images and Rectangles

R

Ruby Nadler

Hi everyone,
i need help in finding zones in image (newspaper articles):
i have image with array of rectangles (in the links below)
http://www.ifat.com/temp/b.jpg
http://www.ifat.com/temp/a.jpg

on the image are painted all the rectangles from the array so i have each
rectalnlge position and size.
i need an idea how to unite some blocks so at the end i will be able to mark
columns on the images or different sections.
Thanks,
Ruby
 
T

Tuukka

Try to find column width.

Picture A is simpler it is the longest rentacle.
B is harder you need get start position of first rentacle and ending
coordinates of last rentacle of colum. Probably calculate this in couple of
times (first line get incorrent result).

Now compare rentacles in avarge width. If it smaller the the paragraph will
end.
Continueng this bottom of image get column.

You can see titles by checking rentacle heights.
 
R

Ruby Nadler

Hi tuuka,
i didnt understand you. some of the blocks are very small (contains word or
two). other contains all the line. also the height is not the same in all
rectangles.
thanks,
ruby
 
T

Tuukka

Hmm i try to explain it simpler. Let's take picture A.
Looking for rentacle 9 "demanding that Mayor Hai Adiv explain why".

We need the lenght of that rentacle to detect colum. Let say this is
colum_lenght.
To detect colum_lenght we also need avarge_column_height. Because titles
are diffrent sizes.

So the first think is make loop and calculate avarge avarge_column_height
for all rentacles. Then make second loop and look the longest rentacle that
has same height.

Now we can think making new text area rentacles based using colum_lenght. So
our new text area rentacle length should be colum_lenght + (some extra space).

You need to code logic to fix coordinates to begin. First line has little
indent.
To detect were new text area rentacle end is sum of all rentacles height
(who fits in avarge_column_height) < colum_lenght. rentacles 22-23.

I hope this helps.
 
R

Ruby Nadler

Hi Tuukka,
it okfro i col text (pic a).
for pic b with number of cold, i dont tink it will help. when working on
image i dont know how many cols it contains (if any).
thanks,
Ruby
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top