Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 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
|
||||
)
|
||||
4
Task/Hough-transform/J/hough-transform-2.j
Normal file
4
Task/Hough-transform/J/hough-transform-2.j
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
require 'viewmat'
|
||||
require 'media/platimg' NB. addon required pre J8
|
||||
Img=: readimg_jqtide_ jpath '~temp/pentagon.png'
|
||||
viewmat 460 360 houghTransform _1 > Img
|
||||
Loading…
Add table
Add a link
Reference in a new issue