1. Home
  2. Explore
  3. Computer Science
  4. Python OpenCV Computer Vision

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Python OpenCV Computer Vision

  • 93Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: OpenCV Foundations
OpenCV is a computer vision library available in Python, C++ and
.

93 questions

  1. 1
    OpenCV is a computer vision library available in Python, C++ and
    _____
    .
    Hint

    This is another widely used programming language.

    Answer

    Java

  2. 2
    Computer vision primarily focuses on deriving insights from media files such as images and
    _____
    .
    Hint

    The second type of media is time-based.

    Answer

    video

  3. 3
    The recommended minimum Python version for the course is
    _____
    .
    Hint

    The course warns that some code may not work with older versions, especially Python 2.

    Answer

    3.7

  4. 4
    The terminal command used to check the installed Python version is
    _____
    .
    Hint

    It begins with the Python executable and uses a double-hyphen option.

    Answer

    python --version

  5. 5
    The package command recommended for installing the full OpenCV Python functionality is
    _____
    .
    Hint

    This package includes both the main module and community contribution modules.

    Answer

    pip install opencv-contrib-python

  6. 6
    NumPy is extensively used for matrix and
    _____
    manipulations, transformations and reshaping.
    Hint

    It is the other major data structure named alongside matrices.

    Answer

    array

  7. 7
    The package described as a collection of utility and helper functions for computer vision workflows is
    _____
    .
    Hint

    It was introduced as a package built to speed up the workflow.

    Answer

    sewar

  8. 8
    OpenCV reads an image with the
    _____
    method.
    Hint

    The method name combines the OpenCV prefix with an abbreviation for image reading.

    Answer

    cv.imread

  9. 9
    The result returned by cv.imread is a matrix of
    _____
    .
    Hint

    An image is represented numerically by its individual visual elements.

    Answer

    pixels

  10. 10
    The OpenCV method used to display an image in a new window is
    _____
    .
    Hint

    Its name combines the OpenCV prefix with a term meaning display.

    Answer

    cv.imshow

  11. 11
    The function that waits for a keyboard key for a specified number of milliseconds is
    _____
    .
    Hint

    It is commonly used after displaying an image.

    Answer

    cv.waitKey

  12. 12
    Passing zero to cv.waitKey makes it wait for a key for an
    _____
    amount of time.
    Hint

    The window remains open until a key is pressed.

    Answer

    infinite

  13. 13
    The OpenCV class used to read a video frame by frame is
    _____
    .
    Hint

    It represents a capture device or video file.

    Answer

    VideoCapture

  14. 14
    A webcam is usually referenced by passing the integer
    _____
    to cv.VideoCapture.
    Hint

    Camera indices begin with the first available device.

    Answer

    0

  15. 15
    The capture.read method returns both a video frame and a
    _____
    indicating whether reading succeeded.
    Hint

    This value is either true or false.

    Answer

    Boolean

  16. 16
    After video processing is complete, the capture pointer should be released with the
    _____
    method.
    Hint

    This method belongs to the capture object.

    Answer

    release

  17. 17
    OpenCV windows can be closed programmatically with
    _____
    .
    Hint

    The method name refers to removing every display window.

    Answer

    cv.destroyAllWindows

  18. 18
    Resizing media is primarily used to reduce computational
    _____
    caused by large images and videos.
    Hint

    Large media requires more processing resources.

    Answer

    strain

  19. 19
    The frame.shape index representing an image's width is
    _____
    .
    Hint

    The height is stored at the preceding index.

    Answer

    1

  20. 20
    The frame.shape index representing an image's height is
    _____
    .
    Hint

    This is the first dimension of the image array.

    Answer

    0

  21. 21
    The interpolation method recommended by default when shrinking an image is `cv.INTER
    _____
    `.
    Hint

    Its name refers to the area represented by source pixels.

    Answer

    AREA

  22. 22
    The capture.set properties used to change video width and height are
    _____
    and 4, respectively.
    Hint

    The width property is the first of the two consecutive properties.

    Answer

    3

  23. 23
    The capture.set method is intended for changing the resolution of
    _____
    video rather than an existing video file.
    Hint

    This video is coming from a webcam or external camera.

    Answer

    live

  24. 24
    A blank image can be created with NumPy by using np.zeros and the image data type
    _____
    .
    Hint

    This unsigned integer type is commonly used for image pixels.

    Answer

    uint8

  25. 25
    The OpenCV method for drawing a rectangle is
    _____
    .
    Hint

    Its name directly describes the geometric shape.

    Answer

    cv.rectangle

  26. 26
    A rectangle is filled in OpenCV by setting its thickness to
    _____
    .
    Hint

    This special negative value means fill the entire shape.

    Answer

    -1

  27. 27
    The OpenCV method for drawing a circle is
    _____
    .
    Hint

    It takes a center point, radius, color and thickness.

    Answer

    cv.circle

  28. 28
    The OpenCV method for drawing a standalone line is
    _____
    .
    Hint

    It takes two endpoints and a color.

    Answer

    cv.line

  29. 29
    The OpenCV method for writing text on an image is
    _____
    .
    Hint

    Its name describes placing characters onto an image.

    Answer

    cv.putText

  30. 30
    OpenCV's default three-channel image ordering is
    _____
    .
    Hint

    The channels are blue, green and red in that order.

    Answer

    BGR

  31. 31
    The function used to convert an image between color spaces is
    _____
    .
    Hint

    Its name combines color conversion with the OpenCV prefix.

    Answer

    cv.cvtColor

  32. 32
    The color-conversion code for converting BGR to grayscale is
    _____
    .
    Hint

    It names both the source and destination color spaces.

    Answer

    COLOR_BGR2GRAY

  33. 33
    A grayscale image represents the intensity distribution of pixels without their
    _____
    information.
    Hint

    Grayscale retains lightness but removes chromatic information.

    Answer

    color

  34. 34
    The transformation that shifts an image along the x- and y-axes is called
    _____
    .
    Hint

    It moves an image left, right, up or down.

    Answer

    translation

  35. 35
    In image translation, a negative x value shifts the image to the
    _____
    .
    Hint

    Positive x shifts in the opposite horizontal direction.

    Answer

    left

  36. 36
    In image translation, a positive y value shifts the image
    _____
    .
    Hint

    Negative y shifts upward.

    Answer

    down

  37. 37
    The interpolation method that is slower but generally produces higher-quality enlarged images is `cv.INTER
    _____
    `.
    Hint

    It is compared with linear and area interpolation.

    Answer

    CUBIC

  38. 38
    The flip code for flipping an image vertically over the x-axis is
    _____
    .
    Hint

    The horizontal flip uses 1.

    Answer

    0

  39. 39
    The flip code for flipping an image both vertically and horizontally is
    _____
    .
    Hint

    It combines the effects of codes 0 and 1.

    Answer

    -1

  40. 40
    Contours are boundaries of objects formed by lines or curves joining continuous points along an object's
    _____
    .
    Hint

    They trace the outside of a shape.

    Answer

    boundary

  41. 41
    Although contours can often be treated like edges in programming, they are mathematically
    _____
    from edges.
    Hint

    The content explicitly warns not to equate the two concepts mathematically.

    Answer

    different

  42. 42
    The OpenCV function that finds contours returns both contours and
    _____
    .
    Hint

    This second result describes nested relationships among contours.

    Answer

    hierarchies

  43. 43
    The contour retrieval mode that returns only external contours is
    _____
    .
    Hint

    Its name specifies the outside contours.

    Answer

    RETR_EXTERNAL

  44. 44
    The contour approximation method that compresses a straight line to its two endpoints is
    _____
    .
    Hint

    It stores only the points needed to represent the shape.

    Answer

    CHAIN_APPROX_SIMPLE

  45. 45
    The function used to draw detected contours onto an image is
    _____
    .
    Hint

    Its name combines drawing with the object being displayed.

    Answer

    cv.drawContours

  46. 46
    The color space consisting of hue, saturation and value is abbreviated
    _____
    .
    Hint

    It is often considered closer to how humans conceptualize color.

    Answer

    HSV

  47. 47
    The color space represented by lightness and the A and B channels is abbreviated
    _____
    .
    Hint

    It is described as being tuned to human color perception.

    Answer

    LAB

  48. 48
    When displaying an OpenCV BGR image with Matplotlib, the colors appear inverted because Matplotlib assumes the image is
    _____
    .
    Hint

    This ordering places red before green and blue.

    Answer

    RGB

  49. 49
    The OpenCV function used to split an image into blue, green and red channels is
    _____
    .
    Hint

    It separates the merged color channels.

    Answer

    cv.split

  50. 50
    The OpenCV function used to combine separate color channels into one image is
    _____
    .
    Hint

    It performs the opposite operation from channel splitting.

    Answer

    cv.merge

  51. 51
    A blur reduces image noise caused by problems such as poor lighting or camera
    _____
    .
    Hint

    The content names a hardware source of image noise.

    Answer

    sensors

  52. 52
    The rectangular window used to calculate a local blur is called a
    _____
    .
    Hint

    Its dimensions are described as rows by columns.

    Answer

    kernel

  53. 53
    The average-blur method assigns the center pixel the average of the surrounding pixel
    _____
    .
    Hint

    These numerical values describe how bright the neighboring pixels are.

    Answer

    intensities

  54. 54
    Gaussian blur differs from averaging because each surrounding pixel is assigned a particular
    _____
    .
    Hint

    Some neighboring pixels influence the result more than others.

    Answer

    weight

  55. 55
    Median blur replaces the center pixel with the
    _____
    of the surrounding pixel values.
    Hint

    It is the middle value after the surrounding values are ordered.

    Answer

    median

  56. 56
    Bilateral filtering is distinctive because it blurs an image while retaining its
    _____
    .
    Hint

    This method avoids smoothing away important boundaries as much as traditional blur.

    Answer

    edges

  57. 57
    The four basic bitwise operators discussed are AND, OR, XOR and
    _____
    .
    Hint

    This operator inverts binary values.

    Answer

    NOT

  58. 58
    Bitwise AND returns the regions that are present in
    _____
    source images.
    Hint

    It represents the intersection of two binary shapes.

    Answer

    both

  59. 59
    Bitwise OR returns both the intersecting and
    _____
    regions of two images.
    Hint

    It combines all active regions from either image.

    Answer

    non-intersecting

  60. 60
    Bitwise NOT inverts black pixels to white and white pixels to
    _____
    .
    Hint

    It reverses the binary color.

    Answer

    black

  61. 61
    Masking allows processing to focus on selected parts of an
    _____
    .
    Hint

    A mask hides unwanted regions and preserves a region of interest.

    Answer

    image

  62. 62
    For masking to work, the mask dimensions must be the same as the dimensions of the
    _____
    .
    Hint

    The mask must align pixel-for-pixel with its source.

    Answer

    image

  63. 63
    An image histogram visualizes the distribution of pixel
    _____
    .
    Hint

    It shows how frequently different brightness values occur.

    Answer

    intensities

  64. 64
    In a grayscale histogram, the x-axis represents pixel-intensity
    _____
    .
    Hint

    The histogram groups possible values into intervals.

    Answer

    bins

  65. 65
    Thresholding converts an image into a binary image whose pixels are typically zero or
    _____
    .
    Hint

    This is the maximum value used for an 8-bit white pixel.

    Answer

    255

  66. 66
    In simple binary thresholding, pixels below the threshold are set to
    _____
    .
    Hint

    These pixels become black.

    Answer

    zero

  67. 67
    In simple binary thresholding, pixels above the threshold are set to
    _____
    .
    Hint

    These pixels become white.

    Answer

    255

  68. 68
    The OpenCV function used for simple thresholding is
    _____
    .
    Hint

    It returns both the threshold value and the thresholded image.

    Answer

    cv.threshold

  69. 69
    Adaptive thresholding determines an optimal threshold separately for local pixel
    _____
    .
    Hint

    It uses a block or kernel around each region.

    Answer

    neighborhoods

  70. 70
    The Canny detector is used to find image
    _____
    .
    Hint

    It highlights boundaries and sharp intensity changes.

    Answer

    edges

  71. 71
    The Laplacian method computes image
    _____
    and may produce positive and negative slopes.
    Hint

    These describe changes in intensity across the image.

    Answer

    gradients

  72. 72
    The Sobel method computes gradients in the
    _____
    and y directions.
    Hint

    It is the first axis named in the pair.

    Answer

    x

  73. 73
    Face detection identifies whether a face is present, whereas face recognition identifies
    _____
    the face belongs to.
    Hint

    Recognition determines the person's identity.

    Answer

    whose

  74. 74
    A classifier decides whether an image is positive or
    _____
    for a target object.
    Hint

    The two possible outcomes are presence or absence.

    Answer

    negative

  75. 75
    Classifiers must be trained on thousands of images with and without
    _____
    .
    Hint

    The target object in the described task is a human face.

    Answer

    faces

  76. 76
    The XML classifier used in the example for frontal-face detection is a Haar
    _____
    .
    Hint

    It is a widely used OpenCV classifier family.

    Answer

    cascade

  77. 77
    Before face detection, the image is converted to grayscale because the classifier relies primarily on image
    _____
    .
    Hint

    The detector does not need skin tone or color information.

    Answer

    edges

  78. 78
    The Haar cascade method that detects objects at multiple scales is
    _____
    .
    Hint

    Its name indicates detection across different sizes.

    Answer

    detectMultiScale

  79. 79
    Increasing the minimum-neighbors parameter generally makes Haar-cascade detection less sensitive to
    _____
    .
    Hint

    It reduces false detections from regions that only resemble faces.

    Answer

    noise

  80. 80
    The built-in OpenCV face recognizer is trained using a list of face
    _____
    and a corresponding list of labels.
    Hint

    These are cropped face arrays extracted from training images.

    Answer

    features

  81. 81
    Saving a trained OpenCV face recognizer allows it to be reused from a YAML
    _____
    file.
    Hint

    The example saves the trained model using a YAML file.

    Answer

    source

  82. 82
    A deep learning model generally performs better when trained with at least a couple of
    _____
    images per class.
    Hint

    The content contrasts this with a training set of only about 100 images.

    Answer

    thousand

  83. 83
    The deep learning model in the example classifies characters from The
    _____
    .
    Hint

    The dataset contains characters such as Homer and Bart.

    Answer

    Simpsons

  84. 84
    The deep learning workflow uses TensorFlow's implementation of
    _____
    .
    Hint

    It is a high-level deep learning API.

    Answer

    Keras

  85. 85
    A GPU is used to speed up the model's
    _____
    process.
    Hint

    It accelerates the computation required to learn model parameters.

    Answer

    training

  86. 86
    In the example, images are resized to
    _____
    by 80 pixels before entering the network.
    Hint

    The target dimensions are equal in both directions.

    Answer

    80

  87. 87
    The example uses one image channel because the input images are converted to
    _____
    .
    Hint

    This removes the need for separate color channels.

    Answer

    grayscale

  88. 88
    Normalizing image features to the range from zero to one helps the network learn
    _____
    .
    Hint

    Normalization improves the numerical scale of the input data.

    Answer

    faster

  89. 89
    One-hot encoding converts numerical labels into binary class
    _____
    .
    Hint

    Each class is represented by a vector with one active position.

    Answer

    vectors

  90. 90
    In the example, 20 percent of the data is reserved for the
    _____
    set.
    Hint

    The remaining 80 percent is used for training.

    Answer

    validation

  91. 91
    An image data generator synthesizes new images from existing images to introduce
    _____
    into training.
    Hint

    This helps the model become less dependent on exact training examples.

    Answer

    randomness

  92. 92
    The final model uses a learning-rate
    _____
    to adjust the learning rate during training.
    Hint

    It changes the learning rate at specified intervals.

    Answer

    schedule

  93. 93
    The course emphasizes that deep learning models are used in applications such as self-driving vehicles and medical
    _____
    .
    Hint

    This application involves using computer vision to support healthcare decisions.

    Answer

    diagnosis

1 of 93
Question 1 of 93

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent