Questions tagged [edge-detection]

16 questions
13
votes
1 answer

OpenGL GLSL - Sobel Edge Detection Filter

With respect to this topic I've successfully implemented the Sobel Edge Detection filter in GLSL. Here is the fragment shader code of the filter: #version 330 core in vec2 TexCoords; out vec4 color; uniform sampler2D screenTexture; mat3 sx =…
enne87
  • 601
  • 1
  • 7
  • 15
12
votes
2 answers

OpenGL - Detection of edges

I'd like to load arbitrary meshes and draw thick black lines along the edges to get a toon-shading like look. I managed to draw a black silhouette around the objects by using the stencil buffer. You can see the result here: But what's missing are…
enne87
  • 601
  • 1
  • 7
  • 15
8
votes
2 answers

How can I detect edges between different colours of the same brightness?

I'm looking for an algorithm that can identify edges across which colour is changing sharply, rather than just finding changes in brightness. Is this just a matter of using a different colour space with existing edge detection algorithms, or is…
5
votes
1 answer

GLSL - Merge two textures

I would like to display arbitrary 3d meshes with black edges (black outline, black ridges, etc.). Thereby I have created two different textures: One color texture and one anti-aliased edge texture. Here is an example of the color texture: And the…
enne87
  • 601
  • 1
  • 7
  • 15
5
votes
1 answer

Controlling Sobel edge thickness

I'm using a Sobel filter to draw an outline in a shader. How do I control its thickness? Here's my outlining code: float3x3 Kx = { -1, 0, 1, -2, 0, 2, -1, 0, 1}; float3x3 Ky = { 1, 2, 1, 0, 0, 0, -1,-2,-1}; float Lx = 0; float Ly = 0; for…
SurvivalMachine
  • 298
  • 1
  • 3
  • 11
4
votes
1 answer

Is it better to blur the input or output of an edge detection shader for noise reduction?

To reduce noise of edge detection the norm seems like it is to apply a blur. However, is it generally better to apply the blur to the input of the edge detection. The input in my case being the depth and normal GBuffers in which I compare…
Syntac_
  • 551
  • 2
  • 9
4
votes
1 answer

How to crop with edge-detection using imagemagick

Let's say I have an image of an object against a white background. I want to crop so that the image fills the available space. This takes 10px off: convert original.png -shave 10x10 shaved.png How would I implement something like this that detects…
Escher
  • 423
  • 3
  • 8
3
votes
1 answer

Rounding a corner formed by Arc and Line

Given shapes like these, which contain just Arcs and lines, I want to round all its corners with certain radius. I know the vertices of the lines & arcs these shapes. I can round the corners of a polygon (when two lines meet to form a corner), but…
3
votes
1 answer

Sobel edge detection line thickness

My goal is to implement an edge detection algorithmus that is capable to find edges of arbitrary 3d meshes. I want to find the edges by detecting normal discontinuities. Furthermore, I want the edges to be one pixel wide. I render the color values…
enne87
  • 601
  • 1
  • 7
  • 15
3
votes
0 answers

What are some good examples of post-processing edge detection?

I'm trying to implement a post-processing pass to detect silhouette-edges from depth data. (by silhouette-edge of a triangles mesh I mean the triangle edges shared by a front and a back-facing triangle relative to the view direction, see image…
2
votes
1 answer

Which method for detecting edges of white object on white background?

I would like to segment picture of cloths in order to remove the background. The pictures come from online retailers, they usually have an homogeneous white background. Using Canny edge detector works in most of the cases, but sometimes the cloths…
1
vote
0 answers

Why does this edge detect show different results for the same color combinations?

I'm researching highlighting accessible color contrast via filter operations. I have a test screenshot of SRGB hex values compared with WCAG's official contrast algorithm: I converted it to its luminosity: Then an edge detect: This no longer…
Tigt
  • 111
  • 3
1
vote
1 answer

How would I create a virtual cabling system?

I am trying to devise a GUI system that functions as a virtual patchbay, as seen in something like Logic Studio's environment editor, or seen in virtual synthesizers that use virtual patchcables. I'm not much of a coder, so I've been experimenting…
1
vote
1 answer

Half-Edge Data Structure with holes

I am trying to implement next/prev of edges in half-edge data structure. But I ran into this question. If there are two holes with a common vertex, will the closed loop of the edges run as in the first picture? Or will it be two separate cycles, as…
0
votes
1 answer

HalfEdge: How to get list of all faces from one face

I need to, starting from one face, iterate over the rest of the faces until I reach the first facet. For this I can use twin, start, end or other info of halfedges, faces, vertex. That is, I need to switch to another face at each iteration until I…
1
2