I am using openCV function cvPutText, but it seems it won’t execute or it is quickly overwritten. Here is my block of code:
...
if(showResult==1){
cvNamedWindow("Znak", CV_WINDOW_AUTOSIZE);
cvShowImage("Znak", znak);
if(result == 0){
ascii_result = "A";
cvSet(znak, cvScalar(26,26,26));
cvPutText(znak, "A", cvPoint(13, 185), &font, cvScalar(255, 166, 44, 0));
printf("A working");
}
if(result == 1){
ascii_result = "B";
cvSet(znak, cvScalar(26,26,26));
cvPutText(znak, "B", cvPoint(13, 185), &font, cvScalar(255, 166, 44, 0));
printf("B working");
}
...
It isn’t in any loop. The problem is, that the window “Znak” is created, but cvSet() and cvPutText won’t execute or are overwritten…so I only see blank window with its deafult gray color
CvShowImage should be put every time you made change to the image and want to show it.
When you call cvShowImage it sends a copy of the image to the window. If you change the image in your code it will not change in the window, since it’s just a copy of an older image.