image-processing

Calculating the shortest path between two points in a bitmap in python

↘锁芯ラ 提交于 2020-07-17 06:41:16
问题 I have a black and white bitmap image shown here: The image size is 200,158. I want to pick two points that fall on the white path and calculate the shortest distance between those two points following only the white pixels. I am not sure how to approach this problem. I want to create a function that I call with 2 sets of x,y coordinates and it returns the number of pixels following the shortest route along the white pixels only. Any pointers would be greatly appreciated. 回答1: As stated in

How to find how many Image Generated By ImageDataGenerator

强颜欢笑 提交于 2020-07-17 05:50:49
问题 Hi I want to ask you a question about Keras ImageDataGenerator. Can I determine how many augmented image will create? or how can find training image set size after augmentation.In Keras documentation flow function description is : "Takes numpy data & label arrays, and generates batches of augmented/normalized data. Yields batches indefinitely, in an infinite loop." But how many images generated ? For example the following code how many image generates ? Infinite ? from keras.preprocessing

How to compute the Delta E between two images

情到浓时终转凉″ 提交于 2020-07-15 07:54:26
问题 I'm currently trying to determine the color difference between our output image and a painting of Monet with Python using OpenCV. With my research I've seen that Delta E is the best for determining color difference. I've tried using extracting the BGR Channels of the two images and then taking the mean "Blue" "Green" and "Red" color used to use for computing the difference of each color channel. output_chans = cv2.split(image) monet_chans = cv2.split(best_painting) colors = ("Blue", "Green",

Convert raster byte[] image data to column Format in C#

折月煮酒 提交于 2020-07-14 06:48:48
问题 I'm trying to convert a byte array from an image that is in Raster format, which reads from left to right, to Column format, which reads from top to bottom. The problem looks simple, we have two-dimensional array of bits (width/height of image). In Raster format, you read the bits from left to right, in Column format you read the bits from top to bottom. I try to do this to support Column format printing of the ESC/POS protocol. I already have the image in Raster format, now I'm trying to

How to blur a rectagle with OpenCv

自作多情 提交于 2020-07-10 17:35:48
问题 Is there any way to blur a Mat object in OpenCv (for Android) so that the blur is contained within a Rect object? I am doing a face blurring application and have tried this: Mat mat = ...; // is initialized properly to 480*640 ... Mat blurred = new Mat(); for (Rect rect : faceDetections.toArray()) { int xStart = Math.max(0, rect.x); int yStart = Math.max(0, rect.y); Imgproc.blur(mat, blurred, new Size(rect.width/2, rect.height/2), new Point(xStart, yStart)); Core.rectangle(blurred, new Point

How to blur a rectagle with OpenCv

 ̄綄美尐妖づ 提交于 2020-07-10 17:35:38
问题 Is there any way to blur a Mat object in OpenCv (for Android) so that the blur is contained within a Rect object? I am doing a face blurring application and have tried this: Mat mat = ...; // is initialized properly to 480*640 ... Mat blurred = new Mat(); for (Rect rect : faceDetections.toArray()) { int xStart = Math.max(0, rect.x); int yStart = Math.max(0, rect.y); Imgproc.blur(mat, blurred, new Size(rect.width/2, rect.height/2), new Point(xStart, yStart)); Core.rectangle(blurred, new Point

Keras Same Feature Extraction from Different Images

ぃ、小莉子 提交于 2020-07-10 06:59:28
问题 I'm using Keras' pre-trained model for feature extraction in two images, however they gave the same outcome (array_equal = True). I've tried other model like VGG16 and Resnet50 but the results are the same. Am I writing the code wrong or is it the limitation of pre-trained model? Is there anything I can do to extract different features? Thanks! import cv2 from keras.applications.inception_v3 import InceptionV3 from keras.applications.inception_v3 import preprocess_input model = InceptionV3

Keras Same Feature Extraction from Different Images

青春壹個敷衍的年華 提交于 2020-07-10 06:59:12
问题 I'm using Keras' pre-trained model for feature extraction in two images, however they gave the same outcome (array_equal = True). I've tried other model like VGG16 and Resnet50 but the results are the same. Am I writing the code wrong or is it the limitation of pre-trained model? Is there anything I can do to extract different features? Thanks! import cv2 from keras.applications.inception_v3 import InceptionV3 from keras.applications.inception_v3 import preprocess_input model = InceptionV3

Regionprops vs. PodczeckShapes/DIPimage Circularity question - Matlab

自作多情 提交于 2020-07-09 08:29:31
问题 Can someone please explain me why the 'Circularity' in Matlab is calculated by (4*Area*pi)/(Perimeter^2) while in Podczeck Shape it is Area/(Pi/4*sp^2) https://qiftp.tudelft.nl/dipref/FeatureShape.html)? Or is it just simply defined differently? I tried to write a Podczeck Shape circularity code in Matlab and I assume that ‘MaxFeretDiameter’ is perpendicular to ‘MinFeretDiameter’, am I correct? Code: clc; clear all; close all; Pi=pi; Image = rgb2gray(imread('pillsetc.png')); BW = imbinarize

why the grayscale image has 3 channels

杀马特。学长 韩版系。学妹 提交于 2020-07-09 06:56:32
问题 i am performing operations on a grayscale image, and the resultant image of these operations has the same extension as the input image. for an example if the input image is .jpg or .png the output image is either .jpg or .png respectively. and I am converting the image into grayscale as follows: ImgProc.cvtColor(mat, grayscale, ImgProc.COLOR_BGR2GRAY), and I am checking the channels count using: .channels() the problem is when I wnat to know how many channels the image contain, despit it is a