image-processing

Print High Resolution Image in C#

落花浮王杯 提交于 2020-08-26 09:04:11
问题 I am printing image 2349 x 3600 pixels. I have resized image but printing is blurred not clean. Please looke at code - public Bitmap resizeimage(Bitmap bitmap) { Bitmap result = new Bitmap(850, 1101); using (Graphics grap = Graphics.FromImage(result)) { grap.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; grap.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.Bicubic; grap.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; grap

Make Edges of the Image smooth

杀马特。学长 韩版系。学妹 提交于 2020-08-24 05:02:09
问题 I am currently working a simple project It is removing the Background of any image and converting it into a Sticker but it is not Giving me Smoother import cv2 import numpy as np from PIL import Image, ImageFilter from google.colab.patches import cv2_imshow from matplotlib import pyplot as pl #img = cv2.imread("/content/police-car-icon-cartoon-style-vector-16884775.jpg") remove_background("/content/WhatsApp Image 2020-08-17 at 1.08.33 AM (2).jpeg") def remove_background(img1): #== Parameters

Python/OpenCV — Matching Centroid Points of Bacteria in Two Images

筅森魡賤 提交于 2020-08-20 12:09:18
问题 I am working on an algorithm to match the centroids of bacteria using computer vision. As I'm an undergraduate and beginner to computer vision, I do not have code specifically for this problem. Just to provide some background, I'm using the following functions in my GUI. The 'bact' variable refers to Bacteria objects, which stores each bacteria's ID, position, etc. def identify_fluor(img, frame: int): darkBlue = (139, 0, 0) for bact in fluor_at_frame(frame): pos = tuple([int(coord) for coord

Intel RealSense D435i frames drop on Intel® RealSense™ SDK 2.0

人盡茶涼 提交于 2020-08-17 05:52:46
问题 It works like a charm when the RGB module of the camera has a resolution of 1280x720, and FPS as 15 frames/sec. The depth mode and IMU work fine in all the settings. But if the resolution is increased above 1280x720 - 15 frames/sec, I face a Runtime error: backend-v412.cpp:988 - Frames didn't arrive within 5 seconds. Other forms of this error: 10:41:49 [Warn] .../backend-v4l2.cpp:988 - Frames didn't arrived within 5 seconds It seems like the pipeline is not able to handle the framebuffers,

OpenGL compute shader - strange results

本秂侑毒 提交于 2020-08-15 05:26:43
问题 I'm trying to implement a multipass compute shader for image processing. There is an input image and an output image in each pass. The next pass' input image is the previous ones' output. This is the first time for me using compute shader in OpenGL so there may be some problems with my setup. I'm using OpenCV's Mat as the container to read/copy operations. There are some parts of the code which isn't related to the problem so I didn't include. Some of these parts include loading the image or

converting hex value to name of the colour in python

天涯浪子 提交于 2020-08-10 19:25:49
问题 my program outputs hex values such as (#673429ff). I wanted to convert that to the colour name. How can I get the colour name? I am using python.Here is the last part of my code: index_max = scipy.argmax(counts) # find most frequent peak = codes[index_max] colour = binascii.hexlify(bytearray(int(c) for c in peak)).decode('ascii') print('most frequent is %s (#%s)' % (peak, colour)) 回答1: Here is a solution without using existing color naming library: The code finds the best match of the picked

Mapping pixel value to temperature value on a thermal image

女生的网名这么多〃 提交于 2020-08-08 06:36:29
问题 I have a thermal image (with a color bar) from an IR camera. My goal is to get the temperature of any point by clicking on it. I have already written a script that retrieves the RBG values of any pixel by right-clicking on it. I figure that using the max and min temperatures of the color bar, I can map pixel values to temperature values. Is this possible or is there a better way to approach this? Thank you very much. from PIL import Image import cv2 from win32api import GetSystemMetrics

Counting white clusters horizontally in a processed fabric

*爱你&永不变心* 提交于 2020-08-08 05:37:43
问题 I processed a fabric material to obtain the image as shown below: Original image: Processed Image: Now, I want to find the number white clusters in a row. If all the clusters are uniform and perfectly horizontal, I would have run a loop to count the raise and drop in intensities to find number of clusters ,but thats not the case.If I take median/mean of several rows by the above method, the required answer is differing by a huge margin. Is there any way to count them accurately on the

How to eliminate row of black pixels from OpenCV WarpAffine rotation

大城市里の小女人 提交于 2020-08-06 05:03:46
问题 I am rotating an 3 images 180 degrees with cv2.warpAffine() and then horizontally concatenating them with cv2.hconcat(). This is adding a 1 pixel wide column of black between the images but the width of the image from img.shape is correct. If I do not rotate them the image looks good with no black columns. All 3 images are 1920 wide x 1200 high. How can I eliminate the black column? It is similar to - warpAffine It is not happening with Scipy. The commented out code (ndimage.rotate()) is how

How to eliminate row of black pixels from OpenCV WarpAffine rotation

五迷三道 提交于 2020-08-06 05:02:13
问题 I am rotating an 3 images 180 degrees with cv2.warpAffine() and then horizontally concatenating them with cv2.hconcat(). This is adding a 1 pixel wide column of black between the images but the width of the image from img.shape is correct. If I do not rotate them the image looks good with no black columns. All 3 images are 1920 wide x 1200 high. How can I eliminate the black column? It is similar to - warpAffine It is not happening with Scipy. The commented out code (ndimage.rotate()) is how