{"id":1170,"date":"2014-05-13T01:47:07","date_gmt":"2014-05-12T17:47:07","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1170"},"modified":"2014-05-13T17:22:13","modified_gmt":"2014-05-13T09:22:13","slug":"%e5%8e%8b%e5%8a%9b%e6%b5%8b%e8%af%95%e5%9b%be%e7%89%87%e7%94%9f%e6%88%90%e4%bb%a3%e7%a0%81","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1170","title":{"rendered":"\u538b\u529b\u6d4b\u8bd5\u56fe\u7247\u751f\u6210\u4ee3\u7801"},"content":{"rendered":"
\u538b\u529b\u6d4b\u8bd5\u56fe\u7247\u751f\u6210\u4ee3\u7801<\/p>\n
\r\n\r\n\r\n\tIplImage * pImg = NULL; \r\n\r\n\tCString strName;\r\n\t\/*\r\n\tCvScalar s;\r\n\ts.val[0]=s.val[1]=s.val[2]=s.val[3]=0;\/\/black\r\n\t\/\/1111-9999\r\n\t\r\n\tfor (int kk = 1111;kk<2999;kk++)\r\n\t{\r\n\t\tif(pImg != NULL)\r\n\t\t\tcvReleaseImage(&pImg);\r\n\t\tpImg =cvLoadImage( \"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\75tv.jpg\" , 1 ) ;\r\n\t\tfloat nwidth = (float)pImg->width\/24;\r\n\t\tfloat nheight = (float)pImg->height\/30;\r\n\t\tstrName.Format(\"%d\",kk);\r\n\t\t\/\/\u5f97\u5230\u6bcf\u4e00\u4f4d\u7136\u540e\u53bb\u6d82\u3002\u3002\u3002\r\n\t\tint num1 = strName.GetAt(0)-48;\r\n\t\tint num2 = strName.GetAt(1) -48;\r\n\t\tint num3 = strName.GetAt(2)-48;\r\n\t\tint num4 = strName.GetAt(3)-48;\r\n\t\t\r\n\t\t\/\/3\r\n\t\tfor (int x = 2*nwidth;x<3*nwidth;x++)\r\n\t\t{\r\n\t\t\tfor (int y = (5+num1)*nheight;y<(5+num1+1)*nheight;y++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pImg,y,x,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\/\/strName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",strName);\r\n\t\t\t\/\/cvSaveImage (strName,pImg);\r\n\t\t\t\r\n\t\t}\r\n\t\t\/\/4\r\n\t\tfor (int x2 = 3*nwidth;x2<4*nwidth;x2++)\r\n\t\t{\r\n\t\t\tfor (int y2 = (5+num2)*nheight;y2<(5+num2+1)*nheight;y2++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pImg,y2,x2,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\/\/strName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",strName);\r\n\t\t\t\/\/cvSaveImage (strName,pImg);\r\n\t\t\t\r\n\t\t}\r\n\t\t\/\/5\r\n\t\tfor (int x3 = 4*nwidth;x3<5*nwidth;x3++)\r\n\t\t{\r\n\t\t\tfor (int y3 = (5+num3)*nheight;y3<(5+num3+1)*nheight;y3++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pImg,y3,x3,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\/\/strName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",strName);\r\n\t\t\t\/\/cvSaveImage (strName,pImg);\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t\/\/6\r\n\t\t\r\n\t\tfor (int x4 = 5*nwidth;x4<6*nwidth;x4++)\r\n\t\t{\r\n\t\t\tfor (int y4 = (5+num4)*nheight;y4<(5+num4+1)*nheight;y4++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pImg,y4,x4,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t\/\/strName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",strName);\r\n\t\t\t\/\/cvSaveImage (strName,pImg);\r\n\t\t\r\n\t\t}\r\n\t\tstrName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",kk);\r\n\t\tcvSaveImage (strName,pImg);\t\r\n\r\n\t}\r\n\t*\/\r\n\t\/\/\r\n\t\r\n\t\/\/\u518d\u5f00\u59cb\u5408\u6210\r\n\tCvScalar s;\r\n\ts.val[0]=s.val[1]=s.val[2]=s.val[3]=255;\/\/white\r\n\tIplImage * pOKImg = cvCreateImage(cvSize(800,600),8,1);\r\n\tfor (int u =1111;u<2999;u++)\r\n\t{\r\n\t\tfor (int a = 0;a<800;a++)\r\n\t\t{\r\n\t\t\tfor (int b = 0;b<600;b++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pOKImg,b,a,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\r\n\t\t}\r\n\t\t\/\/\u52a0\u8f7d\u56fe\u7247\r\n\t\tCString strName;\r\n\t\tstrName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d.jpg\",u);\r\n\t\tIplImage * pImg = cvLoadImage(strName,0);\r\n\t\tCvScalar s2;\r\n\t\tfor (int i = 0 ;iwidth;i++)\r\n\t\t{\r\n\t\t\tfor (int j=0 ; j height;j++)\r\n\t\t\t{\r\n\t\t\t\ts2=cvGet2D(pImg,j,i);\r\n\t\t\t\tcvSet2D(pOKImg,j+30,i+30,s2);\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\tstrName.Format(\"C:\\\\Documents and Settings\\\\Administrator\\\\\u684c\u9762\\\\\u538b\u529b\u6d4b\u8bd5\u7528\u56fe\u7247\\\\%d.jpg\",u);\r\n\t\tcvSaveImage (strName,pOKImg);\r\n\r\n\t}\r\n\t\r\n\r\n\t\/*\r\n\tfor (int i = 0 ;i<3 ;i++)\/\/\u884c\u5faa\u73af\r\n\t{\r\n\r\n\t\tfor (int j = 0 ;j<9 ;j++)\/\/\u5217\u5faa\u73af\r\n\t\t{\r\n\t\t\tfor (int y = (6+j)*nheight;y<(6+j+1)*nheight;y++)\r\n\t\t\t{\r\n\t\t\t\tcvSet2D(pImg,y,x,s);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\tfor (int m = 0 ;m<9 ;m++)\/\/\u5217\u5faa\u73af\r\n\t\t\t{\r\n\t\t\t\tfor (int n = 0 ;n<9 ;n++)\/\/\u5217\u5faa\u73af\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tfor (int x = (3+i)*nwidth;x<(3+i+1)*nwidth;x++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tfor (int y = (6+j)*nheight;y<(6+j+1)*nheight;y++)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcvSet2D(pImg,y,x,s);\r\n\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tstrName.Format(\"\u538b\u529b\u6d4b\u8bd5\u4e13\u7528\u6587\u4ef6\u5939\\\\%d%d.jpg\",i,j);\r\n\t\t\t\t\t\tcvSaveImage (strName,pImg);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\r\n\t\t}\r\n\t}\r\n\t*\/\r\n\r\n\r\n\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":" \u538b\u529b\u6d4b\u8bd5\u56fe\u7247\u751f\u6210\u4ee3\u7801<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[9],"tags":[139,196],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1170"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1170"}],"version-history":[{"count":4,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1170\/revisions"}],"predecessor-version":[{"id":1180,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1170\/revisions\/1180"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1170"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}