image-processing

Conversion formula from RGB to YCbCr

大憨熊 提交于 2021-01-21 08:04:10
问题 Whats the real conversion formula for this because I found so many ways on how to convert I don't know which one is real From wikipedia: From microsoft https://msdn.microsoft.com/en-us/library/ff635643.aspx : and microsoft is the same with this conversion site http://www.equasys.de/colorconversion.html: Can anybody explain the difference of the formula? 回答1: If it still actual they are almost the same. Differences are what value ranges you'll get in the result. From Wiki's matrix (R',G',B' =

Speckle ( Lee Filter) in Python

喜你入骨 提交于 2021-01-21 07:26:08
问题 I am trying to do speckle noise removal in satellite SAR image.I am not getting any package which does speckle noise removal in SAR image. I have tried pyradar but it works with python 2.7 and I am working on Anaconda with python 3.5 on windows. Also Rsgislib is available but it is on Linux. Joseph meiring has also given a Lee filter code on github but it fails to work. : https://github.com/reptillicus/LeeFilter Kindly, can anyone share the python script for Speckle Filter or how to proceed

Convert Image ( png ) To Matrix And Then To 1D Array

纵饮孤独 提交于 2021-01-20 18:12:45
问题 I have 5 pictures and i want to convert each image to 1d array and put it in a matrix as vector. I want to be able to convert each vector to image again. img = Image.open('orig.png').convert('RGBA') a = np.array(img) I'm not familiar with all the features of numpy and wondered if there other tools I can use. Thanks. 回答1: import numpy as np from PIL import Image img = Image.open('orig.png').convert('RGBA') arr = np.array(img) # record the original shape shape = arr.shape # make a 1-dimensional

Convert Image ( png ) To Matrix And Then To 1D Array

十年热恋 提交于 2021-01-20 18:08:33
问题 I have 5 pictures and i want to convert each image to 1d array and put it in a matrix as vector. I want to be able to convert each vector to image again. img = Image.open('orig.png').convert('RGBA') a = np.array(img) I'm not familiar with all the features of numpy and wondered if there other tools I can use. Thanks. 回答1: import numpy as np from PIL import Image img = Image.open('orig.png').convert('RGBA') arr = np.array(img) # record the original shape shape = arr.shape # make a 1-dimensional

Rotating image with trigonometric functions

我只是一个虾纸丫 提交于 2021-01-07 07:00:28
问题 Hello I want to ratate image with only using trigonometric functions. Assume "q" as a "theta" y'=x*sin(q) + y(-tan(q/2))*sin(q)+y x'=x+2 y (-tan(q/2)) + x sin(q) (-tan^2(q/2)) + y x' and y' is going to be our new x and y values. I am quite new in image proccesiing but i wrote a code which i think is kind of right. In this example "theta" is considered "30 degrees" but i will develop the code and it will work for any other degrees... So basically, I want from u to find my misake or if the code

Calculate Percentage Decrease in RGB Image

别说谁变了你拦得住时间么 提交于 2021-01-07 02:35:34
问题 I'm working on an Image Processing Algorithm that involves placing a mask on an image and hiding certain regions as follows, Image 1 Image 1 Reduced Visually Image 1 has undergone a reduction of about 50%. Some of the images I work with also end up having isolated regions like the one below. To compute reduction in the image I used the following code to calculate the increase in black pixels, sought = [0,0,0] black1 = np.count_nonzero(np.all(Image1==sought,axis=2)) #Black pixels in Image 1

Image Steganography with python opencv, reconstructing the embedded image is very noisy

最后都变了- 提交于 2021-01-07 02:31:55
问题 I am hiding an image inside another image (Image Steganography) by using python 3.6.8 with opencv 4.4.0.44. I am on windows 10 machine. The algorithm I am using is as follows: I have defined a mask with zeros at the last two lowest significant bits. Then I use this mask and "bitwise and" it to make the last two bits of every pixel in the base image to zero. There are two images, one is base image which accommodates the second image (hidden image). I have made sure the size of the hidden image

Uploading array as a .jpg image to Azure blob storage

巧了我就是萌 提交于 2021-01-05 08:40:07
问题 I am working on an image processing project where my images are saved in blob storage on Azure. My goal is to read in the blob images and apply some transformations to them, then upload them to a separate container using python. Currently, I'm able to read in the images from Azure, convert the images to arrays so I can process them, but I'm having trouble getting the arrays back to Azure as .jpg images. This is what I'm trying (where resized_image is a (243, 387, 3) array): resized_image =

Perspective Transform in OPENCV PYTHON

♀尐吖头ヾ 提交于 2021-01-05 07:05:46
问题 I am trying to perform a perspective transform of a sudoku puzzle. The expected transformation is happening only on the left side. Please help me by pointing out my mistake. Input Image: Expected Output Image: The output I am getting: The corners of the sudoku puzzle found using cv2.approxpolydp() are as follows: top_left = [71,62] top_right = [59, 418] bottom_right = [443, 442] bottom_left = [438, 29] The shape of the output image is [300,300]. The corresponding output coordinates are :

Pixelate ROI bounding box and overlay it on original image using OpenCV

蓝咒 提交于 2021-01-05 06:00:13
问题 Lets make it straightforward. I have private project to block or pixelate image using boundary box in open-cv, something like censoring image, inspired from this paper: https://www.researchgate.net/publication/325746502_Seamless_Nudity_Censorship_an_Image-to-Image_Translation_Approach_based_on_Adversarial_Training I have found the way to classify the area of censor using Keras, but still don't know the way how to use the boundary box to pixelate the classified area, and overlay it to original