sobel-operator | js implementation of the sobel operator | Runtime Evironment library
kandi X-RAY | sobel-operator Summary
kandi X-RAY | sobel-operator Summary
Node.js implementation of the Sobel Operator (Sobel-Feldman operator).
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Calculate the bump
- Print the stats
- Save png data to the png .
- Get the index of the pixel at x y coordinates .
- Converts a number into a string .
sobel-operator Key Features
sobel-operator Examples and Code Snippets
Community Discussions
Trending Discussions on sobel-operator
QUESTION
I tried 5 different implementations of the Sobel operator in Python, one of which I implemented myself, and the results are radically different.
My questions is similar to this one, but there are still differences I don't understand with the other implementations.
Is there any agreed on definition of the Sobel operator, and is it always synonymous to "image gradient"?
Even the definition of the Sobel kernel is different from source to source, according to Wikipedia it is [[1, 0, -1],[2, 0, -2],[1, 0, -1]]
, but according to other sources it is [[-1, 0, 1],[-2, 0, 2],[-1, 0, 1]]
.
Here is my code where I tried the different techniques:
...ANSWER
Answered 2021-Jun-15 at 14:22according to wikipedia it's [[1, 0, -1],[2, 0, -2],[1, 0, 1]] but according to other sources it's [[-1, 0, 1],[-2, 0, 2],[-1, 0, 1]]
Both are used for detecting vertical edges. Difference here is how these kernels mark "left" and "right" edges.
For simplicity sake lets consider 1D example, and let array be
[0, 0, 255, 255, 255]
then if we calculate using padding then
- kernel
[2, 0, -2]
gives[0, -510, -510, 0, 0]
- kernel
[-2, 0, 2]
gives[0, 510, 510, 0, 0]
As you can see abrupt increase in value was marked with negative values by first kernel and positive values by second. Note that is is relevant only if you need to discriminate left vs right edges, when you want just to find vertical edges, you might use any of these 2 aboves and then get absolute value.
QUESTION
I'm currently trying to implement my own version of the Sobel-Filter/Operator. I tried to pull as much information as possible from Wikipedia(https://en.wikipedia.org/wiki/Sobel_operator) and numerous explanations on YouTube, but i can't find a solution to my problem.
So after gray-scaling my image:
...ANSWER
Answered 2020-Aug-03 at 11:54Some of the values i get while doing the convolution are larger than 255
This is often solved by using a "clamp" function. It is a function that checks if the argument is in the allowed range, and if not, returns the closest allowed value.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install sobel-operator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page