mirror of
https://github.com/2martens/uni.git
synced 2026-05-06 11:26:25 +02:00
Finished exercise 4 on sheet3
Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
35
ccv/sheet3/exercise4.cpp
Normal file
35
ccv/sheet3/exercise4.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
#include "lab_pyramid.h"
|
||||
|
||||
int main(int argc, char** argv ) {
|
||||
if ( argc != 2 )
|
||||
{
|
||||
printf("usage: <Image_Path>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
lab_pyramid pyramid = lab_pyramid(argv[1]);
|
||||
const int number_of_layers = 5;
|
||||
pyramid.create_pyramids(number_of_layers);
|
||||
gauss_pyramid l_pyr = pyramid.get_pyramid(lab_pyramid::COLOR_L);
|
||||
gauss_pyramid a_pyr = pyramid.get_pyramid(lab_pyramid::COLOR_A);
|
||||
gauss_pyramid b_pyr = pyramid.get_pyramid(lab_pyramid::COLOR_B);
|
||||
|
||||
for (int i = 0; i < number_of_layers; i++)
|
||||
{
|
||||
cv::imshow("Channel: L, Layer:" + std::to_string(i), l_pyr.get(i));
|
||||
cv::waitKey(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < number_of_layers; i++)
|
||||
{
|
||||
cv::imshow("Channel: A, Layer:" + std::to_string(i), a_pyr.get(i));
|
||||
cv::waitKey(0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < number_of_layers; i++)
|
||||
{
|
||||
cv::imshow("Channel: B, Layer:" + std::to_string(i), b_pyr.get(i));
|
||||
cv::waitKey(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user