From: Jonathon H. <js...@ec...> - 2016-10-26 08:39:58
|
Lowering res is quite common for things like this - there is little point in working at high res if you don’t need the information or it is largely redundant. Implementations like the HaarCascadeDetector can also be sped up a lot by playing with the parameters (e.g. by setting the minimum and maximum detection sizes to match your expectations). Jon > On 26 Oct 2016, at 09:33, Ben Markham <ben...@gm...> wrote: > > Oh wow. I just implemented it into my code and the performance when straight up. Thank you so much for this. I will try to build from this and do some more digging in the docs. > > Just curious tho, what other ways are there to process this? Would you say lowering the resolution is the most common method? > > -Ben >> On Oct 26, 2016, at 5:26 PM, Jonathon Hare <js...@ec... <mailto:js...@ec...>> wrote: >> >> Ok, lowering the resolution will help, but that code isn’t really doing tracking; it’s just running the detector over the whole frame every time, which can be rather computationally expensive. >> >> Take a look at the more advanced face tracker implementations, KLTHaarFaceTracker and CLMFaceTracker, if you want something that takes advantage of prior knowledge about where a face was detected in the past to speed up detection now. There are demos showing how these work in the demos module: https://github.com/openimaj/openimaj/tree/master/demos/demos/src/main/java/org/openimaj/demos/faces <https://github.com/openimaj/openimaj/tree/master/demos/demos/src/main/java/org/openimaj/demos/faces> >> >> Jon >> >> >> >>> On 26 Oct 2016, at 09:12, Ben Markham <ben...@gm... <mailto:ben...@gm...>> wrote: >>> >>> Hi John, >>> >>> Thanks for the reply. >>> >>> Right now I’m just following the tutorial for face tracking. Here’s a small code snippet: >>> >>> Video<MBFImage> video = new XuggleVideo(new File("/Users/ben//Downloads/Whisper.mp4")); >>> VideoDisplay<MBFImage> display = VideoDisplay.createVideoDisplay(video); >>> >>> display.addVideoListener(new VideoDisplayListener<MBFImage>() { >>> public void beforeUpdate(MBFImage frame) { >>> >>> FaceDetector<DetectedFace, FImage> fd = new HaarCascadeDetector(50); >>> List<DetectedFace> faces = fd.detectFaces(Transforms.calculateIntensity(frame)); >>> >>> for (DetectedFace face : faces) { >>> frame.drawShape(face.getBounds(), 4, RGBColour.GREEN); >>> } >>> >>> } >>> >>> It’s tracking faces well, just FPS issues. >>> >>> -Ben >>>> On Oct 26, 2016, at 5:07 PM, Jonathon Hare <js...@ec... <mailto:js...@ec...>> wrote: >>>> >>>> Hi Ben, >>>> >>>> Parallel processing generally won’t help with video unless the operation that you are performing on each frame is independent of the previous frame(s) - generally speaking tracking doesn’t fall into this category as it relies on using the position of the object in the previous frame as a starting point for updating detection in the current frame. >>>> >>>> What method are you using for tracking? For most methods an easy way of speeding up processing is to lower the resolution of the frame the tracking is being applied to & then scale the result back to the original frame size. >>>> >>>> Jon >>>> >>>> >>>>> On 26 Oct 2016, at 08:58, Ben Markham <ben...@gm... <mailto:ben...@gm...>> wrote: >>>>> >>>>> Hello, >>>>> >>>>> I’m fairly new to the concept of processing video using OpenImaj and just processing video using Java in general. In the tutorial, it shows an example of a dataset of MBFImages to do parallel processing. Would I just treat the Video as a Dataset? If so, do I put the parallel processing in the beforeUpdate method? >>>>> >>>>> I’m wondering because I’m trying to do face tracking on an mp4 file and I’m losing about 12 FPS. Is parallel processing not the way to go about increasing FPS? Should I be using another method? >>>>> >>>>> Thank you, >>>>> Ben. >>>>> ------------------------------------------------------------------------------ >>>>> The Command Line: Reinvented for Modern Developers >>>>> Did the resurgence of CLI tooling catch you by surprise? >>>>> Reconnect with the command line and become more productive. >>>>> Learn the new .NET and ASP.NET <http://asp.net/> CLI. Get your free copy! >>>>> http://sdm.link/telerik <http://sdm.link/telerik> >>>>> _______________________________________________ >>>>> openimaj-discuss mailing list >>>>> ope...@li... <mailto:ope...@li...> >>>>> https://lists.sourceforge.net/lists/listinfo/openimaj-discuss <https://lists.sourceforge.net/lists/listinfo/openimaj-discuss> >>>> >>> >> > |