Laplacian Filter
Second derivative edge detection. Detects areas of rapid intensity change. Used for edge enhancement and sharpening.
Visualization
Interactive visualization for Laplacian Filter
Laplacian Filter:
- • Edge detection
- • 2nd derivative
Interactive visualization with step-by-step execution
Implementation
1function laplacianFilter(image: number[][]): number[][] {
2 const kernel = [[0, 1, 0], [1, -4, 1], [0, 1, 0]];
3 return convolve2D(image, kernel);
4}
5
6function laplacianOfGaussian(image: number[][], sigma: number): number[][] {
7 const blurred = gaussianBlur(image, 5, sigma);
8 return laplacianFilter(blurred);
9}Deep Dive
Theoretical Foundation
Approximates ∇²f = ∂²f/∂x² + ∂²f/∂y². Kernel: [[0,1,0],[1,-4,1],[0,1,0]] or [[1,1,1],[1,-8,1],[1,1,1]]. Zero-crossings indicate edges. Sensitive to noise.
Complexity
Time
O(w×h)
O(w×h)
O(w×h)
Space
O(w×h)
Applications
Industry Use
Image sharpening and enhancement
Blob detection in microscopy
Edge enhancement for printing
Feature detection preprocessing
Medical image analysis
Quality control in manufacturing
Use Cases
Related Algorithms
A* Search Algorithm
Informed search algorithm combining best-first search with Dijkstra's algorithm using heuristics. Widely used in pathfinding and graph traversal, A* is optimal and complete when using admissible heuristic. Used in games, GPS navigation, and robotics. Invented by Peter Hart, Nils Nilsson, and Bertram Raphael in 1968.
Convex Hull (Graham Scan)
Find smallest convex polygon containing all points. Graham Scan invented by Ronald Graham in 1972, runs in O(n log n). Essential in computational geometry, computer graphics, and pattern recognition.
Line Segment Intersection
Determine if two line segments intersect. Fundamental geometric primitive used in graphics, CAD, GIS. Uses orientation and collinearity tests.
Caesar Cipher
The Caesar Cipher is one of the oldest and simplest encryption techniques, named after Julius Caesar who used it to protect military messages around 100 BC. It works by shifting each letter in the plaintext by a fixed number of positions down the alphabet. For example, with a shift of 3, A becomes D, B becomes E, and so on. Despite being used for over 2000 years, it's extremely weak by modern standards with only 25 possible keys, making it trivially breakable by brute force or frequency analysis.