roi

roipoly matlab function equivalent in OpenCV

和自甴很熟 提交于 2019-11-28 11:30:29
问题 I am converting a matlab code into C++ using OpenCV libraries. Can anyone tell me roipoly matlab function equivalent in OpenCV?? Or how to get the same functionality using OpenCV? BW = roipoly(I, c, r) BW = roipoly(I, c, r) returns the ROI specified by the polygon described by vectors c and r, which specify the column and row indices of each vertex, respectively. c and r are of same size. In my case I want to extract triangular roi from the image, so c and r are of size 3x1. Can anyone tell

R-FCN:

跟風遠走 提交于 2019-11-28 09:36:01
和Faster R-CNN相比,R-FCN具有更深的共享卷积网络层,这样可以获得更加抽象的特征 抽象特征的捕获能否通过“sketch/conceptual...” - guided 来进行? 想法还是说把逻辑推理和深度学习暴力计算相结合,各自发挥各自的优势~ 4. R-FCN网络的设计动机 Faster R-CNN是首个利用CNN来完成proposals预测的,从此之后很多的目标检测网络都开始使用Faster R-CNN的思想。而Faster R-CNN系列的网络都可以分成2个部分:ROI Pooling之前的共享全卷积网络和ROI Pooling之后的ROI-wise子网络(用来对每个ROI进行特征提出,并进行回归和分类)。第1部分就是直接用普通分类网络的卷积层,用来提取共享特征,然后利用ROI Pooling在最后一层网络形成的feature map上面提取针对各个RoIs的特征向量,然后将所有RoIs的特征向量都交给第2部分来处理(即所谓的分类和回归),而第二部分一般都是一些全连接层,在最后有2个并行的loss函数:softmax和smoothL1,分别用来对每一个RoI进行分类和回归,这样就可以得到每个RoI的真实类别和较为精确的坐标信息啦(x, y, w, h)。 需要注意的是第1部分通常使用的都是像VGG、GoogleNet、ResNet之类的基础分类网络

How can one easily detect whether 2 ROIs intersects in OpenCv?

▼魔方 西西 提交于 2019-11-28 06:56:38
I am trying to detect whether 2 Regions of Interest ( CvRect s) are intersecting one another in OpenCV. I can obviously manually type several (or rather a lot of) conditions to be checked but that wouldn't really be a good way to do it (imo). Can anyone suggest me any other solution? Is there a ready method in OpenCV for that ? I do not know of any ready-made solution for the C interface ( CvRect ), but if you use the C++ way ( cv::Rect ), you can easily say interesect = r1 & r2; The complete list of operations on rectangles is // In addition to the class members, the following operations //

OpenCv assertion failed

跟風遠走 提交于 2019-11-28 06:48:07
问题 I am working on application for finding face in 2D image and later inside same image I want to find mouth, but I have some problem right now. This is my code so far: for (int i = 0; i < faces.size(); i++) { Point pt1(faces[i].x, faces[i].y); Point pt2((faces[i].x + faces[i].height), (faces[i].y + faces[i].width)); rectangle(frame, pt1, pt2, Scalar(255,0 , 0), 2, 8, 0); //I WANT ROI(FOR MOUTH DETECTION) TO BE ONLY HALF OF THE RECTANGLE WITH FACE Rect mouthROI; mouthROI.x = (faces[i].x);

Error setting ROI OpenCV Android

只谈情不闲聊 提交于 2019-11-28 05:03:34
问题 I am trying to figure out how to set the ROI for an Image in OpenCV on Android. I have done this on other operating systems, so I think HOW I am doing it is semantically correct, but there is an error somewhere. So far I have tried this Rect roi = new Rect(0, 0, inputFrame.cols(), inputFrame.rows()); Mat cropped = new Mat(inputFrame, roi); However I get an error somewhere in the OpenCV classes that looks like this Utils.matToBitmap() throws an exception:/home/reports/ci/slave/opencv/modules

copying non-rectangular roi opencv

∥☆過路亽.° 提交于 2019-11-27 20:48:44
I want to copy a part of an image which is not rectangle with C++ opencv. The corner points of the part is known in the image. I want to paste it in a another image in exact location. Can anybody please help me? The source image and the destination image are of same size. here is an example of source image, I know p1,p2,p3,p4 and I want to copy that part to a new image. I already have a destination image. For example the below image is destination image, and I want to paste only the marked part of the source image to the destination image. How can I do it? And the final output should look

OpenCV C++, getting Region Of Interest (ROI) using cv::Mat

蹲街弑〆低调 提交于 2019-11-27 13:55:59
问题 I'm very new to OpenCV (started using it two days ago), I'm trying to cut a hand image from a depth image got from Kinect, I need the hand image for gesture recognition. I have the image as a cv::Mat type. My questions are: Is there a way to convert cv::Mat to cvMat so that I can use cvGetSubRect method to get the Region of interest? Are there any methods in cv::Mat that I can use for getting the part of the image? I wanted to use IplImage but I read somewhere that cv::Mat is the preferred

How can one easily detect whether 2 ROIs intersects in OpenCv?

耗尽温柔 提交于 2019-11-27 01:37:24
问题 I am trying to detect whether 2 Regions of Interest ( CvRect s) are intersecting one another in OpenCV. I can obviously manually type several (or rather a lot of) conditions to be checked but that wouldn't really be a good way to do it (imo). Can anyone suggest me any other solution? Is there a ready method in OpenCV for that ? 回答1: I do not know of any ready-made solution for the C interface ( CvRect ), but if you use the C++ way ( cv::Rect ), you can easily say interesect = r1 & r2; The

copying non-rectangular roi opencv

蹲街弑〆低调 提交于 2019-11-26 22:58:48
问题 I want to copy a part of an image which is not rectangle with C++ opencv. The corner points of the part is known in the image. I want to paste it in a another image in exact location. Can anybody please help me? The source image and the destination image are of same size. here is an example of source image, I know p1,p2,p3,p4 and I want to copy that part to a new image. I already have a destination image. For example the below image is destination image, and I want to paste only the marked

Copy an cv::Mat inside a ROI of another one

∥☆過路亽.° 提交于 2019-11-26 22:01:48
I need to copy a cv::Mat image (source) to an ROI of another (Destination) cv::Mat image. I found this reference , but it seems that it does not work for my case. Do you have any pointers how could I do this using the OpenCV C++ interface? OpenCV 2.4: src.copyTo(dst(Rect(left, top, src.cols, src.rows))); OpenCV 2.x: Mat dst_roi = dst(Rect(left, top, src.cols, src.rows)); src.copyTo(dst_roi); Mich In addition or correction to above answers, if you want to copy a smaller region of open Mat to another Mat , you should do: src(Rect(left,top,width, height)).copyTo(dst); Did work for me this way: