C RUBY-ON-RAILS MYSQL ASP.NET DEVELOPMENT RUBY .NET LINUX SQL-SERVER REGEX WINDOWS ALGORITHM ECLIPSE VISUAL-STUDIO STRING SVN PERFORMANCE APACHE-FLEX UNIT-TESTING SECURITY LINQ UNIX MATH EMAIL OOP LANGUAGE-AGNOSTIC VB6 MSBUILD

Difference between fspecial('sobel') and edge(i,'sobel') matlab

Share :

Sobel Edge detection – matlab

Tag : image , By : Willem van Schevikho
Date : March 29 2020, 07:55 AM
it helps some times According to the second part of your homework you have solved it, i.e., you eliminated the shadows.
For the first question: the direction can be used in many different ways. Here is the simplest way: make pretty pictures with it. A more useful reason to consider it is when you are doing non-maximum suppression, but since you are not manually doing it then there isn't much immediate use for it. To visualize the results of the gradient direction it is simply matter of establishing colors for each direction you consider. To further simplify the visualization also suppose you reduce the directions to increments of 30 degrees up to 180, starting from 0. That way if you have a direction of 35 degrees, for example, you consider it as 30 degrees (since it is the nearest one in your reduced list). Next we see an image and a visualization of its gradient direction considering Sobel and the discretization to steps of 30 degrees (black is indicating 0 degree direction).

Does the sobel mask from fspecial find horizontal or vertical edges?

Tag : matlab , By : cjdavis
Date : March 29 2020, 07:55 AM
like below fixes the issue The documentation to fspecial tells us
``````hvert = ( fspecial('sobel') )'
``````
``````hy = fspecial('sobel');
hx = hy';
gx = imfilter(image, hx); % x component of Sobel gradient
gy = imfilter(image, hy); % y component

gmag = hypot(gx,gy); % magnitude of Sobel gradient
``````

sobel edge detection using mpi

Tag : cpp , By : tangsty
Date : March 29 2020, 07:55 AM
around this issue You'll probably get better performance and certainly simpler code by using collectives. The first step in which your slaves send data to the master is equivalent to MPI_Gather. The step when the master sends out new data to each of the slaves is an MPI_Scatter.
I think the conceptual piece that may be causing problems in your attempts so far is that MPI programs use a single program, multiple data programming model. Every rank is executing the same code but just gets different values of "rank". That seems to be understood in your blocks if (rank == master) and if (rank != master), but when using a barrier or other collective operation you have to keep in mind that no ranks in the communicator you pass to it will pass that point in the code until all the rest get there. The calls you're making to MPI_Send are blocking, so the master rank probably won't pass the first send until after the receiving rank posts a matching MPI_Recv, i.e. never because the receiving rank is stuck on the barrier.

What is the OpenCv equivalent of this Matlab code for Sobel edge detection?

Tag : python , By : RichAA
Date : March 29 2020, 07:55 AM
seems to work fine The MATLAB implementation of the sobel edge detection isn't visible so we can only guess exactly what is happening. The only hint we get is from the documentation on edge states that when the 'sobel' option is used then
``````import cv2
import numpy as np
import scipy.ndimage.filters

def orientated_non_max_suppression(mag, ang):
ang_quant = np.round(ang / (np.pi/4)) % 4
winE = np.array([[0, 0, 0],
[1, 1, 1],
[0, 0, 0]])
winSE = np.array([[1, 0, 0],
[0, 1, 0],
[0, 0, 1]])
winS = np.array([[0, 1, 0],
[0, 1, 0],
[0, 1, 0]])
winSW = np.array([[0, 0, 1],
[0, 1, 0],
[1, 0, 0]])

magE = non_max_suppression(mag, winE)
magSE = non_max_suppression(mag, winSE)
magS = non_max_suppression(mag, winS)
magSW = non_max_suppression(mag, winSW)

mag[ang_quant == 0] = magE[ang_quant == 0]
mag[ang_quant == 1] = magSE[ang_quant == 1]
mag[ang_quant == 2] = magS[ang_quant == 2]
mag[ang_quant == 3] = magSW[ang_quant == 3]
return mag

def non_max_suppression(data, win):
data_max = scipy.ndimage.filters.maximum_filter(data, footprint=win, mode='constant')
data_max[data != data_max] = 0
return data_max

# compute sobel response
sobelx = cv2.Sobel(gray_image, cv2.CV_32F, 1, 0, ksize=3)
sobely = cv2.Sobel(gray_image, cv2.CV_32F, 0, 1, ksize=3)
mag = np.hypot(sobelx, sobely)
ang = np.arctan2(sobely, sobelx)
# threshold
fudgefactor = 0.5
threshold = 4 * fudgefactor * np.mean(mag)
mag[mag < threshold] = 0
# non-maximal suppression
mag = orientated_non_max_suppression(mag, ang)
# alternative but doesn't consider gradient direction
# mag = skimage.morphology.thin(mag.astype(np.bool)).astype(np.float32)