capture

2019.11.26 图像变换的学习

ε祈祈猫儿з 提交于 2019-12-05 20:15:13
美好的一个晚上从视觉工程开始 先来一个 阈值化 的程序和源代码 include "opencv2/video/tracking.hpp" #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include <iostream> #include <ctype.h> #include<stdlib.h> #include<stdio.h> #include<math.h> #include<opencv2/opencv.hpp> #include<string.h> #include<vector> using namespace cv; using namespace std; #define windowname "程序窗口" Mat picture, img,emm, camera; int main() { VideoCapture capture(0); while (100) { capture >> camera; cvtColor(camera, picture, COLOR_RGB2GRAY);//转换为灰度图像 threshold(picture, img, 130, 255, 1); threshold(picture, emm, 130, 255, 0);

Type mismatch when using Map.entrySet()

偶尔善良 提交于 2019-12-05 19:59:37
I have the following situation: In the code below, the method foo compiles while the method bar won't. At the method call entrySet (indicated in the code) the compiler says: Type mismatch: cannot convert from Set<Map.Entry<capture#1-of ? extends K,capture#2-of ? extends V>> to Set<Map.Entry<? extends K,? extends V>> Interestingly, the quickfix of Eclipse proposes to Change type of 's' to Set<Entry<? extends K, ? extends V>> which only changes the code because the quickfix is ignoring its own proposal and changing the type of s to Set<?> instead. I am using JDK1.8.0_51 and Eclipse 4.4.0. Maybe

Can use casperjs login to facebook but capture to png only show nav bar

你说的曾经没有我的故事 提交于 2019-12-05 18:37:48
Can use casperjs login to facebook but capture to png only show nav bar this my code: facebook.js casper.start("http://www.facebook.com/login.php", function(response) { if (this.exists('[name="lsd"]')) { this.page.evaluate(function(a,b) { document.querySelector("input[name='email']").value = a document.querySelector("input[name='pass']").value = b; document.querySelector("#login_form").submit(); console.log("Login submitted!"); },user_email,user_pass); } else { this.echo('[name="lsd"] not found', 'ERROR'); phantom.exit(); } this.capture('img/'+user_email+'_login.png'); }); casper.run(); please

converting a c++ lambda to a c function

我的未来我决定 提交于 2019-12-05 18:16:55
I'm writing some wrapping code, where an external library calls a c++ function (using variadic templates and such). The crucial point is that the external library requires a c-function, which would normally be fine, as this is legal: LibraryFuncType fn = [](params) { ... } While I can easily do this by hand, I would like to automate the wrapping with something like: function_(context, "name", myfunc); To do this, I would need a function similar to: template <ReturnType, ParamTypes...> static void function_(Context &ctx, const std::string &name, std::function<ReturnType(ParamTypes...)> fn) {

Received memory warning when capturing screen and save to video ios

落爺英雄遲暮 提交于 2019-12-05 17:18:05
I am now writing a program to capture screen and convert to video. I can successfully save the video if it is less than 10 seconds. But, if more than that, I received memory warning and application crash. I wrote this code as follow. Where am I missing to release data ? I would like to know how to do. -(void)captureAndSaveImage { if(!stopCapturing){ if (assetWriterInput.readyForMoreMediaData) { keepTrackOfBackGroundMood++; NSLog(@"keepTrackOfBackGroundMood is %d",keepTrackOfBackGroundMood); CVReturn cvErr = kCVReturnSuccess; CGSize imageSize = screenCaptureAndDraw.bounds.size; CGFloat

Which Java library to use for record a video from a connected camera?

筅森魡賤 提交于 2019-12-05 15:56:02
You would have thought that tere is a simple solution to this but there isn't :( My application needs to capture a stream from a USB/firewire (or whatever is the connection) connected camera (result would be a file like output.flv ). I would prefer that I can detect all connected cameras and choose which one to use (one or more at the same time --> one or more output files). Application has to be cross platform. Found libraries: Xuggle - not very good camera support. Good for manipulating over images and video. JMF - an old API but if I can use it, I will. I don't see a MAC OS X link on

Switch To Front Camera and Back Camera Android SurfaceView

隐身守侯 提交于 2019-12-05 10:05:31
I want to use the switch camera function. Currently I have Developed a Camera Object That working fine for back-camera but not working for front-camera. And I am unable to find a solution for switching between front and back cameras. Here is My Code..! public class MyCamera extends Activity implements SurfaceHolder.Callback, Camera.ShutterCallback, Camera.PictureCallback { Camera mCamera; SurfaceView mPreview; String filePath; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.camera_preview); mPreview = (SurfaceView)

How to capture a Zend view output instead of actually outputting it

不羁的心 提交于 2019-12-05 09:45:02
Problem: sometimes in our zend controller we don't want the script to be output directly, but rather want the content of that script. One example: when we need the result html output of a view script be included in another structure like JSON or XML for processing in the client side. I found the result here at stack overflow, but not so quick since it was in a different context. I have been struggling with this for 2 days now. As it turned out it was very simple: // in our controllers' action method $this->_helper->layout()->setLayout('empty'); // disable layout $this->_helper->viewRenderer-

How can I tell which of the alternatives matched in a Perl regular expression pattern?

烂漫一生 提交于 2019-12-05 02:59:25
问题 I have a list of regular expressions (about 10 - 15) that I needed to match against some text. Matching them one by one in a loop is too slow. But instead of writing up my own state machine to match all the regexes at once, I am trying to | the individual regexes and let perl do the work. The problem is that how do I know which of the alternatives matched? This question addresses the case where there are no capturing groups inside each individual regex. (which portion is matched by regex?)

OpenAL playback captured audio data c++

馋奶兔 提交于 2019-12-05 02:27:13
问题 I am trying to create a voice chat program using OpenAL. The networking side of things seems to be ok but I'll take advice on that =] The problem I am having at the moment is trying to playback captured audio data from the mic. I followed the code found here to get mic input and echo it to the speakers. This works OK but I can't seem to playback the fully captured audio after the capturing has finished. When some sound has been captured I store it on a list like so... for (int i = 0; i < CAP