image-processing

Imago throws a SyntaxError when trying to run it

不羁岁月 提交于 2020-03-06 11:00:13
问题 I am trying to install an image forensics tool for Python, imago. When I try to install it, using the traditional pip command, it gets installed but when I try to run it, it gives me a syntax error as: Traceback (most recent call last): File "/home/ankush/.local/bin/imago", line 6, in <module> from imago.imago import main File "/home/ankush/.local/lib/python3.6/site- packages/imago/imago.py", line 18 """ ^ SyntaxError: Missing parentheses in call to 'print'. Did you mean print("""\ ##########

How to convert a jpeg image to an svg in octave?

倾然丶 夕夏残阳落幕 提交于 2020-03-06 10:06:29
问题 I have a black n white image which i would first like to convert into a png with a transparent background such that only the black part of the image remains. Using this output image i want to convert it to svg. All of this through code which can be connected to a back-end of a server. How can i achieve this? 回答1: I am not certain this will always work, but it may get you started. I suggest ImageMagick and potrace both of which are free and available for OS X, Linux and Windows. You can

Template matching in openCV [JAVA]

北城以北 提交于 2020-03-06 02:28:08
问题 I am using OpenCV(opencv_java248) . I have one template image. This template image have logo some company. I want to know if this logo contain in other image. I got following code somewhere. public void run(String inFile, String templateFile, String outFile, int match_method) { System.out.println("Running Template Matching"); Mat img = Highgui.imread(inFile); Mat templ = Highgui.imread(templateFile); // / Create the result matrix int result_cols = img.cols() - templ.cols() + 1; int result

How can I predict single image in Keras CNN model?

醉酒当歌 提交于 2020-03-05 02:54:07
问题 I am following this guide to learn image classification with CNN and I implemented this code into my data set: https://www.tensorflow.org/tutorials/images/classification Code Updated train_image_generator = ImageDataGenerator(rescale=1. / 255) # Generator for our training data validation_image_generator = ImageDataGenerator(rescale=1. / 255) # Generator for our validation data train_data_gen = train_image_generator.flow_from_directory(batch_size=batch_size, directory=train_img_folder, shuffle

DetectMultiscale in a Multi classification SVM hog classifier in video stream

ぃ、小莉子 提交于 2020-03-03 11:41:05
问题 I want to create a valve detection and classification like this video : https://www.youtube.com/watch?v=VY92fqmSdfA i chose to use HOG(Histogram Oriented Gradient) + SVM, and this is how it works : 1-Read positive images (valve open) and negatives images(valve close). int const num_total_images = 100; int width = 128, height = 128; // load images vector<cv::String> fn; glob("Add here positive images path *.jpg", fn, false); vector<Mat> imagesO; size_t count = fn.size(); //number of png files

Detecting small squares attached to something else on the image

£可爱£侵袭症+ 提交于 2020-03-03 07:35:47
问题 I want to detect small squares circled in red on the image. But the problem is that they are on another white line. I want to know how to separate those squares from the white line and detect them. I have used OpenCV Python to write the code. What I have done until now is that I cropped the image so that I get access only to the circular part of the image. Then I cropped the image to get the required part that is the white line. Then I used erosion so that the white line will vanish and the

Detecting small squares attached to something else on the image

蓝咒 提交于 2020-03-03 07:35:05
问题 I want to detect small squares circled in red on the image. But the problem is that they are on another white line. I want to know how to separate those squares from the white line and detect them. I have used OpenCV Python to write the code. What I have done until now is that I cropped the image so that I get access only to the circular part of the image. Then I cropped the image to get the required part that is the white line. Then I used erosion so that the white line will vanish and the

Saving jpg to png increases size [duplicate]

此生再无相见时 提交于 2020-03-03 04:45:47
问题 This question already has an answer here : PHP: imagepng is creating inordinately large files (1 answer) Closed 6 years ago . I use the following code to save any format of image to png : $crawl_outfile = 'webss_' . uniqid() . '.png'; imagepng(imagecreatefromstring(file_get_contents($src)),$crawl_outfile); And it increases the size of 290 KB to 1.7 MB. Cannot understand the reason. Is there any way(parameter) to get smaller image ? 回答1: JPEG is a lossy compression format (some detail in the

Saving jpg to png increases size [duplicate]

99封情书 提交于 2020-03-03 04:45:11
问题 This question already has an answer here : PHP: imagepng is creating inordinately large files (1 answer) Closed 6 years ago . I use the following code to save any format of image to png : $crawl_outfile = 'webss_' . uniqid() . '.png'; imagepng(imagecreatefromstring(file_get_contents($src)),$crawl_outfile); And it increases the size of 290 KB to 1.7 MB. Cannot understand the reason. Is there any way(parameter) to get smaller image ? 回答1: JPEG is a lossy compression format (some detail in the

Get color of individual pixels of images in pygame

余生颓废 提交于 2020-03-01 12:47:13
问题 How can I get the colour values of pixels of an image that is blitted onto a pygame surface? Using Surface.get_at() only returns the color of the surface layer, not the image that has been blitted over it. 回答1: The method surface.get_at is fine. Here is an example showing the difference when blitting an image without alpha channel. import sys, pygame pygame.init() size = width, height = 320, 240 screen = pygame.display.set_mode(size) image = pygame.image.load("./img.bmp") image_rect = image