crop

How to crop an image with VBA to a specific form e.g. circle in PowerPoint?

試著忘記壹切 提交于 2020-06-01 06:32:05
问题 I would like to crop a square image shape in PowerPoint with VBA to a specific form e.g. a circle. With Shape.PictureFormat there are only these options: .CropBottom .CropLeft .CropRight .CropTop Can someone help me with this question? Thanks! Moe 回答1: From Microsoft Community - you can use Shape.AutoShapeType to "crop to shape." Sub CropToCircle() Dim shp As Shape Set shp = ActivePresentation.Slides(1).Shapes(1) If shp.Type = msoLinkedPicture Or shp.Type = msoPicture Then shp.AutoShapeType =

how to crop area of an image inside a rectangle or a squre?

梦想与她 提交于 2020-05-17 07:07:34
问题 First of all I take the picture and then I draw a rectangle over it. Now I just want to crop the image inside the rectangle. I tried drawing contours but that didn't work out in my case. I am stuck on it. import cv2 import numpy as np img = cv2.imread("C:/Users/hp/Desktop/segmentation/abc.jpg", 0); h, w = img.shape[:2] kernel = np.ones((15,15),np.uint8) e = cv2.erode(img,kernel,iterations = 2) d = cv2.dilate(e,kernel,iterations = 1) ret, th = cv2.threshold(d, 150, 255, cv2.THRESH_BINARY_INV)

Rotate image and crop only inside the image: UWP

六月ゝ 毕业季﹏ 提交于 2020-04-16 03:00:30
问题 I have a question. I need to crop a rotated image but the crop rectangle must feet in the image. I'm using Microsoft toolkit for cropping the image but it does not support cropping rotated image, so I added rotation to image and now my problem is to fit the cropping rectangle into the rotated image and not let it get outside of the image. In the images below I'm showing cases. If there is something you need to know to answer this question write it I will add. Not rotated image Rotated image..

How to crop wide images in swift without stretching

时光怂恿深爱的人放手 提交于 2020-03-21 04:27:50
问题 I am having trouble cropping pictures taken to be of an exact size that is in the wide format. For instance I take a picture with an iPad front camera, which has the resolution of 960w,1280h and I need to crop to be exactly 875w,570h. I tried some of the methods in here, but they all stretch the image or don't get the size I want. Here is the first method that I tried: func cropToBounds(image: UIImage, width: Double, height: Double) -> UIImage { let cgimage = image.cgImage! let contextImage:

How to crop wide images in swift without stretching

人盡茶涼 提交于 2020-03-21 04:27:26
问题 I am having trouble cropping pictures taken to be of an exact size that is in the wide format. For instance I take a picture with an iPad front camera, which has the resolution of 960w,1280h and I need to crop to be exactly 875w,570h. I tried some of the methods in here, but they all stretch the image or don't get the size I want. Here is the first method that I tried: func cropToBounds(image: UIImage, width: Double, height: Double) -> UIImage { let cgimage = image.cgImage! let contextImage:

getbbox method from python image library (PIL) not working

不想你离开。 提交于 2020-03-17 07:23:07
问题 I want to crop an image to its smaller size, by cutting the white areas on the borders. I tried the solution suggested in this forum Crop a PNG image to its minimum size but the getbbox() method of pil is returning a bounding box of the same size of the image, i.e., it seems that it doesn't recognize the blank areas around. I tried the following: >>>import Image >>>im=Image.open("myfile.png") >>>print im.format, im.size, im.mode >>>print im.getbbox() PNG (2400,1800) RGBA (0,0,2400,1800) I

getbbox method from python image library (PIL) not working

半世苍凉 提交于 2020-03-17 07:23:06
问题 I want to crop an image to its smaller size, by cutting the white areas on the borders. I tried the solution suggested in this forum Crop a PNG image to its minimum size but the getbbox() method of pil is returning a bounding box of the same size of the image, i.e., it seems that it doesn't recognize the blank areas around. I tried the following: >>>import Image >>>im=Image.open("myfile.png") >>>print im.format, im.size, im.mode >>>print im.getbbox() PNG (2400,1800) RGBA (0,0,2400,1800) I

How to crop an image based on a complex criteria?

可紊 提交于 2020-03-06 09:24:29
问题 I have a set of similar images like the one below. I want to keep the portion of the image that is within the top red 'irregular' rectangle (green arrows represent the space that I want to keep; anything outside I want to crop out. Is there a python opencv code that would do it for me? I've been trying to figure it out using opencv by playing around with thresholds but it's just not doing it for me. Original image: The area that I want to keep (the space I want to keep is highlighted by green

OpenCV crop live feed from camera

[亡魂溺海] 提交于 2020-02-24 12:10:12
问题 How can I get properly one resolution feed from camera in OpenCV (640x320) but cut it into half and display only one half of the frame (320x240). So not to scale down, but to actually crop . I am using OpenCV 2.4.5, VS2010 and C++ This quite standard code gets 640x480 input resolution and I made some changes to crop resolution to 320x240. Should I use Mat instead of IplImage, and if so what would be the best way? #include "stdafx.h" #include <iostream> #include "opencv2/core/core.hpp"

OpenCV crop live feed from camera

和自甴很熟 提交于 2020-02-24 12:10:05
问题 How can I get properly one resolution feed from camera in OpenCV (640x320) but cut it into half and display only one half of the frame (320x240). So not to scale down, but to actually crop . I am using OpenCV 2.4.5, VS2010 and C++ This quite standard code gets 640x480 input resolution and I made some changes to crop resolution to 320x240. Should I use Mat instead of IplImage, and if so what would be the best way? #include "stdafx.h" #include <iostream> #include "opencv2/core/core.hpp"