image-processing

How to load EMNIST data to Tensorflow

我怕爱的太早我们不能终老 提交于 2021-01-28 02:40:22
问题 In all the tutorials i've seen for tensorflow, they've used the MNIST dataset, i've understood the modelling but how do i load this dataset into tensorflow? https://www.nist.gov/itl/iad/image-group/emnist-dataset 回答1: The EMNIST dataset uses the same binary format as the original MNIST dataset. Therefore you can take the input pipeline code from any tutorial that uses the original MNIST dataset, and point it at the set of files you get from downloading the EMNIST dataset to train on that

How to segment similar looking areas (color wise) inside a image that belong to biosamples with opencv and python?

邮差的信 提交于 2021-01-28 02:03:50
问题 I'm trying to analyze images of bio-films of pseudomona, I'm doing this in order to find some kind of correlation between its grow and distribution with some independent variables. I've applied a segmentation to obtain a circular area of interest and now I was thinking in applying some color segmentation to the image with its HSV values to just leave the areas with bio-film. I've trying to think in a way to completely isolate all the areas that are important, I applied a bitwise_not to the

Remove anti-aliasing from an image

青春壹個敷衍的年華 提交于 2021-01-28 01:44:46
问题 I want to remove the antialiasing from an image. This code will get the 4 major colors from an image, compare each pixel to the 4 major colors and assign the closest color. import numpy as np from PIL import Image image = Image.open('pattern_2.png') image_nd = np.array(image) image_colors = {} for row in image_nd: for pxl in row: pxl = tuple(pxl) if not image_colors.get(pxl): image_colors[pxl] = 1 else: image_colors[pxl] += 1 sorted_image_colors = sorted(image_colors, key=image_colors.get,

How to convert raster byte array of an image to original image in java?

孤街浪徒 提交于 2021-01-28 01:43:35
问题 I need to convert bytes of an image to original image. My byte array which is created by WritableRaster.And Itried to convert to original form ,but it produced image without original colors.My tries are below try { BufferedImage readImage = ImageIO.read(new File("C:\\Users\\Public\\Pictures\\Sample Pictures\\Desert.jpg")); byte imageData[] = get_byte_data(readImage); // Then I need to convert this to original image DataBuffer buffer = new DataBufferByte(imageData, imageData.length);

Image quality improvement in Opencv

倖福魔咒の 提交于 2021-01-28 00:00:31
问题 I have two images. One has more green color and another one has better quality (it has right color). How can I improve the first one to have the similar color as the second one.I used the contrast enhancement as //Contrast enhancement for (int y = 0; y < rotated.rows; y++) { for (int x = 0; x < rotated.cols; x++) { for (int c = 0; c < 3; c++) { //"* Enter the alpha value [1.0-3.0]: " //"* Enter the beta value [0-100]: "; rotated.at<Vec3b>(y, x)[c] = saturate_cast<uchar>(2.5*(rotated.at<Vec3b>

how to detect all the rectangular boxes in the given image

断了今生、忘了曾经 提交于 2021-01-27 23:29:52
问题 I tried to detect all the rectangles in image using threshold, canny edge and applied contour detection but it was not able to detect all the rectangles. Finally, I thought of detect the same using hough transforms but when I tried to detect lines in image, I'm getting all the lines. I need to detect only rectangular boxes in the image. Can someone help me? I'm new to opencv. Input image Code: import cv2 import matplotlib.pyplot as plt import numpy as np img = cv2.imread("demo-hand-written

Gaussian Low-pass Filter in Android OpenCV.

大兔子大兔子 提交于 2021-01-27 21:22:58
问题 In order to make an image with better quality, I had do lots of research on filters. Filters are categorized into low, medium and high. After an analysis of these categories of filters, I conclude that Gaussian low-pass filter is the most suitable for me. And I had researched on how to code it in Android. Finally I found that OpenCV has this function. After a few days of headache, I still can't find any solution since I am new to OpenCV. Does anyone can help me? 回答1: Take a look at this

Problem plotting an image's Fourier transforms. “ValueError: x and y can be no greater than 2-D, but have shapes (2592,) and (2592, 1, 3)”

谁说胖子不能爱 提交于 2021-01-27 21:12:56
问题 I'm trying to get the fft of an image and then plot the fraq of that fft with using matplotlib. However, this error message: "ValueError: x and y can be no greater than 2-D, but have shapes (2592,) and (2592, 1, 3)". I tried to reshape my np.array like so: import numpy as np from PIL import Image import matplotlib.pyplot as plt import tkinter from scipy.fftpack import fft, fft2, fftshift resim = Image.open(r'yeni.jpg') resim_data = np.asarray(resim) fourier = fft2(resim_data) #psd2D = np.abs

How to obtain size of cluster of pixels in R

时间秒杀一切 提交于 2021-01-27 21:05:49
问题 I have a picture of 2 colors. Red color pixels are in form of cluster. I would like to know the max dimension of each cluster to compare with the acceptable tolerance. How to do? Is there any function to perform it? 回答1: For this kind of image analysis, you can check out EBImage : install.packages("BiocManager") BiocManager::install("EBImage") Your workflow might look something like this. First, load the packages and read in your image. We'll also display it to show we're on the right track:

Calculate the Affine transformation matrix in image Feature based registration

孤街醉人 提交于 2021-01-27 20:01:24
问题 I have two images, one is the result of applying an affine transform to the other. I can register them using homography by extracting the points using the ORB_create function in OpenCV. However, I want to calculate the Affine matrix needed for this transformation. is there any way of doing it simply by having the two images? 回答1: Detect a rotated rectangle and use its corners to get your transformation matrix Use : getPerspectiveTransform or getAffineTransform Edit: regarding rotated