OpenCV
OpenCV is the classical computer-vision toolbox: image and video I/O, filtering, geometric transforms, feature detection, contour analysis, and a DNN module for running trained networks. Vision interviews still expect the classical side, not only deep learning.
on this pageshowhide
explore
- Image I/O and Color6 questions
- Filtering and Transforms6 questions
- Feature Detection6 questions
- Contours and Morphology6 questions
- Video Processing6 questions
- DNN Module6 questions
questions
page 2 of 2Why chain resize, warpAffine and warpPerspective into one warp per frame?
basics
~20 sEach warp resamples the previous warp's output, so interpolation blur compounds and you pay three passes over the image. Compose the matrices into a single 3x3 and warp once, or precompute cv2.remap maps when the transform is fixed.
When would you convert to LAB rather than HSV in an OpenCV pipeline?
basics
~20 sUse LAB when the task is about perceived difference or about changing brightness without shifting colour: its L axis is lightness and a/b are colour-opponent axes, and distances approximate perceived difference. HSV is better for carving out a band of the colour wheel with cheap thresholds.
An OpenCV loop on a live RTSP camera keeps showing frames seconds old — why, and how do you fix it?
basics
~20 sProcessing is slower than the camera's frame rate, so decoded frames queue up behind the loop and VideoCapture.read() keeps handing back the oldest one. Latency grows without bound. Fix it by decoupling capture from processing — read in a thread that keeps only the newest frame, or drop frames with grab().
When is OpenCV's DNN module the right inference runtime, and when is it not?
basics
~20 sChoose the DNN module when OpenCV is already in the build, the model is a small vision network, and one dependency matters more than peak throughput. Choose a dedicated runtime when you need broad operator coverage, vendor accelerators, or models it cannot import.
How would you choose between SIFT, ORB and AKAZE for a production vision pipeline?
basics
~20 sTrade matching robustness against compute and memory. SIFT gives the best repeatability under scale and viewpoint change but is slowest with 512-byte float descriptors; ORB is fastest with 32-byte binary descriptors; AKAZE sits between. Decide on measured inlier ratio over your own imagery, not reputation.
How do you split a real-time video pipeline's frame budget between detection and tracking?
basics
~20 sRun the expensive detector every N frames and carry boxes between detections with cheap trackers, sizing N so the average per-frame cost fits the frame interval. The cost of a larger N is tracker drift and delayed discovery of new objects, so N is measured, not guessed.
showing 31–36 of 36