2017-01-03 12:47:58 -0600 | received badge | ● Scholar (source) |
2017-01-03 11:55:53 -0600 | received badge | ● Enthusiast |
2016-12-31 10:31:52 -0600 | received badge | ● Supporter (source) |
2016-12-31 10:31:48 -0600 | commented answer | Opencv4android mask for matchTemplate() Thanks for the edit, that is perfect! When I call minMaxLoc, the coordinates of the object will be in terms of the new, shrinked image. How can I make it such that these coordinates map to the full sized image? I am drawing a rectangle over the frame to show the location of the object being matched. |
2016-12-31 08:08:42 -0600 | commented answer | Opencv4android mask for matchTemplate() Hi. Thank you for the reply. I'm wondering if you can explain the numbers you used to calculate the rectangles parameters? Thanks. |
2016-12-30 13:18:38 -0600 | asked a question | Opencv4android mask for matchTemplate() Hi. I'm trying to speed up matchTemplate() for Android. I have already downsampled the image and template to half the original size, but the matching is still somewhat (understandably) slow on some older devices. I acknowledged that I can pass in a mask to the matchTemplate() method. I'm trying to utilize this in the following way: 1) I know the location of the object from the previous frame, lets say its (180, 30). 2) I want to search only around some specified distance around this point, rather than the whole frame. 3) I create a region of interest based on this distance. My question is, how can I utilize this roi such that I can take the current image being searched, and set everything outside the ROI to 0? I can then pass this in as a mask, and thus matchTemplate() would only search the image where pixel values are not 0 (so everything in the ROI)? I have something such as the following: But I now need to utilize the ROI to create the actual mask. Would this speed up template matching, and if so, I'm hoping if anyone can provide pointers. Thanks. |
2016-11-19 12:55:13 -0600 | commented question | OpenCV4android template matching Ah I see, I'm calling it for every frame! I'll look into this, I'll see firstly if downscaling helps. Thanks a lot for your help! |
2016-11-19 12:48:59 -0600 | commented question | OpenCV4android template matching Hmm, I've been advised on SO to stick to matchTemplate as it is already well optimised. |
2016-11-19 12:35:30 -0600 | commented question | OpenCV4android template matching Sounds good, if I also scale the template matching, I'd be doing only 1/4 of the evaluations as opposed to non-scaling, which is a massive difference in and of itself. Regarding downscaling, would using the |
2016-11-19 12:16:10 -0600 | commented question | OpenCV4android template matching If I go with downscaling, what image and template size is recommended? As stated currently, the image size is 1280x720, and template is normally no more than half of that resolution. Thanks for the help. |
2016-11-19 11:07:19 -0600 | commented question | OpenCV4android template matching Wouldn't this affect the end result if I decrease the source image size? Furthermore, I would have to resize it for each image that comes in, which could be 20+ resizes a second. Would that not be costly also? The size of the source images are 1280x720 currently. I am using the template size as an indicator to what size the rectangle bounding box would be, and if I decrease the template size further, I'm not sure how I could indicate what size the bounding box (to indicate detected object) should be drawn at. |
2016-11-19 10:16:38 -0600 | asked a question | OpenCV4android template matching Hi. I'm using OpenCV4Android to try out template matching on an android phone. Essentially what I'm doing is taking a picture of some object that I wish to detect, cropping it and saving it as a template. I then use my android camera and a surface view to constantly get images from the camera. I am then applying template matching on each image, converting the image to a Mat first. However, when applying template matching I only get around 3-4 fps. What I am essentially doing is this: ** mCameraMat = inputFrame.rgba(); ** Where mTemplateMat is the template bitmap image converted into a Mat object. The bottleneck is on the line If I remove that line, I get around 25 fps, which is much more acceptable. I'd be fine with anything above 13-14. I understand that template matching is a very expensive process and doing it every frame can be costly. I have tried to do it every 20 frames, but it still slows down the processing considerably, and the end video looks worse as there is a constant transition from a smooth fps display to a low fps display. What are my options in optimising matchTemplate? Any tips are much appreciated. |
2016-10-13 18:46:31 -0600 | asked a question | Recording from JavaCameraView I've been attempting to record the JavaCameraView for a few days now, to no avail. I'm trying to use MediaRecorder to record. I have a JavaCameraView in my layout file, have added a CvCameraViewListener as follows: where mCameraView = (CameraBridgeViewBase) findViewById(R.id.cameraPreview); and I am therefore getting a preview on the screen correctly, and The problem I am having with using The My last resort was to record the surface instead, and this is being done as follows: However when I stop the MediaRecorder, it crashes with the following stack trace: And I have no idea what gives. So now I'm asking for help here and would greatly appreciate anybody give some hints as to what I might be doing wrong in my code above, or how I can use the Camera to record (even though it's being used by JavaCameraView). Thanks a lot in advance. |
2016-10-12 11:56:09 -0600 | asked a question | OpenCV4Android LockCanvas error Hi. I've come across an error in the Opencv4android SDK which I can't quite explain. This bug only shows on my Google Tango tablet, but is non existent when I run my app on my Galaxy S6. The error originates from JavaCameraView and I've done some research but can't find anything about it. It's not part of my own code, so I'm at a bit of a loss here. Any advice on what this could be? I can't even explain the error well because I'm not sure exactly what's causing it. Any help is much appreciated. |