hey! in this shown product image, I have to detect the position of this yellow highlighted box In list of images given on the left side . how can I do this? please help
instead of working with screenshots, is it at all possible to access the page’s DOM tree?
Nope. that’s the drawback. I just have images like these, where I should find and detect the place of that highlighted box
Try converting the image to a different color space (HSV or LAB). Analyze the individual channels to see if you can filter your desired region of interest.
I would take the left region of image, filter that color out as mentioned. Threshold, draw contours outside, in case some items in the images are the same color. For each contour, subtract the min y from the max y to get the height in pixels, the contour with the max height would have to be the yellow box, unless some of the images are missing the box. I guess you could just draw contours on that area of the image and find the one with max height or width as it looks like that highlighted box is larger then the other ones. Then finding the position is simple.
Or get the contour with max area, or even draw complex conts and get the one with max length, should work.