c++ - Why cvPutText doesn't work in this case? -
i using opencv function cvputtext, seems won't execute or overwritten. here 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 loop. problem is, window "znak" created, cvset() , cvputtext won't execute or overwritten...so see blank window deafult gray color
cvshowimage should put every time made change image , want show it.
... 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)); cvshowimage("znak", znak); 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)); cvshowimage("znak", znak); printf("b working"); } ...
when call cvshowimage sends copy of image window. if change image in code not change in window, since it's copy of older image.
Comments
Post a Comment