Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(12956)

Issue 5395042: code review 5395042: graphics/edge: add canny edge detection

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 5 months ago by crawshaw1
Modified:
12 years, 5 months ago
Reviewers:
nigeltao
CC:
golang-dev
Visibility:
Public.

Description

graphics/edge: add canny edge detection

Patch Set 1 #

Patch Set 2 : diff -r fe88ad48021d https://crawshaw%40google.com@code.google.com/p/graphics-go/ #

Patch Set 3 : diff -r 1e7422ec8285 https://crawshaw%40google.com@code.google.com/p/graphics-go/ #

Patch Set 4 : diff -r 1e7422ec8285 https://crawshaw%40google.com@code.google.com/p/graphics-go/ #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+486 lines, -0 lines) Patch
A graphics/edge/Makefile View 1 1 chunk +13 lines, -0 lines 0 comments Download
A graphics/edge/canny.go View 1 2 1 chunk +87 lines, -0 lines 0 comments Download
A graphics/edge/canny_test.go View 1 1 chunk +33 lines, -0 lines 0 comments Download
A graphics/edge/gauss.go View 1 1 chunk +61 lines, -0 lines 1 comment Download
A graphics/edge/gauss_test.go View 1 2 1 chunk +122 lines, -0 lines 0 comments Download
A graphics/edge/sobel.go View 1 2 1 chunk +114 lines, -0 lines 3 comments Download
A graphics/edge/sobel_test.go View 1 2 1 chunk +56 lines, -0 lines 0 comments Download
A testdata/gopher-dog.png View 1 Binary file 0 comments Download
A testdata/gopher-log.png View 1 Binary file 0 comments Download
A testdata/prewitt-dir.png View 1 Binary file 0 comments Download
A testdata/prewitt-mag.png View 1 Binary file 0 comments Download
A testdata/scharr-dir.png View 1 Binary file 0 comments Download
A testdata/scharr-mag.png View 1 Binary file 0 comments Download
A testdata/sobel-dir.png View 1 Binary file 0 comments Download
A testdata/sobel-mag.png View 1 Binary file 0 comments Download

Messages

Total messages: 3
crawshaw1
Hello nigeltao@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://crawshaw%40google.com@code.google.com/p/graphics-go/
12 years, 5 months ago (2011-11-17 15:15:11 UTC) #1
crawshaw1
Two questions in here. First, should a subpackage have its own testdata dir? Second, I ...
12 years, 5 months ago (2011-11-17 15:17:20 UTC) #2
nigeltao
12 years, 5 months ago (2011-11-20 11:23:36 UTC) #3
I'm OK with a testdata/edge directory, and a graphics/graphicstest package.

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/gauss.go
File graphics/edge/gauss.go (right):

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/gauss.go#newco...
graphics/edge/gauss.go:14: // LaplacianOfGaussian approximates a 2D laplacian of
gaussian with a convolution kernel.
80 chars for doc comments.

"laplacian" and "gaussian" should also be capitalized.

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/sobel.go
File graphics/edge/sobel.go (right):

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/sobel.go#newco...
graphics/edge/sobel.go:77: angle := math.Atan(cy / cx)
What happens if cx == 0?

Also, rather than performing a relatively expensive Atan calculation in the
inner loop, can you instead compare cy/cx to ±(math.Sqrt2 - 1), etc?

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/sobel.go#newco...
graphics/edge/sobel.go:100: // dir pixels hold the rounded direction value
either 0, 45, 90, or 135.
The docs should say whether 45 means NorthWest/SouthEast or NorthEast/SouthWest.
I'd expect the former, consistent with Rotate(90) meaning clockwise, but IIUC
you've implemented the latter.

http://codereview.appspot.com/5395042/diff/11002/graphics/edge/sobel.go#newco...
graphics/edge/sobel.go:101: func Sobel(mag, dir *image.Gray, src image.Image)
error {
"magDst" and "dirDst" might be clearer parameter names.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b