Quantcast
Channel: OpenCV Q&A Forum - Latest question feed
Viewing all articles
Browse latest Browse all 19555

Nested if-else conditions

$
0
0
Hello All...I know this is very small and stupid doubt but I don't know why I'm getting stuck here. I am using nested if-else loops inside "for" loop in my code but it at all not going inside this "for" loop. I checked it by putting Log.d statements inside each condition but none of then are getting printed. My block of code is as follows: Mat fin = new Mat (gray.rows(), gray.cols(), CvType.CV_8UC3); for (int ii=0;ii31 && gray.get(ii, j)[0] < 64) { fin.get(ii, j)[0] = 2; } else if (gray.get(ii, j)[0] > 63 && gray.get(ii, j)[0] < 96) { fin.get(ii, j)[0] = 3; } else if (gray.get(ii, j)[0] > 95 && gray.get(ii, j)[0] < 128) { fin.get(ii, j)[0] = 4; } else if (gray.get(ii, j)[0] > 127 && gray.get(ii, j)[0] < 160) { fin.get(ii, j)[0] = 5; } else if (gray.get(ii, j)[0] > 159 && gray.get(ii, j)[0] < 192) { fin.get(ii, j)[0] = 6; } else if (gray.get(ii, j)[0] > 191 && gray.get(ii, j)[0] < 224) { fin.get(ii, j)[0] = 7; } else if (gray.get(ii, j)[0] > 223 && gray.get(ii, j)[0] < 256) { fin.get(ii, j)[0] = 8; } } } Please help!! Thanks in advance!!

Viewing all articles
Browse latest Browse all 19555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>