I am currently planning on splitting my image into 3 channels so i can get the RGB values of an image to plot a scatter graph so i can model is using a normal distribtion calculating the covariance matrix, mean, etc. then calculate distance between the background points and the actual image to segment the image.
Now in my first task, i have wrote the following code.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
Mat image, Rch,Gch,Bch;
vector<Mat> rgb(3); //RGB is a vector of 3 matrices
Bch = rgb;
Gch = rgb;
Rch = rgb;
but as soon as it reaches the split function, i step through it, it causes a unhandled exception error. access violation writing location 0xfeeefeee
i am still new to opencv, so am not used to dealing with unhandled exception error.
EDIT: i tried adding items into the vector still error, either via push_back or general assignment i.e. rgb = Rch or Bch still error.
it doesn't work, gives 0 value, but when i do run it, which image taken from camera, the terminal shows wierd characters if i replace pixel with cout << or most of the time it prints out blank characters.