A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2005-September/295732.html below:

Straight line detection

Straight line detectionTim Roberts timr at probo.com
Fri Sep 30 02:41:39 EDT 2005
"PyPK" <superprad at gmail.com> wrote:
>
>Does anyone know of a simple implementation of a straight line
>detection algorithm something like hough or anything simpler.So
>something like if we have a 2D arary of pixel elements representing a
>particular Image. How can we identify lines in this Image.
>for example:
>
>ary =
>[[1,1,1,1,1],
> [1,1,0,0,0],
> [1,0,1,0,0],
> [1,0,0,1,0],
> [1,0,0,0,1]]
>So if 'ary' represents pxl of an image which has a horizontal line(row
>0),a vertical line(col 0) and a diagonal line(diagonal of ary). then
>basically I want identify any horizontal or vertical or diagonal line
>anywhere in the pxl array.

If all you want is horizontal, vertical, or 45 degree diagonal, it's pretty
easy to do that just be checking all of the possibilities.

But what if your array is:

 [[1,1,1,1,1],
  [1,1,1,1,1],
  [1,1,1,1,1],
  [1,1,1,1,1],
  [1,1,1,1,1]]

Would you say there were 12 lines there?
-- 
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.

More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4