crop

How can I using code in C# for color extraction?

妖精的绣舞 提交于 2019-12-11 08:27:07
问题 I need help to extract specified color (red for example) from an image then cropping objects which contain this color. This part is so important in my graduate project which tracking laser gesture in projector screen. 回答1: I'm really not sure I understood you correctly, but here is a code that makes only red parts of an image visible. You can change it to only red parts invisible by changing > to < when comparing to 200. You can also play with the number 200 to see what threshold is good for

Letters blurry / fuzzy after crop function

时光怂恿深爱的人放手 提交于 2019-12-11 08:09:54
问题 after attempting to crop my image in several locations by saving the list of coordinates to an array the letters in the cropped area become extremely blurry and I cannot figure out why. The original image looks like After cropping the image looks like The code in questions is as follows: import numpy as np import cv2 im2 = cv2.imread('1.jpg') im = im2.copy() gray = cv2.cvtColor(im,cv2.COLOR_BGR2GRAY) blur = cv2.GaussianBlur(gray,(5,5),0) thresh = cv2.adaptiveThreshold(blur,255,1,1,11,2)

FFMPEG: How to move the video without stretching it?

天大地大妈咪最大 提交于 2019-12-11 07:55:06
问题 Please, I need help with the following ... I want to move a video (portrait type), but without stretching it ... To create a 16: 9 video, with FFMPEG ... I have the following example ... ffmpeg -i video.mpg -filter:v "crop=in_w-100:in_h-100:0:(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t)" -y out.mp4 回答1: Wow, I do not know what I was thinking ... The answer was simple, indicate the HxW of the output video ... ffmpeg -i video.mpg -filter:v "crop= 1280:720 :0:(in_h-out_h)/2 +((in_h-out_h)/2)*sin(t)"

iPad: Crop the video and play cropped portion only

拜拜、爱过 提交于 2019-12-11 07:36:57
问题 Is it possible to crop the video by dimension and play only cropped portion programmatically? For an example, I have 100x100 full video but I want to play only (0,0) to (25,25) portion of this video. How could I do it? Basically I am trying to implement something similar to matrix of iPads video available here. 回答1: Number of options here - since you generally play video back in a view, you can attempt to use the standard UIView content scaling modes along with the specific movie scaling mode

Crop image to be circular swift 3

断了今生、忘了曾经 提交于 2019-12-11 07:34:48
问题 So I have this issue I have been trying to solve for the past few days however, cannot find a solution to the problem. My issue is very simple I am trying to crop a image so that it becomes a circle. From research done, I have found a few methods that can be used to achieve this and the main one which seemed to pop up a lot is to simply crop the UIImageView so that it becomes a circular frame. The code which I used to do this can be seen below. imageView.layer.masksToBounds = false imageView

android set the image I crop as wallpaper

佐手、 提交于 2019-12-11 07:29:51
问题 I just crop the image to get part of it. But Android set the returned image as the wallpaper. Why? I track the android code, and in Gallery3D application(com.cooliris), I found this: // TODO: A temporary file is NOT necessary // The CropImage intent should be able to set the wallpaper directly // without writing to a file, which we then need to read here to write // it again as the final wallpaper, this is silly mTempFile = getFileStreamPath("temp-wallpaper"); mTempFile.getParentFile().mkdirs

Crop image with settable center and scale in Python PIL

依然范特西╮ 提交于 2019-12-11 06:58:17
问题 I would like to crop an image using PIL, although it could be some other module. I need the method to crop with a scale factor, ie 1.5 meaning that the output would be 1.5x zoomed in. Additionally, I would need to set the center where it zooms. This means setting x/2,y/2 as the center would zoom straight to the center, but other x,y values would zoom into those pixels. If anyone knows how to do this I would really appreciate any help. Right now I have some cropping working with ims = im.crop(

Node gm - use crop and resize cause error

筅森魡賤 提交于 2019-12-11 05:26:08
问题 The following code throw an error. Error: Command failed: gm convert: geometry does not contain image (unable to crop image). var gm = require('gm'); gm('/origin.jpg') .resize(600) .write('/beforeCrop', function (err) { // beforeCrop is 600 * 450 gm('/beforeCrop') .crop(70, 70, 100, 100) .resize(50, 50) .write('/result', function (err) { if (err) throw err; }); }); Is seem that gm can not resolve the size of beforeCrop . 回答1: Why not piping to a stream and reading from it on the fly? var gm =

Android-Image-Cropper to circle

被刻印的时光 ゝ 提交于 2019-12-11 04:24:29
问题 I am trying to crop my images as a circle, for this I am using the provided library of Android-Image-Cropper - 'com.theartofdev.edmodo:android-image-cropper:2.4.+' At the moment I am able to choose an image, the crop window appears as a circle, although it doesnt then crop to a circle but instead a square. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == GALLERY_REQUEST &&