Ask Your Question

Revision history [back]

Have you heard of cv::inrange or cv::threshold? Yellow is 255,255,0 in RGB, so I guess your yellow pixels in the final image have a B-value of zero and are therefore not turned to red. Maybe you want to write:

if ! (second[i,j,0]=0 and second[i,j,1]=0 and second[i,j,2]=0):
  turn_pixel_red();

Have you heard of cv::inrange or cv::threshold? Yellow is 255,255,0 in RGB, so I guess your yellow pixels in the final image have a B-value of zero and are therefore not turned to red. Maybe you want to write:

if ! (second[i,j,0]=0 not (second[i,j,0]==0 and second[i,j,1]=0 second[i,j,1]==0 and second[i,j,2]=0):
second[i,j,2]==0):
  turn_pixel_red();

Have you heard of cv::inrange or cv::threshold? Yellow is 255,255,0 in RGB, so I guess your yellow pixels in the final image have a B-value of zero and are therefore not turned to red. Maybe you want to write:write (now without types):

if not (second[i,j,0]==0 and second[i,j,1]==0 and second[i,j,2]==0):
  turn_pixel_red();

Have you heard of cv::inrange or cv::threshold? Yellow is 255,255,0 in RGB, so I guess your yellow pixels in the final image have a B-value of zero and are therefore not turned to red. Maybe you want to write (now without types):typos):

if not (second[i,j,0]==0 and second[i,j,1]==0 and second[i,j,2]==0):
  turn_pixel_red();