title: Opencv unable to get ROI of highest intensity part
body: <p>I have tried this code.</p>
  
  <pre><code>import sys
  import numpy as np
  sys.path.append('/usr/local/lib/python2.7/site-packages')
  import cv2
  from cv2.cv import *
  img=cv2.imread("test2.jpg",cv2.IMREAD_COLOR)
  gimg = cv2.imread("test2.jpg",cv2.IMREAD_GRAYSCALE)
  b,g,r = cv2.split(img)
  ret,thresh1 = cv2.threshold(gimg,127,255,cv2.THRESH_BINARY);
  numrows = len(thresh1)    
  numcols = len(thresh1[0])
  thresh = 170
  im_bw = cv2.threshold(gimg, thresh, 255, cv2.THRESH_BINARY)[1]
  trig=0
  trigmax=0;
  xmax=0
  ymax=0
  for x in range(0,numrows):
  for y in range(0,numcols):
      if(im_bw[x][y]==1):
          trig=trig+1;
  if(trig&gt;5):
      xmax=x;
      ymax=y;
      break;
  print x,y,numrows,numcols,trig
  roi=gimg[xmax:xmax+200,ymax-500:ymax]
  cv2.imshow("roi",roi)
  WaitKey(0)
  </code></pre>
  
  <p>here <a href="http://www.fundusphoto.com/image_gallery/fundus%20photo%20web%20color%201.JPG" rel="nofollow">test2.jpg</a> is what I am tring to do is to concentrate on the high intensity part of the image(i.e the circle with high intensity in image).But my code does not seem to do so.
  Can anyone help?</p>