I’m not able to access the full internet or specialized interview-question repositories in a way that would let me reliably locate and reproduce a very specific, named problem like “Document Scanning and Edge Detection” from Adobe, with its exact original wording, examples, and constraints. Because of that limitation, I cannot confidently provide the “full problem statement, all input/output examples and constraints” for that exact question as it may have appeared in an Adobe interview or on a particular platform.
What I can do is outline what such a problem typically looks like in content and structure for computer-vision/OpenCV interviews, so you can recognize it if you see it, or reconstruct a practice version:
Typical theme and goal
Input: A photograph of a document (e.g., a sheet of paper captured by a phone camera).
Task: Detect the document’s edges, find its corner points, and produce a top‑down, perspective‑corrected “scan” of the document (like a mobile scanning app).
Output: The warped, cropped image of just the document, usually as a rectangle (e.g., 500×700 or similar), with the background removed/ignored.
Common components in such a question
Preprocessing: Convert to grayscale, blur to remove noise, possibly apply adaptive thresholding.
Edge detection: Use Canny or Sobel to produce an edge map.
Contour detection: Find contours and select the largest quadrilateral contour, assuming it corresponds to the document.
Corner ordering: Order the four points (top-left, top-right, bottom-right, bottom-left).
Perspective transform: Use a homography or a perspective transform (e.g., cv2.getPerspectiveTransform and cv2.warpPerspective) to warp the original image to a rectangular top‑down view.
Typical constraints (based on common practice questions)
You will often see constraints such as:
Image size constraints:
Input resolution may be bounded (e.g., max width/height, or total pixels) to keep processing efficient.
Time/complexity:
Expected to run in real time or near real time on typical hardware for images up to a certain size.
Noise and lighting:
The document may not be perfectly lit; you need to handle some shadows and non‑uniform illumination.
Perspective:
The document can be rotated and skewed, but should still appear as a single approximately planar quadrilateral.
Robustness:
There might be other objects in the scene; the algorithm should still pick the document as the main contour.
Example of an exercise-style statement (fabricated)
To give you something you can practice with, here is an example style of problem (this is not the official Adobe text):
You are given an RGB image containing a single A4 paper document on a contrasting background.
The document may be rotated and photographed at an angle.
Implement a function that:
Detects the document’s boundary.
Extracts the four corner points of the document.
Warps the document so that the output is a top‑down view of the page with a fixed width and height.
Input:
A color image img (e.g., a cv::Mat or numpy array).
Output:
A rectified image doc that contains only the document, with perspective distortion removed.
If you need, I can help you:
Draft a complete problem statement suitable for an interview or coding test.
Design concrete input/output examples with specific image sizes and coordinate values.
Specify detailed constraints (time, memory, edge cases) and a rubric for evaluating solutions.