crop

iOS Determine the corners of a Business Card in realtime

萝らか妹 提交于 2019-11-29 14:21:18
问题 I want to implement a business card detecting functionality like this app (https://scanbot.io). The camera should detect a business card and automatically take a picture of it (only the business card). My idea was using BradLarson's GPUImage library, detect the corners (using the Harris corner detection algorithm), calculate the biggest rectangle with the corners obtained and crop the image contained inside the rectangle. Here is my code: - (void)setupFilter { videoCamera = [

Make Jcrop tracker not rotate when cropping a rotated image

有些话、适合烂在心里 提交于 2019-11-29 14:05:22
I'm trying to crop an image using Jcrop, but when I use jqueryrotate on the image, something weird happens. I rotate the image 90 degress then I activate the JCrop, the JCrop does not follow the image rotated, so I also rotate the Jcrop-holder. The resulting image is ok, but when I select a section to crop, I have noticed that my tracker is also rotated. When I drag it up, it goes right, when I drag it left, it goes down. What happens Then it goes How do I make the crop selection tool stay upright? My html: <div class="img-canvas" style="background-color:#cccccc;" > <img id="image_canv" src="<

Crop UIImage to center square

若如初见. 提交于 2019-11-29 12:47:48
I get images that are in 1920x1080 resolution. I am attempting to crop them to the center square area (ie 1080x1080 square in the center). The resolution may change in the future. Would it be possible to crop the image this way? I have tried a couple things posted on SO, but I always get an image that is 660x1080 if I try to crop then center. Here is an image depicting what I want to achieve. Basically the red is original, green is what I want, and yellow is just showing mixX and midY lines. The code I tried. func imageByCroppingImage(image: UIImage, toSize size: CGSize) -> UIImage{ let

PIL crop and paste problem: Cropping doesn't create a cropped image

喜你入骨 提交于 2019-11-29 12:14:30
I'm trying to crop an image and then paste the cropped image into the centre of another image. Ideally I'd like the cropped image to be smaller than the image its being pasted on so that there is a border around the pasted image but I don't know if that's possible. Here's what I've tried (along with the resulting error message): >>> import Image >>> grey = Image.new('RGB', (200, 200), "grey") >>> House = Image.open("House01.jpg") >>> print grey.size, grey.mode, grey.format >>>(200, 200) RGB None >>> print House.size, House.mode, House.format >>>(300, 300) RGB JPEG >>> box = (25, 25, 25, 25) >>

How to put a cropped image on a Tkinter Canvas in Python

北城余情 提交于 2019-11-29 11:59:32
I found a lot of similar questions, but not quite the solution to this case : I want to Load an image file from disk Crop it (lazy or not) Place it on a TKinter canvas And oh, it would even be better that step 1 would not need to be a gif-file, but even if it has to be I'll be happy. That's it.. I can load a file, I can crop it (In PIL) I can place it on a canvas (In TKinter), but I don't seem able to combine it all.. (So maybe a simple cast from PIL to TKinter is enough?) I'm a newbee in TKinter of course. reclosedev There is ImageTk module in PIL . from Tkinter import * from PIL import Image

Crop an image using rectangular box of selected area?

倖福魔咒の 提交于 2019-11-29 10:24:56
问题 I am looking for a good tutorial or sample code, that would show how to crop an image taking from iphone camera something in lines of but you would control the corners with your fingers any tip would be greatly appericated, as i tried in many way but didn't get a result. 回答1: some changes in the button action -(IBAction) cropImage:(id) sender{ // Create rectangle that represents a cropped image // from the middle of the existing image float xCo,yCo; float width=bottomCornerPoint.x

Android Camera - How can i take a specific “rectangle” from the byte array?

跟風遠走 提交于 2019-11-29 08:42:56
问题 I have created an application that shoots and saves photos. I have a preview and an overlay on top of that preview. The overlay defines a square (the area around the square shows the preview a bit darker), as you can see in the image: example What i need to do is to extract the part of the image where the square is. The square is defined like this: Rect frame = new Rect(350,50,450,150); How can i do that? i have the byte array (byte[] data) that i can save, but i want to change the

Explanation of Android Code Camera Intent + Cropping Images

江枫思渺然 提交于 2019-11-29 08:42:32
When wanting to take a photo, crop and save the image in an Android application, I use the following intent in my Java... Intent camera=new Intent(); camera.setAction(MediaStore.ACTION_IMAGE_CAPTURE); camera.putExtra("crop", "true"); camera.putExtra("outputX",600); camera.putExtra("outputY", 600); camera.putExtra("aspectX", 1); camera.putExtra("aspectY", 1); camera.putExtra("scale", true); camera.putExtra("return-data", false); The above intent works great, however my Y and X are always equal. I am looking to break down the code to find out what specifies this so that I can make customisable -

How to change WooCommerce thumbnail crop position?

跟風遠走 提交于 2019-11-29 08:25:14
I'm trying to change WooCommerce thumbnail crop position. I found this code can help to change the size: add_action( 'init', 'yourtheme_woocommerce_image_dimensions', 1 ); /** * Define image sizes */ function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' => '100', // px 'height' => '100', // px 'crop' => 0 ); // Image sizes update_option( 'shop_catalog_image_size', $catalog ); // Product category thumbs } I did some try like change crop 0 to array("center", "bottom") but it's not working: function yourtheme_woocommerce_image_dimensions() { $catalog = array( 'width' =>

How to crop a cross rectangle from an image using c#?

跟風遠走 提交于 2019-11-29 07:35:15
I want to get some specific parts of an image so I'm cropping the images. However, when I want to get a part that is not parallel to the image, I rotate the image and crop afterwards. I don't want to rotate the image and crop a parallel rectangle. What I want is, without rotating the image, to crop a rectangle with an angle from the image. Is there any way to do that? I think I couldnt express myself well enough. This is what I want to do: example picture . Assume the red thing is a rectangle :) I want to crop that thing out of image. After cropping it doesn't need to be angeled. So mj can lie