怎么把matlab 训练的model 保存下来 然后在opencv 中调用
2016-08-11 15:37
1226 查看
主要参考:
http://www.tuicool.com/articles/QvAr22
成功的标志:
1. 在我的电脑:
D:\搜狗高速下载\libsvm-dense-3.20\libsvm-dense-3.20\matlab
出现:svm_savemodel.mexw64
遇到的错误:前面几次执行make 一直不出现svm_savemodel.mexw64的原因是我开了两个matlab
其中一个matlab 在使用svmtrain的程序 所以在 D:\搜狗高速下载\libsvm-dense-3.20\libsvm-dense-3.20\matlab
下面发现只更新了libsvmread.mexw64 和libsvmwrite.mexw64。
所以在make的时候:把:
mex CFLAGS="\$CFLAGS
-std=c99" -largeArrayDims svm_savemodel.c ../svm.cpp svm_model_matlab.c
加在
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svm_savemodel.c ../svm.cpp svm_model_matlab.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c
这个只是偶然的错误,不具有普遍性。
2. 使用方法:
model = svmtrain( double(Train_label), double(Feature_train_norm), '-c 0.1649 -g 9.7656e-04');
svm_savemodel(model,'model.model');
在当前的目录下生成:
http://www.tuicool.com/articles/QvAr22
成功的标志:
1. 在我的电脑:
D:\搜狗高速下载\libsvm-dense-3.20\libsvm-dense-3.20\matlab
出现:svm_savemodel.mexw64
遇到的错误:前面几次执行make 一直不出现svm_savemodel.mexw64的原因是我开了两个matlab
其中一个matlab 在使用svmtrain的程序 所以在 D:\搜狗高速下载\libsvm-dense-3.20\libsvm-dense-3.20\matlab
下面发现只更新了libsvmread.mexw64 和libsvmwrite.mexw64。
所以在make的时候:把:
mex CFLAGS="\$CFLAGS
-std=c99" -largeArrayDims svm_savemodel.c ../svm.cpp svm_model_matlab.c
加在
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svm_savemodel.c ../svm.cpp svm_model_matlab.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c
mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c
这个只是偶然的错误,不具有普遍性。
2. 使用方法:
model = svmtrain( double(Train_label), double(Feature_train_norm), '-c 0.1649 -g 9.7656e-04');
svm_savemodel(model,'model.model');
在当前的目录下生成:
svm_type c_svc kernel_type rbf gamma 0.00097656 nr_class 2 total_sv 4292 rho 0.939511 label 0 1 nr_sv 2146 2146 SV 0.1649 1:0.046779478 2:0.0040677807 3:0.0040677807 4:0.012203342 5:0.0040677807 7:0.0081355614 8:0.034576136 9:0.065084491 10:0.028474465 12:0.1057623 13:0.0040677807 14:0.0020338904 15:0.0040677807 16:0.20338904 17:0.095592847 18:0.0020338904 19:0.0040677807 20:0.0020338904 21:0.040677807 23:0.13423676 24:0.66711604 25:0.020338904 26:0.0061016711 27:0.0020338904 28:0.0020338904 29:0.0061016711 30:0.0061016711 31:0.0040677807 32:0.12813509 33:0.0061016711 39:0.0020338904 40:0.0020338904 41:0.018305013 42:0.061016711 43:0.0040677807 44:0.17084679 48:0.091525066 55:0.0040677807 56:0.034576136 58:0.0020338904 60:0.0040677807 64:0.018305013 65:0.0040677807 66:0.0020338904 72:0.0020338904 76:0.0081355614 87:0.0020338904 88:0.0020338904 96:0.0020338904 97:0.022372794 100:0.0020338904 101:0.0020338904 104:0.0020338904 105:0.11593175 106:0.20745682 107:0.0040677807 108:0.14237233 109:0.0020338904 112:0.061016711 119:0.0040677807 120:0.030508355 121:0.0020338904 122:0.0020338904 124:0.0020338904 125:0.0020338904 127:0.0020338904 128:0.012203342 137:0.0020338904 140:0.0061016711 145:0.014237233 147:0.0020338904 148:0.0020338904 149:0.032542246 151:0.19321958 152:0.18305013 153:0.0061016711 157:0.0040677807 159:0.0020338904 160:0.022372794 169:0.0040677807 185:0.0020338904 189:0.0020338904 192:0.0061016711 193:0.028474465 194:0.0040677807 200:0.0061016711 201:0.0040677807 202:0.0061016711 208:0.010169452 209:0.05491504 210:0.0020338904 211:0.0020338904 213:0.034576136 215:0.022372794 216:0.046779478 217:0.0020338904 218:0.0040677807 223:0.0020338904 224:0.018305013 225:0.077287834 229:0.0061016711 231:0.0061016711 232:0.016271123 233:0.34982914 234:0.15254178 236:0.014237233 237:0.020338904 239:0.018305013 240:0.10169452 241:0.13423676 242:0.0061016711 244:0.0020338904 245:0.061016711 246:0.0020338904 247:0.016271123 248:0.095592847 249:0.148474 250:0.05694893 251:0.0040677807 252:0.0040677807 253:0.024406684 254:0.0020338904 255:0.010169452 256:0.14440622 0.1649 1:0.008487686 3:0.010912739 4:0.0072751594 7:0.0048501063 8:0.04607601 9:0.010912739 10:0.0072751594 12:0.10912739 16:0.80026754 18:0.0036375797 21:0.016975372 22:0.0036375797 23:0.04243843 24:0.1733913 26:0.0072751594 28:0.0036375797 31:0.0072751594 32:0.3055567 41:0.0072751594 42:0.050926116 44:0.072751594 48:0.12731529 51:0.0036375797 56:0.0036375797 57:0.0036375797 58:0.0036375797 63:0.0036375797 64:0.032738217 65:0.0024250531 76:0.0036375797 87:0.0024250531 96:0.0036375797 97:0.010912739 101:0.0072751594 105:0.083664333 106:0.094577072 108:0.069114014 109:0.0036375797 111:0.0024250531 112:0.025463058 128:0.0072751594 129:0.0036375797 136:0.0036375797 144:0.0072751594 145:0.014550319 146:0.0036375797 147:0.0036375797 149:0.010912739 151:0.056988749 152:0.043650956 157:0.0024250531 160:0.025463058 183:0.0036375797 191:0.0036375797 193:0.012125266 195:0.0024250531 196:0.0036375797 197:0.0036375797 208:0.0072751594 209:0.041225903 211:0.0036375797 213:0.040013377 215:0.033950744 216:0.0036375797 221:0.0024250531 222:0.0036375797 224:0.0072751594 225:0.054563696 229:0.0024250531 232:0.0072751594 233:0.19764183 234:0.018187899 236:0.018187899 240:0.080026754 241:0.29100638 242:0.0036375797 244:0.0036375797 245:0.016975372 247:0.010912739 248:0.040013377 249:0.12610276 250:0.040013377 253:0.031525691 254:0.0072751594 255:0.014550319 256:0.082451807 0.1649 1:0.061058474 2:0.0038161546 4:0.0038161546 7:0.017172696 8:0.085863479 9:0.026713082 10:0.017172696 12:0.083955402 13:0.0057242319 14:0.0057242319 15:0.0057242319 16:0.61249282 17:0.02862116 21:0.022896928 23:0.1259331 24:0.48655971 25:0.0057242319 26:0.0057242319 28:0.011448464 31:0.011448464 32:0.40069624 33:0.0057242319 35:0.0057242319 41:0.017172696 43:0.0057242319 44:0.068690783 47:0.0057242319 48:0.057242319 49:0.0057242319 56:0.011448464 62:0.0057242319 63:0.0057242319 64:0.040069624 65:0.0095403866 71:0.0038161546 81:0.0038161546 85:0.0057242319 87:0.0057242319 97:0.02098885 104:0.011448464 105:0.036253469 106:0.02862116 107:0.011448464 108:0.017172696 109:0.0057242319 112:0.045793855 121:0.0057242319 122:0.0057242319 125:0.0057242319 128:0.022896928 136:0.0057242319 144:0.0057242319 145:0.022896928 146:0.0057242319 149:0.040069624 151:0.034345392 152:0.074415015 158:0.0057242319 160:0.02098885 176:0.0057242319 192:0.026713082 193:0.02098885 195:0.0038161546 200:0.011448464 201:0.011448464 209:0.074415015 211:0.0057242319 212:0.0057242319 213:0.085863479 215:0.13165733 216:0.022896928 217:0.0057242319 218:0.0038161546 220:0.0057242319 224:0.011448464 225:0.062966551 228:0.0057242319 229:0.0038161546 231:0.0057242319 232:0.011448464 233:0.20034812 234:0.034345392 235:0.0038161546 236:0.017172696 239:0.0057242319 240:0.091587711 241:0.17745119 242:0.0057242319 244:0.0057242319 245:0.091587711 247:0.034345392 248:0.085863479 249:0.1259331 250:0.040069624 252:0.011448464 253:0.030529237 254:0.017172696 255:0.0057242319 256:0.10303617 0.1649 1:0.014300819 2:0.0079448997 3:0.0047669398 5:0.0047669398 7:0.0047669398 8:0.096927776 9:0.014300819 10:0.0095338796 12:0.093749816 13:0.0095338796 16:0.50052868 17:0.042902458 20:0.0047669398 21:0.033368579 23:0.076271037 24:0.73410873 25:0.038135518 26:0.0095338796 28:0.022245719 29:0.0047669398 31:0.0047669398 32:0.34957558 42:0.028601639 44:0.038135518 46:0.0047669398 48:0.076271037 55:0.0047669398 56:0.0047669398 63:0.0047669398 64:0.047669398 65:0.014300819 67:0.0047669398 72:0.0047669398 87:0.0047669398 93:0.0047669398 96:0.0047669398 97:0.0095338796 100:0.0047669398 105:0.0095338796 106:0.066737157 108:0.052436338 112:0.019067759 117:0.0047669398 125:0.0047669398 128:0.0047669398 145:0.019067759 149:0.027012659 151:0.057203277 152:0.10010574 157:0.0031779599 159:0.0047669398 160:0.036546538 191:0.0047669398 192:0.023834699 193:0.0063559197 209:0.01112286 212:0.0031779599 213:0.019067759 215:0.017478779 216:0.047669398 224:0.0095338796 225:0.0095338796 226:0.0047669398 232:0.0047669398 233:0.038135518 234:0.014300819 236:0.019067759 239:0.0047669398 240:0.038135518 241:0.0047669398 245:0.023834699 247:0.019067759 248:0.057203277 249:0.0095338796 250:0.015889799 252:0.0047669398 253:0.0095338796 254:0.0079448997 256:0.10963962 0.1649 1:0.082918266 2:0.016048697 3:0.03362584 4:0.030951058 5:0.010699131 6:0.0015284473 7:0.027512051 8:0.093999508 9:0.053495655 10:0.034390064 11:0.0061137892 12:0.18035678 13:0.0049674537 14:0.0026747828 15:0.006495901 16:0.42414412 17:0.029804722 18:0.006495901 19:0.0015284473 20:0.0061137892 21:0.022162486 22:0.0015284473 23:0.1066092 24:0.33778685 25:0.021780374 26:0.0030568946 27:0.0011463355 28:0.011845467 29:0.0045853419 30:0.0019105591 31:0.0061137892 32:0.355364 33:0.011845467 34:0.0011463355 35:0.00420323 36:0.0030568946 37:0.00038211182 39:0.0038211182 40:0.0015284473 41:0.038975406 42:0.049292425 43:0.00420323 44:0.17959256 45:0.0022926709 46:0.0015284473 47:0.0057316773 48:0.24302312 49:0.00076422365 50:0.00076422365 51:0.00076422365 52:0.00038211182 54:0.00038211182 55:0.0072601246 56:0.010317019 57:0.0057316773 58:0.0045853419 60:0.0080243483 61:0.0034390064 62:0.0022926709 63:0.00420323 64:0.14825939 65:0.042414412 66:0.00420323 67:0.01260969 68:0.0061137892 69:0.0019105591 70:0.0011463355 71:0.0034390064 72:0.0076422365 73:0.0045853419 74:0.0049674537 76:0.0091706837 77:0.00038211182 78:0.00038211182 80:0.0068780128 81:0.0022926709 84:0.00076422365 85:0.0030568946 86:0.00038211182 87:0.0045853419 88:0.0053495655 89:0.00038211182 93:0.00076422365 94:0.00038211182 96:0.0068780128 97:0.022926709 98:0.0022926709 99:0.00420323 100:0.0015284473 101:0.0011463355 103:0.0034390064 104:0.0038211182 105:0.094763732 106:0.095910068 107:0.0049674537 108:0.177682 109:0.006495901 110:0.0061137892 111:0.00420323 112:0.12724324 113:0.0053495655 114:0.00038211182 115:0.00038211182 116:0.00038211182 117:0.0045853419 119:0.0038211182 120:0.011463355 121:0.0095527956 122:0.0022926709 124:0.0053495655 125:0.0072601246 126:0.0057316773 127:0.0019105591 128:0.092471061 129:0.0087885719 131:0.00076422365 132:0.0034390064 136:0.0034390064 137:0.00420323 138:0.0015284473 139:0.00038211182 140:0.0091706837 141:0.0019105591 142:0.00076422365 144:0.0072601246 145:0.015666585 146:0.0022926709 147:0.0019105591 148:0.0045853419 149:0.022926709 150:0.0011463355 151:0.074893917 152:0.13756026 153:0.00420323 154:0.0019105591 155:0.00076422365 156:0.0034390064 157:0.0019105591 158:0.0045853419 159:0.0019105591 160:0.10164174 169:0.0011463355 170:0.0015284473 172:0.0030568946 175:0.00038211182 176:0.0049674537 177:0.00420323 179:0.00076422365 181:0.00076422365 183:0.0038211182 184:0.0053495655 185:0.0015284473 186:0.0019105591 187:0.00038211182 188:0.0034390064 189:0.00076422365 190:0.0049674537 191:0.0015284473 192:0.048528201 193:0.03362584 194:0.0022926709 195:0.0053495655 196:0.0045853419 197:0.00076422365 199:0.0015284473 200:0.0019105591 201:0.0068780128 202:0.0022926709 203:0.0011463355 204:0.0080243483 208:0.0080243483 209:0.05655255 210:0.0053495655 211:0.0053495655 212:0.0038211182 213:0.053113543 214:0.0022926709 215:0.056170438 216:0.050820872 217:0.0034390064 218:0.0026747828 220:0.0061137892 221:0.00076422365 222:0.0038211182 223:0.0015284473 224:0.048528201 225:0.045471307 226:0.0034390064 227:0.0030568946 228:0.0038211182 231:0.00076422365 232:0.0084064601 233:0.13526759 234:0.11386932 235:0.0015284473 236:0.082154042 237:0.0061137892 238:0.00076422365 239:0.0026747828 240:0.10164174 241:0.090942614 242:0.0076422365 243:0.0015284473 244:0.0072601246 245:0.066869569 246:0.0019105591 247:0.036682735 248:0.051585096 249:0.14176349 250:0.076804476 251:0.0022926709 252:0.053113543 253:0.052731432 254:0.056170438 255:0.023690933 256:0.3973963 0.1649 1:0.0408833 3:0.010220825 4:0.02452998 7:0.018397485 8:0.030662475 9:0.01226499 10:0.00408833 12:0.042927465 14:0.006132495 16:0.30662475 17:0.079722435 19:0.006132495 20:0.006132495 21:0.067457445 23:0.14104738 24:0.62551449 25:0.006132495 29:0.01226499 31:0.01226499 32:0.46606962 36:0.00408833 40:0.01226499 44:0.02452998 48:0.06950161 64:0.079722435 68:0.00408833 87:0.006132495 88:0.01226499 94:0.006132495 96:0.006132495 97:0.018397485 105:0.055192455 106:0.026574145 108:0.006132495 112:0.03679497 120:0.010220825 128:0.02452998 129:0.006132495 140:0.006132495 145:0.02452998 147:0.006132495 149:0.079722435 150:0.006132495 151:0.17784235 152:0.18397485 158:0.006132495 160:0.07358994 192:0.01226499 193:0.006132495 197:0.006132495 202:0.006132495 208:0.006132495 209:0.055192455 213:0.079722435 215:0.11038491 216:0.091987425 220:0.006132495 224:0.03679497 225:0.030662475 231:0.006132495 233:0.14104738 234:0.03270664 236:0.018397485 237:0.01226499 240:0.06950161 241:0.22690231 242:0.006132495 245:0.06132495 247:0.09811992 248:0.1226499 249:0.07358994 250:0.03679497 252:0.01226499 253:0.03679497 254:0.01226499 255:0.01226499 256:0.12878239 0.1649 1:0.099513219 2:0.027139969 3:0.0090466563 5:0.0090
相关文章推荐
- OpenCV调用摄像头录像并保存下来
- OpenCV调用摄像头录像并保存下来
- OpenCV调用摄像头录像并保存下来
- 关于matlab 中libsvm中model中的保存与调用新发现
- matlab程序修改 批量人脸检测(调用opencv训练好的xml )
- OpenCV学习笔记(12)OpenCV调用Matlab函数进行保存视频的尝试
- matlab中libsvm训练的svm分类器model保存/读写文件接口
- OpenCV调用摄像头录像并保存下来
- OpenCV调用摄像头录像并保存下来
- OpenCV调用摄像头录像并保存下来
- Matlab中连续读入并处理图像,然后保存至指定文件夹下-dir,strcat,fullfie,imread,imwrite
- matlab 怎么保存plot的图 到指定文件夹
- matlab调用opencv
- matlab调用opencv库
- MATLAB调用OpenCV2.4库函数的全过程及问题解决
- Matlab调用opencv库函数的具体应用
- 如何将opencv的处理结果保存由matlab分析
- matlab 调用opencv函数方法及matlab编译c++程序
- windows下可运行的mat转xml,VOC-release4.01 DPM训练的model(mat)转为OpenCV latentsvm可以加载的model(xml)
- matlab的数据如何保存成文件被VS调用