Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

entered numbers are overlapping

  why does numbers of image titles overlap each other?

          #include "stdafx.h"
>         #include <opencv2/highgui/highgui.hpp>
>         #include <opencv2/opencv.hpp>
>         #include <iostream>
>         #include <string>
>         
>         using namespace std;
>         using namespace cv;
>         
>         string print_name(int x){
>         
>           char buffer[15];
>           sprintf_s(buffer,"Resim %d",x);
>           return buffer;
>         }
>         
>         int main( int argc, char** argv ){
>             
>           int k=0;
>         
>             Mat small_image = imread("pluto.jpg"); 
>         
>             Mat im_out = Mat::zeros(600, 800, CV_8UC3);
>         
>             for (int i=0; i < 4; i++){
>         
>                 for(int j=0; j < 3; j++){
>                   k++;
>                   putText(small_image, print_name(k), Point(45, 180),
>                          FONT_HERSHEY_SCRIPT_SIMPLEX, 1,
>                          Scalar::all(255), 1,CV_AA);
>                   small_image.copyTo(im_out(Rect(i*200,j*200,small_image.cols,
>                          small_image.rows)));
>                 }
>             }
>             
>             imshow("window", im_out);
>             waitKey(0);
>             return 0;
>         }