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

Check point isInside matrix

$
0
0
I have been working on a piece of code where I need to work with square ROI scattered throughout the image. Each time I need to check if the patch is really contained inside the image (as efficiently as possible), and I expected to find some kind of native method in cv::Mat which provides this functionality. However, I haven't found it. The closest solution I have found is that described in [here](http://stackoverflow.com/questions/17235987/check-if-a-cvpoint-is-inside-a-cvmat). So, I would like to known if anyone knows about some native (fast) solution. Otherwise, I wondered if it is worth adding it as a pull request. The fast solution I was thinking of is sth like this: ``` x >= 0 && y >= 0 && x < mat.cols && y < mat.rows ``` I'm just willing to contribute, but as a newbie I wondered if such a simple method is not implemented yet because of some main reason I haven't taken into account.

Viewing all articles
Browse latest Browse all 41027

Trending Articles



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