image-capture

Can I set the color depth while capturing the webcam image using OpenCV?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 03:55:23
I am capturing the image using OpenCV in C++ firstFrame = cvQueryFrame(capture); it is easy to set the width and height properties by cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_WIDTH, WIDTH ); cvSetCaptureProperty( capture, CV_CAP_PROP_FRAME_HEIGHT, HEIGHT ); I wonder if there is a way to specify the color depth as well without further processing the frame? According to the documentation , you should be able to do it using CV_CAP_PROP_FORMAT if you use the function retrive() to get your frame. CV_CAP_PROP_FORMAT Format of the Mat objects returned by retrieve() . However, notice also that

How to capture a photo from the camera without intent

半世苍凉 提交于 2019-11-30 20:37:46
I want my app to be able to capture photos without using another application. The code i used : Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); File photo = null; try { photo = this.createTemporaryFile("picture", ".jpg"); photo.delete(); } catch(Exception e) { Toast.makeText(getApplicationContext(),"Error",Toast.LENGTH_LONG).show(); } mImageUri = Uri.fromFile(photo); intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageUri); startActivityForResult(intent, CAPTURE_IMAGE_ACTIVITY_REQUEST_CODE); But this code uses the phone's main camera app. Can anyone give me some code ? Taking a picture

captureStillImageAsynchronouslyFromConnection without JPG intermediary

送分小仙女□ 提交于 2019-11-30 20:33:25
I'm trying to get as good an image as possible from the camera, but can only find examples that captureStillImageAsynchronouslyFromConnection and then go straight to: NSData *imageData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageSampleBuffer]; UIImage *image = [[UIImage alloc] initWithData:imageData]; JPEG being lossy and all, is there any way to get the data as PNG, or even just RGBA (BGRA, what-have-you?). AVCaptureStillImageOutput doesn't seem to have any other NSData* methods.... Actually looking at the CMSampleBufferRef, it seems like it's already locked as JPEG ~

fastest method to capture game screen shots in c#?(more than20 images per second)

隐身守侯 提交于 2019-11-30 15:37:49
How can i make screenshoots to the entire game screen very fast? Somthing like 20-30 per second?(i want to convert them to video) [[1]] I've tried WMEncoder.Results were that WMEncoder can capture the screen and regions of screen only in a video format (wma) using a set of preconfigured codecs. (29 fps best encode result).WMEncoder can not make screenshots. [[2]] I've tried DirectX : Surface s = device.CreateOffscreenPlainSurface( Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.SystemMemory); device.GetFrontBufferData(0, s); SurfaceLoader.Save("c:\

How can I programmatically create a screen shot of a given Web site?

柔情痞子 提交于 2019-11-30 02:13:51
I want to be able to create a screen shot of a given Web site, but the Web site may be larger than can be viewed on the screen. Is there a way I can do this? Goal is to do this with .NET in C# in a WinForms application. There are a few tools. The thing is, you need to render it in some given program, and take a snapshot of it. I don't know about .NET but here are some tools to look at. KHTML2PNG imagegrabwindow() (Windows PHP Only) Create screenshots of a web page using Python and QtWebKit Website Thumbnails Service Taking automated webpage screenshots with embedded Mozilla I just found out

C#: capture screen from Windows service

若如初见. 提交于 2019-11-29 15:25:42
问题 i have to capture screenshot of Desktop after every one second. in Winform application it is running fine. but after moving the code to Windows Service it is not capturing the screenshot. Any idea why it is not doing so? here is the code public partial class ScreenCaptureService : ServiceBase { System.Timers.Timer timer = new System.Timers.Timer(); public ScreenCaptureService() { InitializeComponent(); this.timer.Interval = 1000; this.timer.Elapsed += new System.Timers.ElapsedEventHandler

java.lang.OutOfMemoryError in android while getting image from gallery in android

℡╲_俬逩灬. 提交于 2019-11-29 09:14:52
问题 I am picking a picture from gallery using code public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gallery); Intent i = new Intent(Intent.ACTION_PICK, android.provider.MediaStore.Images.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, SELECT_PICTURE); } public void onActivityResult(int requestCode, int resultCode, Intent data) { if (requestCode == SELECT_PICTURE && resultCode == RESULT_OK && null != data) { Uri selectedImage =

How to get Image Object using Cordova?

旧街凉风 提交于 2019-11-29 08:15:46
When use use getPicture either we get a relative URL or base64image. But I want to send a image object to Amazon S3. Anyway to do that ? Here is how I am getting the base64image // A button will call this function // function capturePhoto() { // Take picture using device camera and retrieve image as base64-encoded string navigator.camera.getPicture(onPhotoDataSuccess, onFail, { destinationType: Camera.DestinationType.DATA_URL, quality: 50 }); } [UPDATE] Now I need to get the image as object convert it to byte array and upload it to Amazon S3 using REST (PUT) call. sure you can camera/image

How to take a screenshot from an video playing through MPMediaPlayerController in iPhone?

落花浮王杯 提交于 2019-11-29 02:37:58
Can anybody help me in this? I want to get an screenshot from an video playing through MPMediaPlayerController. What i have tried so far is:- -(void)viewDidLoad { NSURL *tempFilePathURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"LMFao" ofType:@"mp4"]]; player = [[MPMoviePlayerController alloc] initWithContentURL:tempFilePathURL]; [player setControlStyle:MPMovieControlStyleFullscreen]; //Place it in subview, else it won’t work player.view.frame = CGRectMake(0, 0, 320, 400); [self.view addSubview:player.view]; } -(IBAction)screenshot { CGRect rect = [player.view bounds];

Capturing a single image from my webcam in Java or Python

匆匆过客 提交于 2019-11-28 16:51:05
I want to capture a single image from my webcam and save it to disk. I want to do this in Java or Python (preferably Java). I want something that will work on both 64-bit Win7 and 32-bit Linux. EDIT: I use Python 3.x, not 2.x Because everywhere else I see this question asked people manage to get confused, I'm going to state a few things explicitly: I do not want to use Processing I do not want to use any language other than those stated above I do want to display this image on my screen in any way, shape or form I do not want to display a live video feed from my webcam on my screen, or save