Ask Your Question

Revision history [back]

In opencv color images are BGR blue(channel 0) Green (channel 1) Red (channel 2)

float R=(float)org.at<Vec3b>(x1,y1)[1]; SHOULD BE 2
float B=(float)org.at<Vec3b>(x1,y1)[0];
float G=(float)org.at<Vec3b>(x1,y1)[2];// SHOULD BE 1
cout<<"location of "<<i+1<<" blob is "<<x1<<","<<y1<<endl;
cout<<" blue channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[0]<<endl;
cout<<" green channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[2]<<endl; // SHOULD BE 1
cout<<" red channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[1]<<endl;// SHOULD BE 2

In opencv color images are BGR blue(channel 0) Green (channel 1) Red (channel 2)

float R=(float)org.at<Vec3b>(x1,y1)[1]; R=(float)org.at<Vec3b>(y1,x1)[1]; SHOULD BE 2
float B=(float)org.at<Vec3b>(x1,y1)[0];
B=(float)org.at<Vec3b>(y1,x1)[0];
float G=(float)org.at<Vec3b>(x1,y1)[2];// G=(float)org.at<Vec3b>(y1,x1)[2];// SHOULD BE 1
cout<<"location of "<<i+1<<" blob is "<<x1<<","<<y1<<endl;
cout<<" blue channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[0]<<endl;
is"<<(float)org.at<Vec3b>(y1,x1)[0]<<endl;
cout<<" green channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[2]<<endl; is"<<(float)org.at<Vec3b>(y1,x1)[2]<<endl; // SHOULD BE 1
cout<<" red channel pixel value at the location is"<<(float)org.at<Vec3b>(x1,y1)[1]<<endl;// is"<<(float)org.at<Vec3b>(y1,x1)[1]<<endl;// SHOULD BE 2