image-processing

Merging perspective corrected image with transparent background template image using PILLOW [PIL, Python]

不想你离开。 提交于 2020-05-17 03:02:12
问题 Problem: I have multiple book cover images. I made a template of "book"-like template with a 3D perspective. And all I have to do now its take each of book cover images, correct a perspective (its always constant, because the template is always unchanged) and merge my perspective corrected image with the template (background/canvas). For easier understanding - here is an example created in Adobe Photoshop: With red arrows I tried to show vertex points of the original cover image (before

Merging perspective corrected image with transparent background template image using PILLOW [PIL, Python]

删除回忆录丶 提交于 2020-05-17 03:02:07
问题 Problem: I have multiple book cover images. I made a template of "book"-like template with a 3D perspective. And all I have to do now its take each of book cover images, correct a perspective (its always constant, because the template is always unchanged) and merge my perspective corrected image with the template (background/canvas). For easier understanding - here is an example created in Adobe Photoshop: With red arrows I tried to show vertex points of the original cover image (before

Merging perspective corrected image with transparent background template image using PILLOW [PIL, Python]

让人想犯罪 __ 提交于 2020-05-17 03:01:14
问题 Problem: I have multiple book cover images. I made a template of "book"-like template with a 3D perspective. And all I have to do now its take each of book cover images, correct a perspective (its always constant, because the template is always unchanged) and merge my perspective corrected image with the template (background/canvas). For easier understanding - here is an example created in Adobe Photoshop: With red arrows I tried to show vertex points of the original cover image (before

Drawing text with PIL does not work on all images

烈酒焚心 提交于 2020-05-16 08:08:49
问题 I'm trying to draw text on images with PIL. However, I can see text on certain images only. A lot of png's don't work, such as this one: http://r0k.us/graphics/kodak/kodim16.html Code sample: import PIL from PIL import ImageFont from PIL import Image from PIL import ImageDraw from os.path import expanduser im1=Image.open(expanduser('~/Desktop/in.png')) # Drawing the text on the picture font = ImageFont.truetype('/Library/Fonts/Songti.ttc', 100) draw = ImageDraw.Draw(im1) draw.text((50, 600),

Removal of horizontal stripes using openCV2

自作多情 提交于 2020-05-16 04:52:07
问题 I am new to openCV and I was wondering if there is a way to remove the periodic stripes in the lower half of this image. I looked at this post but couldn't quite understand what was going on: Removing periodic noise from an image using the Fourier Transform 回答1: Here is how to mitigate (reduce, but not totally eliminate) the lines using Fourier Transform and notch filtering processing with Python/OpenCV/Numpy. Since the horizontal lines in the input are very close, there will be horizontal

Pass frame(mat data in android ) from android to native c++ and detect face

佐手、 提交于 2020-05-16 03:07:48
问题 I give the camera frame and init OpenCV in an Android project but I don't know how to pass the frame to a C++ method and execute face detection from there ... How can I? I use CameraBridgeViewBase.CvCameraViewListener2 and then I get frame like this: public Mat onCameraFrame(CameraBridgeViewBase.CvCameraViewFrame inputFrame) { mRgba = inputFrame.rgba(); Core.transpose(mRgba, mRgbaT); Imgproc.resize(mRgbaT, mRgbaF, mRgbaF.size(), 0,0, 0); Core.flip(mRgbaF, mRgba, 1 ); return mRgba; } I just

how to get instagram profile picture

夙愿已清 提交于 2020-05-15 10:18:28
问题 in my app use want to put instagram profile pic in his account how can I get the Profile Picture of a user from Instagram Programmatically such as : 回答1: Using the Instagram API users endpoint ( https://api.instagram.com/v1/users/{user-id}/?access_token=ACCESS-TOKEN ) you will receive a response like this one: { "data": { "id": "1574083", "username": "snoopdogg", "full_name": "Snoop Dogg", "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_1574083_75sq_1295469061.jpg",

How to place a GIF on another GIF with ImageMagick, where both GIFs are of different sizes

╄→尐↘猪︶ㄣ 提交于 2020-05-15 06:37:07
问题 I have two GIFs of different sizes. I want to be able to place one animated GIF onto a static background GIF at a specific location and at the same time add text to the result. I am new to ImageMagick world, please help. I am trying to achieve the following result where dog sticker is in a separate GIF. 回答1: If your two animations do not have the same delay and number of frames, see https://www.imagemagick.org/Usage/anim_mods/#merging. If your animations have the same delay and number of

Python extract multiple objects from image opencv

大兔子大兔子 提交于 2020-05-15 02:34:19
问题 I am trying to extract object from an image using the color using OpenCV, I have tried by inverse thresholding and grayscale combined with cv2.findContours() but I am unable to use it recursively. Furthermore I can't figure out how to "cut out" the match from the original image and save it to a single file. EDIT ~ import cv2 import numpy as np # load the images empty = cv2.imread("empty.jpg") full = cv2.imread("test.jpg") # save color copy for visualization full_c = full.copy() # convert to

opencv python reading image as RGB

隐身守侯 提交于 2020-05-14 13:42:38
问题 Is it possible to opencv (using python) as default read an image as order of RGB ? in the opencv documentation imread method return image as order of BGR but in code imread methods return the image as RGB order ? I am not doing any converting process. Just used imread methods and show on the screen. It shows as on windows image viewer. is it possible ? EDIT 1: my code is below. left side cv.imshow() methods and the other one plt.imshow() methods. cv2.imshow() methods shows image as RGB and