opencv3.1 +windows10+ vs2015 Configuration See article
WIN10 vs2015 Configuration Opencv3.1.0 process detailed (GO)
Code tested, highly recognized, test image 50w, recognition rate of more than 90%
If you can combine the Microsoft Oxford Program API to identify picture items HTTPS://WWW.AZURE.CN/PROJECTOXFORD/DEMO/VISION#OCR
#include <stdio.h>#include<stdlib.h>#include<ctype.h>#include<iostream>#include"highgui.h"#include"cvaux.h"Iplimage*Praw;floatVideoblurdetect (iplimage*data) { intWidth=data->Widthstep; intHeight=data->height; ushort* Sobeltable =New ushort[width*height]; memset (sobeltable,0, width*height*sizeof(ushort)); intI, J, Mul; Uchar* Udata = (uchar*) data->ImageData; for(i =1, mul = I*width; I < height-1; i++, Mul + =width) for(j =1; J < Width-1; J + +) Sobeltable[mul+j]=abs (udata[mul+j-width-1] +2*udata[mul+j-1] + udata[mul+j-1+width]-Udata[mul+j+1-width]-2*udata[mul+j+1]-udata[mul+j+width+1]); for(i =1, mul = I*width; I < height-1; i++, Mul + =width) for(j =1; J < Width-1; J + +) if(Sobeltable[mul+j] < -|| SOBELTABLE[MUL+J] <= sobeltable[mul+j-1] ||Sobeltable[mul+J] <= sobeltable[mul+j+1]) Sobeltable[mul+j] =0; intTotlen =0; intTotcount =1; Uchar Suddenthre= -; Uchar Samethre=3; for(i =1, mul = I*width; I < height-1; i++, Mul + =width) { for(j =1; J < Width-1; J + +) { if(sobeltable[mul+J]) {intCount =0; Uchar Tmpthre=5; Uchar Max= Udata[mul+j] > udata[mul+j-1] ?0:1; for(intt = j; T >0; t--) {Count++; if(ABS (UDATA[MUL+T)-udata[mul+t-1]) >Suddenthre) Break; if(Max && udata[mul+t] > udata[mul+t-1]) Break; if(!max && udata[mul+t] < udata[mul+t-1]) Break; intTMP =0; for(ints = t; s >0; s--) { if(ABS (Udata[mul+t]-udata[mul+s]) <Samethre) {tmp++; if(tmp > Tmpthre) Break; } Else Break; } if(tmp > Tmpthre) Break; } Max= Udata[mul+j] > udata[mul+j+1] ?0:1; for(intt = j; T < width; t++) {Count++; if(ABS (UDATA[MUL+T)-udata[mul+t+1]) >Suddenthre) Break; if(Max && udata[mul+t] > udata[mul+t+1]) Break; if(!max && udata[mul+t] < udata[mul+t+1]) Break; intTMP =0; for(ints = t; s < width; s++) { if(ABS (Udata[mul+t]-udata[mul+s]) <Samethre) {tmp++; if(tmp > Tmpthre) Break; } Else Break; } if(tmp > Tmpthre) Break; } Count--; Totcount++; Totlen+=count; } } } floatresult = (float) totlen/Totcount; Delete[] sobeltable; returnresult;}intMain () {//cvcapture* cvcreatecameracapture ( -1); floatre; Iplimage* Praw=cvloadimage ("D:/123.jpg", Cv_load_image_grayscale); Re=Videoblurdetect (Praw); Std::cout<<re; Cvnamedwindow ("Example", cv_window_autosize); Cvshowimage ("Example", Praw); Cvwaitkey (0); Cvreleaseimage (&Praw); Cvdestroywindow ("Example"); return 0;}
Image fuzzy recognition C + + code based on OPECV 3.1