Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgb2gray, fspecial, range for imshow #464

Merged
merged 11 commits into from
Feb 27, 2012
Merged

rgb2gray, fspecial, range for imshow #464

merged 11 commits into from
Feb 27, 2012

Conversation

stefan-k
Copy link
Contributor

I still don't understand why the function is called fspecial in Matlab... There is probably a more appropriate name.

for now the function returns an array of type Uint8 independent of the
type of the provided array.
Also, ppmwrite saves grayscale images by writing the same value to every
channel.
fspecial creates average, sobel, prewitt and gaussian filter kernels.
gaussian2d creates the 2D gaussian kernel
Defined imadjustintensity as a helper function.
@StefanKarpinski
Copy link
Member

Uh oh. Another Stefan K! :-)

@ViralBShah
Copy link
Member

We should certainly not adopt weird function names from matlab.

Float64, list comprehension instead of meshgrid, function definitions
with less parameters.
@stefan-k
Copy link
Contributor Author

I added some more function definitions like you suggested for other functions as well to make the other arguments optional.
Thanks for the hint with the list comprehensions, I didn't know about that.

As for fspecial: I would even prefer if this function didn't exist at all. I think it is sufficient to have a small function for each filter kernel.

@JeffBezanson
Copy link
Member

You can go ahead and redesign fspecial however you want. Whoever writes the code gets to decide :)

@stefan-k
Copy link
Contributor Author

Thanks, that's what I'll do :)
I also added a 2D Convolution for two matrices to j/signal.jbecause I'll need that for imfilter.

@JeffBezanson
Copy link
Member

This is great. I have a little computer vision class project I've been itching to port from matlab which will be fun to benchmark.

Something to think about: it would be unfortunate to return 2d kernels from fspecial that are actually x-y separable, and then pass them to conv2. I've seen a trick where you take the svd of the kernel (if it's small) to determine if it's separable. But maybe the design can address this somehow.

@stefan-k
Copy link
Contributor Author

I was thinking about separable kernels and I'll definitely implement this as well.
Thanks for taking the time to look over my code, I'm still in the "getting-used-to" phase.

@stefan-k
Copy link
Contributor Author

The first version of imfilter. I'll do the rest of the border treatment possibilities tomorrow (have to get some sleep now).

JeffBezanson added a commit that referenced this pull request Feb 27, 2012
rgb2gray, fspecial, range for imshow
@JeffBezanson JeffBezanson merged commit 2e34329 into JuliaLang:master Feb 27, 2012
Keno pushed a commit that referenced this pull request Oct 9, 2023
yet more minor code quality improvement
ViralBShah pushed a commit that referenced this pull request Nov 9, 2023
Stdlib: SparseArrays
URL: https://github.com/JuliaSparse/SparseArrays.jl.git
Stdlib branch: main
Julia branch: master
Old commit: 3582898
New commit: 37fc321
Julia version: 1.11.0-DEV
SparseArrays version: 1.11.0
Bump invoked by: @ViralBShah
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaSparse/SparseArrays.jl@3582898...37fc321

```
$ git log --oneline 3582898..37fc321
37fc321 test: relax allocated tests (#468)
bd2bda8 replace ind2sub/sub2ind by CartesianIndices/LinearIndices (#451)
7897f1f test: somewhat more permissive test_throws message (#466)
911cf6a `reverse` for sparse vector/matrix (#450)
713a260 Define algebraic operators for SparseMatrixCSCView (#458)
f455a8e Add messages to DimensionMismatch errors (#461)
81fc6f3 Aggressive constprop in sparse * dense (#460)
0b36fdd fix h/vcat invoke dispatch arguments (#464)
6b23902 Add Finch to list of External Julia Sparse Array Libraries (#462)
```

Co-authored-by: Dilum Aluthge <dilum@aluthge.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants