A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
11
Task/Hough-transform/J/hough-transform-1.j
Normal file
11
Task/Hough-transform/J/hough-transform-1.j
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
NB.*houghTransform v Produces a density plot of image y in hough space
|
||||
NB. y is picture as an array with 1 at non-white points,
|
||||
NB. x is resolution (width,height) of resulting image
|
||||
houghTransform=: dyad define
|
||||
'w h'=. x NB. width and height of target image
|
||||
theta=. o. (%~ 0.5+i.) w NB. theta in radians from 0 to π
|
||||
rho=. (4$.$. |.y) +/ .* 2 1 o./theta NB. rho for each pixel at each theta
|
||||
'min max'=. (,~-) +/&.:*: $y NB. min/max possible rho
|
||||
rho=. <. 0.5+ h * (rho-min) % max-min NB. Rescale rho from 0 to h and round to int
|
||||
|.([: <:@(#/.~) (i.h)&,)"1&.|: rho NB. consolidate into picture
|
||||
)
|
||||
3
Task/Hough-transform/J/hough-transform-2.j
Normal file
3
Task/Hough-transform/J/hough-transform-2.j
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
require 'viewmat media/platimg'
|
||||
Img=: readimg jpath '~temp/pentagon.png'
|
||||
viewmat 460 360 houghTransform _1 > Img
|
||||
Loading…
Add table
Add a link
Reference in a new issue