
        
// Auto-generated C Code - S2i Mosaicode
/*
*	In order to compile this source code run, in a terminal window, the following command:
*	gcc sourceCodeName.c `pkg-config --libs --cflags opencv` -o outputProgramName
*
*	the `pkg-config ... opencv` parameter is a inline command that returns the path to both
*	the libraries and the headers necessary when using opencv. The command also returns other necessary compiler options.
*/

#ifdef _CH_
#pragma package <opencv>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include "opencv2/core.hpp"
#include "opencv2/opencv.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/imgcodecs.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/features2d/features2d.hpp"

using namespace cv;
using namespace std;

#define FRAMERATE 1000.0 / 25.0


int main(int argc, char ** argv){
    char key = ' ';
            
    Mat image_file_32_output_image;
        
    Mat image_file_14_output_image;
        
    Mat image_file_31_output_image;
        
    Mat compose_rgb_30_input_image1;
    Mat compose_rgb_30_input_image2;
    Mat compose_rgb_30_input_image3;
    Mat block30_img_t0[3];
    Mat compose_rgb_30_output_image;
        
    Mat show_image_4_input_image;
    if(strcmp("WINDOW_NORMAL", "WINDOW_AUTOSIZE") == 0)
        namedWindow("My Image", WINDOW_NORMAL);
    else
        namedWindow("My Image", WINDOW_AUTOSIZE);

    while((key = (char)waitKey(FRAMERATE)) != 27){
        
    image_file_32_output_image = imread("/usr/share/mosaicode/extensions/examples/c/opencv/lenna.png", IMREAD_COLOR);
        
        if(!image_file_32_output_image.empty()) 
        	compose_rgb_30_input_image3 = image_file_32_output_image.clone();

    image_file_14_output_image = imread("/usr/share/mosaicode/extensions/examples/c/opencv/lenna.png", IMREAD_COLOR);
        
        if(!image_file_14_output_image.empty()) 
        	compose_rgb_30_input_image1 = image_file_14_output_image.clone();

    image_file_31_output_image = imread("/usr/share/mosaicode/extensions/examples/c/opencv/lenna.png", IMREAD_COLOR);
        
        if(!image_file_31_output_image.empty()) 
        	compose_rgb_30_input_image2 = image_file_31_output_image.clone();
        
    if(!compose_rgb_30_input_image1.empty()){
        block30_img_t0[0] = compose_rgb_30_input_image1;
        block30_img_t0[1] = compose_rgb_30_input_image2;
        block30_img_t0[2] = compose_rgb_30_input_image3;
        merge(block30_img_t0, 3, compose_rgb_30_output_image);
    }
        
        if(!compose_rgb_30_output_image.empty()) 
        	show_image_4_input_image = compose_rgb_30_output_image.clone();

    if(!show_image_4_input_image.empty()){
        imshow("My Image", show_image_4_input_image);
    }

                
    image_file_32_output_image.release();
        
    image_file_14_output_image.release();
        
    image_file_31_output_image.release();
        
    block30_img_t0[0].release();
    block30_img_t0[1].release();
    block30_img_t0[2].release();
    compose_rgb_30_output_image.release();
    compose_rgb_30_input_image1.release();
    compose_rgb_30_input_image2.release();
    compose_rgb_30_input_image3.release();
        
    show_image_4_input_image.release();

    }

    destroyAllWindows();
    return 0;
}
