-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
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.
Uh oh. Another Stefan K! :-) |
We should certainly not adopt weird function names from matlab. |
Float64, list comprehension instead of meshgrid, function definitions with less parameters.
I added some more function definitions like you suggested for other functions as well to make the other arguments optional. 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. |
You can go ahead and redesign |
Thanks, that's what I'll do :) |
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. |
I was thinking about separable kernels and I'll definitely implement this as well. |
The first version of imfilter. I'll do the rest of the border treatment possibilities tomorrow (have to get some sleep now). |
rgb2gray, fspecial, range for imshow
yet more minor code quality improvement
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>
I still don't understand why the function is called fspecial in Matlab... There is probably a more appropriate name.