0% found this document useful (0 votes)
27 views3 pages

OpenCV Image Manipulation Lab Guide

The document outlines an assignment for a Computer Vision lab where students must implement image manipulations using OpenCV functions. Key tasks include converting images to grayscale, adjusting brightness and contrast, applying various filters, and detecting edges, all through command line arguments. Submission requirements include organizing files into specific folders and compressing them into a single zip file.

Uploaded by

Long Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

OpenCV Image Manipulation Lab Guide

The document outlines an assignment for a Computer Vision lab where students must implement image manipulations using OpenCV functions. Key tasks include converting images to grayscale, adjusting brightness and contrast, applying various filters, and detecting edges, all through command line arguments. Submission requirements include organizing files into specific folders and compressing them into a single zip file.

Uploaded by

Long Nguyễn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Computer Vision – Individual Lab 1

Pham Minh Hoang


March 18, 2024

Problem
In this assignment, you only use 3 OpenCV functions: imread, imwrite, and imshow. You
have to implement from scratch several image manipulations using OpenCV C/C++:

• Convert a color image to the gray image

• Change the brightness/contrast of an image

• Filter an image

• Edge detection

Your program is called by command line arguments and perform the following functions

1. Load the input image from its path

2. Show the result image and save it

3. Convert a color image to the gray image. The command line is

<Executable file > -rgb2gray <InputFilePath> <OutputFilePath>

where

• -rgb2gray: the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file

4. Change the brightness of an image. The command line is

<Executable file > -brightness <InputFilePath> <OutputFilePath> <C>

where

• -brightness: the name of command

1
• InputFilePath: the path of input file
• OutputFilePath: the path of output file
• C : the brightness factor

5. Change the contrast of an image. The command line is

<Executable file > -constrast <InputFilePath> <OutputFilePath> <C>

where

• -contrast: the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file
• C : the contrast factor

6. Filter an image using average filter. The command line is

<Executable file > -avg <InputFilePath> <OutputFilePath> <k>

where

• -avg: the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file
• K : the size of kernel filter

7. Filter an image using median filter. The command line is

<Executable file > -avg <InputFilePath> <OutputFilePath> <k>

where

• -med : the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file
• K : the size of kernel filter

8. Filter an image using gaussian filter. The command line is

<Executable file > -gau <InputFilePath> <OutputFilePath> <k>

where

2
• -gau: the name of command
• InputFilePath: the path of input file
• OutputFilePath: the path of output file
• K : the size of kernel filter

9. Detect edge of an image using Sobel of kernel size 3 × 3. The command line is

<Executable file > -sobel <InputFilePath> <OutputFilePath>

where

• -sobel : the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file

10. Detect edge of an image using Laplace of kernel size 3 × 3. The command line is

<Executable file > -laplace <InputFilePath> <OutputFilePath>

where

• -laplace: the name of command


• InputFilePath: the path of input file
• OutputFilePath: the path of output file

Submission
Your submission must organize into 2 folders and compressed in 1 file StudentID.zip

1. Document: contains your own report and user guide

2. Data: contains input images and output images)

3. Sources: contain source code (.hpp, .cpp) which can re-build successfully.

4. Execuatable (contain the executable file is named StudentID)

You might also like