Computer vision cookbook
Combine a few algorithms into something useful. Bring your images, select a region, tune the controls and inspect every step.
Start with tracking a region between two frames, counting objects or flattening a document. Each recipe explains its assumptions and links to the algorithms behind it.
Choose individual algorithms 23 selected
Uncheck an algorithm to hide it. Category filters and the search above still apply.
No algorithms match this selection search.
Measure regional motion vectors
Measure delta vectors between a before frame and an after frame. See how far each region translated during a camera pan, inspect dense dx/dy values, or subtract the dominant image motion.
Compensate for the initial pan → Estimate dense displacement → Check texture and summarize regionsMotion and matchingTrack a selected region
Upload a before frame and an after frame, then draw a region on the first image. Track its corners and estimate where that region moved.
Find corners in the region → Track forwards and backwards → Fit a robust transformMotion and matchingFind a patch in another image
Draw a patch on the first image and locate its best matching position in the second image.
Crop the selected patch → Search the next image → Mark the strongest responseMotion and matchingAlign two overlapping images
Match ORB features, reject inconsistent correspondences with RANSAC, then warp the second image into the first image’s coordinates.
Describe both images → Keep consistent matches → Warp to the referenceMotion and matchingVisualize verified feature matches
See which ORB descriptor matches agree with one estimated projective transform.
Extract ORB features → Match descriptors → Verify geometryMotion and matchingFind changed regions between frames
Compare two frames, suppress noise, clean the difference mask and draw connected changed regions.
Suppress image noise → Threshold frame differences → Group changed pixelsMotion and matchingHighlight structural image differences
Compute a local SSIM map, threshold low similarity and highlight contiguous differences on the second image.
Measure structural similarity → Select low-similarity pixels → Draw difference regionsRegions and masksCount separated objects
Separate bright objects from a dark background, clean the mask and count connected regions that pass an area filter.
Create a foreground mask → Remove small noise → Count componentsRegions and masksSeparate touching objects
Use peaks in the foreground distance map as seeds for watershed segmentation.
Threshold the foreground → Find interior seeds → Flood from the seedsRegions and masksMeasure contour geometry
Threshold a silhouette, simplify its outline, and report each retained shape’s area, perimeter, circularity and centroid.
Extract silhouettes → Find and simplify contours → Measure geometryRegions and masksSelect and group a colour
Select an HSV colour range, close small holes and outline matching colour regions.
Convert BGR to HSV → Select the colour interval → Clean and group the selectionRegions and masksCrop the largest foreground object
Threshold and clean a mask, find the largest external contour, then crop its bounding box with padding.
Build a clean mask → Find the largest object → Crop its bounding rectangleRegions and masksCreate a transparent cutout
Draw a rectangle around the subject, refine its foreground mask with GrabCut, then export the cutout as RGBA.
Initialize foreground models → Refine the mask → Build an alpha channelPhotographyKeep a subject sharp
Select the subject, separate it with GrabCut, then blend it over a blurred version of the image.
Separate the subject → Blur the surroundings → Blend with the maskPhotographyBlur a selected region
Draw an area to blur while preserving the rest of the image.
Make a region mask → Blur the image → Copy through the maskPhotographyDenoise and restore local contrast
Reduce colour noise, then enhance luminance contrast without applying separate histogram equalization to each colour channel.
Remove similar-patch noise → Work in Lab luminance → Enhance local lightnessPhotographySharpen edges with an unsharp mask
Subtract a smoothed image to isolate detail, then add a controlled amount of that detail back.
Estimate the smooth image → Extract signed detail → Add the detail backPhotographyInspect local sharpness
Compute a Laplacian response, square it and average locally to visualize high-frequency energy.
Measure second derivatives → Measure local energy → Visualize the fieldDocumentsFind and flatten a document
Find the largest convex quadrilateral in the edge map, correct its perspective, then produce a locally thresholded document view.
Detect document outlines → Choose four corners → Flatten and binarizeDocumentsClean uneven document lighting
Estimate the background illumination, divide it out, then apply local thresholding.
Estimate illumination → Normalize the page → Separate inkDocumentsStraighten a tilted page
Estimate a dominant near-horizontal line angle and rotate the page to make those lines level.
Find strong edges → Estimate the tilt → Rotate around the centreGeometryEstimate depth from rectified stereo
Compute disparity, reject invalid matches and convert positive disparities into depth using the supplied focal length and camera baseline.
Match rectified rows → Reject invalid disparities → Convert disparity to depthPhotographySimplify an image into colour regions
Smooth small colour fluctuations, cluster colours with k-means and render the reduced palette.
Smooth within colour regions → Learn a palette → Recolour the imageNo matches. Try a shorter search or enable more categories and algorithms.