/* g++ -g -Wall stDev.cpp -o stDev `pkg-config --cflags --libs opencv4` */
#include
#include
#include
#include
#include
#include
// Library to include for
// drawing shapes
#include
#include
using namespace cv;
using namespace std;
int num=0;
int val=0;
double sumxyz=0.0;
double avg=0.0;
double stDev=0.0;
double err=0.0;
ifstream myFile_Handler;
int ReadSensor(string FileName);
int main(){
string FileX="/sys/bus/iio/devices/iio:device2/in_accel_x_raw";
string FileY="/sys/bus/iio/devices/iio:device2/in_accel_y_raw";
string FileZ="/sys/bus/iio/devices/iio:device2/in_accel_z_raw";
Mat image(300, 700, CV_8UC3,Scalar(0, 0, 0)); //creates a new blank image
// Check if the image is created successfully
if (!image.data) {
cout << "Could not open or find" << " the image";
return 0;
}
//assume variant coords +/- 50
/*
for (;;){
sumxyz=ReadSensor(FileX) + ReadSensor(FileY) + ReadSensor(FileZ) ;
//cout << " X: " << ReadSensor(FileX) << " Y: " << ReadSensor(FileY) << " Z: "<< ReadSensor(FileZ) << endl;
cout << " XYZ : " <