Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

split r g b matrix from rgb image

$
0
0
Mat image; Mat grayFrame; Mat blue_matrix ; Mat diffFrame; image = cv_ptr->image; float max=0; //obtain luminosity image and blue matrix and diffframe of blue and luminance for (int row = 0; row<=479; row++) { for (int col =0; col<=639; col++) { Vec3f color_value = image.at(row, col); int blue = color_value.val[0]; int green = color_value.val[1]; int red = color_value.val[2]; grayFrame.at(row,col) = round (0.21*red + 0.72*green + 0.07 * blue); blue_matrix.at(row,col) = blue; cout << blue<< " "<(row,col) = round (0.21*red + 0.72*green + 0.07 * blue); blue_matrix.at(row,col) = blue; Also, i notice the blue value is weird. This is the value i obtained -2147483648 -2147483648. Anyone help me with this problem please

Viewing all articles
Browse latest Browse all 41027

Trending Articles