#include < stdio.h > #include < stdlib.h > #include < time.h > void main() { ////////////////////////////////////////////////////////////////////////// //File Write by binary srand( time(0)); float feature[10]; for(int i=0; i<10; ++i) feature[i] = rand()/100; //data confirm for(int i=0; i< 10; ++i) printf("%lf\n", feature[i] ); FILE * fp; fp = fopen("output.txt", "wb"); fwrite(feature, sizeof(float), 10, fp); fclose(fp); printf("//////////////////////////////////////////////////////////////////////////\n"); ////////////////////////////////////////////////////////////////////////// //File Read by binary float feature_r[10]; FILE* fp2; fp2 = fopen("output.txt", "rb"); fread(feature_r, sizeof(float), 10, fp2); fclose(fp2); //data confirm for(int i=0; i< 10; ++i) printf("%lf\n", feature_r[i] ); ////////////////////////////////////////////////////////////////////////// }
1/10/2013
C file Write, Read by Binary - example source code
C file Write, Read by Binary - example source code
Subscribe to:
Post Comments (Atom)
-
Logistic Classifier The logistic classifier is similar to equation of the plane. W is weight vector, X is input vector and y is output...
-
dp parameter is about resolution of voting space. dp is larger, voting resolution is small compare to image size. so dp is larger, circle...
-
line, circle, rectangle, ellipse, polyline, fillConvexPoly, putText, drawContours example source code!!. ... //http://study....
-
In past, I wrote an articel about YUV 444, 422, 411 introduction and yuv rgb converting example code. refer to this page -> http://feel...
-
I once wrote the following article. http://study.marearts.com/2014/04/opencv-study-mat-point-access-method.html This article is a sample c...
-
Mounting Remote Data for GPU Training This guide explains how to access data from Computer A (data server) on Computer B (GPU machine) for...
-
//Singular value decomposition : Mat w, u, v; SVDecomp(data, w, u, v); // A = U W V^T //The flags cause U and V to be returned transpose...
-
refer to this code: . # If you want to combine a Vision Transformer (ViT) as an encoder with a Transformer-based decoder, # you can follow t...
-
The latent SVM tells the learning method used in this paper -> "Discriminatively trained deformable part models". The authors s...
-
EMD(earth mover distance) method is very good method to compare image similarity. But processing time is slow. For using the EMD compare, ...
No comments:
Post a Comment