Skip to content

Commit 9033eaa

Browse files
committed
cvDisplacementMapFilter: code cleanup
1 parent 3aba2d1 commit 9033eaa

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

cvDisplacementMapFilter/main.cpp

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
* output: the destination Mat.
2222
* location: offset starting point.
2323
*/
24-
//void overlayImage(const cv::Mat &background, const cv::Mat &foreground, cv::Mat &output, cv::Point2i location)
2524
void overlayImage(const cv::Mat &background, const cv::Mat &foreground, cv::Mat &output, cv::Point2i location, double opacity = 1.0)
2625
{
2726
background.copyTo(output);
@@ -57,33 +56,6 @@ void overlayImage(const cv::Mat &background, const cv::Mat &foreground, cv::Mat
5756
}
5857
}
5958

60-
/* getComponent: helper function that returns the color of a specific component.
61-
*
62-
* bgr_pixel: the input BGR pixel of type cv::Vec3b.
63-
* bgr_component: the index of the channel. 0 for Blue, 1 for Green, 2 for Red.
64-
* This function returns the color of a pixel as unsigned char.
65-
*/
66-
uchar getComponent(cv::Vec3b bgr_pixel, int bgr_component)
67-
{
68-
switch (bgr_component)
69-
{
70-
case 0: // Blue
71-
return bgr_pixel[0];
72-
73-
case 1: // Green
74-
return bgr_pixel[1];
75-
76-
case 2: // Red
77-
return bgr_pixel[2];
78-
79-
default:
80-
std::cout << "!!! getComponent: " << bgr_component << " is not a valid component" << std::endl;
81-
break;
82-
}
83-
84-
return 0;
85-
}
86-
8759
/* displacementMapFilter: uses the pixel values of a map to displace the pixels of the target image.
8860
*
8961
* map: the input map image (BGR).

0 commit comments

Comments
 (0)