crop

Crop image by polygon area

偶尔善良 提交于 2019-11-28 19:55:36
I want to crop image by polygon area, but couldn`t find any library, which can make it. OpenCV is too big for this small thing. JJIL [ enter link description here ] crop just rectangle area. Maybe you have any ideas how i can achieve it? Thanks for help! FOR Nidhi: Try something like this, if doesnot work - create another canvas for path, and than get Bitmap from it (for mask), and apply this mask bitmap to your initial canvas instead drawPath. Bitmap obmp = BitmapFactory.decodeResource(getResources(), R.drawable.image1); Bitmap resultImg = Bitmap.createBitmap(obmp.getWidth(), obmp.getHeight()

Upload and crop image before sending it to the server [closed]

喜你入骨 提交于 2019-11-28 19:33:23
Is there some client components (jquery/swf) that will give the possibility to upload and crop (user should be able to select the area to crop) an image in the browser and then send the cropped image to the server? I'm on asp.net-mvc (not sure if it matters) jcrop Jcrop is the quick and easy way to add image cropping functionality to your web application. It combines the ease-of-use of a typical jQuery plugin with a powerful cross-platform DHTML cropping engine that is faithful to familiar desktop graphics applications. The Jcrop Image Plugin might be good at displaying the cropping UI and

Clipping raster using shapefile in R, but keeping the geometry of the shapefile

时光总嘲笑我的痴心妄想 提交于 2019-11-28 18:50:38
I am using {raster} to clip (or crop) a raster based on an irregular shapefile (the Amazon biome) but the output always has a rectangular extent. However, I need the output in the exact same geometry of the shapefile. Any tips? Cheers. library(raster) library(rgdal) myshp <- readOGR("Amazon.shp", layer="Amazon") e <- extent(myshp) myraster <- raster("Temperature.tif") myraster.crop <- crop(myraster, e, snap="out", filename="myoutput.tif") One option is to use raster::mask() library(maptools) ## For wrld_simpl library(raster) ## Example SpatialPolygonsDataFrame data(wrld_simpl) SPDF <- subset

How to auto center crop ImageView Android?

孤者浪人 提交于 2019-11-28 17:24:14
I made a listView images. My goal that each item of my listView have the same height of 100dp. I encounter a problem that my imageView is resized automatically, but does not take the entire space of the parent. Here is my current result and objectif result : Does anyone know the option to add to make crop center automatically? I am not sure if I understood correctly. It must be either of the two, that you want, I guess. In your image view set the attribute android:scaleType="fitXY" to fit the ImageView completely. You can choose android:scaleType="centerCrop" to crop Center. Mehroz Munir i

How to crop a mp3 from x to x+n using ffmpeg?

时光毁灭记忆、已成空白 提交于 2019-11-28 17:00:47
Following this question I decided to use ffmpeg to crop MP3s. On another question I found this way of doing it: ffmpeg -t 30 -acodec copy -i inputfile.mp3 outputfile.mp3 The problem is that I don't want to crop the first 30 seconds, I want to crop from x to x+n, like from 30s to 100s. How would I go and do this? I'm reading the man for ffmpeg but this is not really straightforward, especially since I just discovered about ffmpeg and I'm not familiar with audio/video editing softwares, so any pointers would be appreciated. Michael Madsen Take a look at the -t and -ss arguments. They should do

Simple cropping with Paperclip

跟風遠走 提交于 2019-11-28 16:41:14
I would like to crop images on upload using Paperclip to get square thumbs from the center of the original picture. I find out a method in documentation that seems to do exactly what I want: transformation_to(dst, crop = false) The problem is that I can't figure out where to use this method. It would be great to simply pass something as a parameter here: has_attached_file :picture, :styles => { :medium => "600x600>", :thumb => "something here" } You only need to use # instead of > as a parameter: has_attached_file :picture, :styles => { :thumb => "200x200#" } 来源: https://stackoverflow.com

JQuery JCrop - How to set a fixed size selection area?

南楼画角 提交于 2019-11-28 16:33:05
I'm trying to figure out how to fix the selection box size under JCrop. The documentation mentions how to set an initial selection area but not how to make it fixed size. Does anybody knows how could I make it fixed. Thanks in advance. http://deepliquid.com/content/Jcrop_Manual.html You are basically looking for the API section. Having extensively used this plugin myself, I know exactly what you're looking for: var api; var cropWidth = 100; var cropHeight = 100; $(window).load(function() { // set default options var opt = {}; // if height and width must be exact, dont allow resizing opt

How to perform Auto crop for document Recognize image using camera?

落爺英雄遲暮 提交于 2019-11-28 16:21:06
问题 I want to make a an application like a cam scanner for cropping a document. But I need same functionality like my two images.. First Images shown image captured by camera.. Second image recognize a captured image part like this.. I research more and more but not getting any out put so, I ask here if,any one done this tell me.. Thanks 回答1: Here is a exactly same demos that you want to achieve https://github.com/Aniruddha-Tapas/Document-Scanner ( Has auto detection feature ) https://github.com

How do I crop an animated gif using ImageMagick?

雨燕双飞 提交于 2019-11-28 15:52:41
There's plenty of information about cropping images, but attempting to crop (or trim) animations produces strange results. Sometimes they flicker, or come with extra frames, or some frames crop correctly and others become offset. How do I prevent all this from happening? jimmetry convert input.gif -coalesce -repage 0x0 -crop WxH+X+Y +repage output.gif Animated gifs are often optimised to save space, but imagemagick doesn't seem to consider this when applying the crop command and treats each frame individually. -coalesce rebuilds the full frames. Other commands will take into consideration the

Android大图片裁剪终极解决方案(上:原理分析)

一个人想着一个人 提交于 2019-11-28 13:43:41
转 载 声明: Ryan的博客文章欢迎您的转载,但在转载的同时,请注明文章的来源出处,不胜感激! :-) http://my.oschina.net/ryanhoo/blog/86842 约几个月前,我正为公司的APP在Android手机上实现拍照截图而烦恼不已。 上网搜索,确实有不少的例子,大多都是抄来抄去,而且水平多半处于demo的样子,可以用来讲解知识点,但是一碰到实际项目,就漏洞百出。 当时我用大众化的解决方案,暂时性的做了一个拍照截图的功能,似乎看起来很不错。可是问题随之而来,我用的是小米手机,在别的手机上都运行正常,在小米这里却总是碰钉子。虽然我是个理性的米粉,但是也暗地里把小米的工程师问候了个遍。真是惭愧! 翻文档也找不出个答案来,我一直对 com.android.camera.action.CROP 持有大大的疑问,它是从哪里来,它能干什么,它接收处理什么类型的数据?Google对此却讳莫如深,在官方文档中只有Intent中有只言片语言及,却不甚详尽。 随着项目的驱动,我不能抱着不了解原理就不往前走的心态,唯一要做的,是解决问题。最后在德问上找到一条解决方案,说是哪怕是大米也没问题。当时乐呵呵将代码改了改,确实在所有的手机上跑起来了,一时如释重负,对这个的疑问也抛诸脑后了。 直到月前,BOSS要求将拍照上传到服务器的图片分辨率加倍。OK,加倍简单