image-processing

Window freezing even after using waitKey() and destroyAllwindows() in Opencv

北慕城南 提交于 2021-01-27 18:36:05
问题 ENVIRONMENT OS- mint Linux, using opencv3.1,using spyder through anaconda ISSUE The code mentioned below opens a window of name frame and display the video captured through laptop camera.But when I press 'q', as mentioned in code, it should stop and terminate the window. But,here the window stops to display any further frames captured and do not terminates.then manually I force Quit the process. What is the problem, why is it not terminating the window? CODE:- import cv2 import numpy as np

How to speed up the “ImageFolder” for ImageNet

£可爱£侵袭症+ 提交于 2021-01-27 17:12:10
问题 I am in an university, and all the file system are in a remote system, wherever I log in with my account, I could aways access my home directory. even though I log into the GPU servers through SSH command. This is the condition where I employ the GPU servers to read data. Currently, I use the PyTorch to train ResNet from scratch on ImageNet, my codes only use all the GPUs in the same computer, I found that the "torchvision.datasets.ImageFolder" will take almost two hours. Would you please

Difference between dcm2pnm, dcmj2pnm and dcml2pnm

放肆的年华 提交于 2021-01-27 13:48:55
问题 The title says it all. What is the difference between dcm2pnm (http://support.dcmtk.org/docs/dcm2pnm.html), dcmj2pnm (http://support.dcmtk.org/docs/dcmj2pnm.html) and dcml2pnm (http://support.dcmtk.org/docs/dcml2pnm.html) commands of dcmtk toolkit (http://support.dcmtk.org/docs/pages.html)? They all seem to convert dicom images to other formats. Are there any special situations where one should be preferred over others? Edit: It seems dcml2pnm supports more formats. Why not use that for all

image gradient angle computation

孤街浪徒 提交于 2021-01-27 12:40:16
问题 I am actually following the instructions of a paper: The input is supposed to be a binary "edge" image. The output should be a new image, modified by the instructions in the paper. My understanding of the instructions is, that one takes the gradient image of the edge image and modifies it and creates a new image with the modified gradient. Therefore is there a possibility in MATLAB/OpenCV of creating the same image with a new gradient? Reference to the paper: Li, Hongyu, and Lei Chen.

How to get the bounding box of text that are overlapped with background lines?

狂风中的少年 提交于 2021-01-27 12:30:53
问题 For example, in the following app screenshot, I want to get the bounding box tightly rounded over CA-85S (the text on the horizontal blue line), and Almaden Expy (text that overlapped with the blue line). I am extracting those bounding boxes for OCR. I've tried several approaches in openCV that none of those approaches work for me. 回答1: Using the observation that the desired text to extract is in black and has a contrast different from the blue river background lines, a potential approach is

How can I write 16 bit grayscale image as jpeg?

回眸只為那壹抹淺笑 提交于 2021-01-27 11:52:27
问题 I have 16-bit per pixel grayscale BufferedImage created from an array of shorts: private BufferedImage get16bitImage(short[] pixels) { ColorModel colorModel = new ComponentColorModel( ColorSpace.getInstance(ColorSpace.CS_GRAY), new int[]{16}, false, false, Transparency.OPAQUE, DataBuffer.TYPE_USHORT); DataBufferUShort db = new DataBufferUShort(pixels, pixels.length); WritableRaster raster = Raster.createInterleavedRaster( db, imgD.width, imgD.height, imgD.width, 1, new int[1], null); return

Ripple effect in MATLAB

对着背影说爱祢 提交于 2021-01-27 08:29:28
问题 I want to write a function newim = rippleim(im) that takes an image and returns a new image with ripple effect on it. I thought calculating the distance of all points from (p,q) and then a multiplication of sin(d).*exp(-d) would give a good effect of fading waves. n = 800; m = 800; im = zeros(n,m,3); p = [round(m*.5) round(n*.5)]; [x y] = meshgrid(1:m,1:n); x = x - p(1,1); y = y - p(1,2); d = (x .^2 + y .^2).^.5; R = cos(.05*d) .* exp(-.005*d); G = cos(.05*d) .* exp(-.005*d); B = cos(.05*d) .

Out Of Memory exception on System.Drawing.Image.FromStream()

寵の児 提交于 2021-01-27 06:05:42
问题 I have an application, which processes and re-sizes images and occassionally during long iterations I get OutOfMemoryException. I store my images in the database as filestream and during processing I need to save them to a temporary physical location. My models: [Table("Car")] public class Car { [... some fields ...] public virtual ICollection<CarPhoto> CarPhotos { get; set; } } [Table("CarPhoto")] public class CarPhoto { [... some fields ...] public Guid Key { get; set; } [Column(TypeName =

Changing image DPI for usage with tesseract

折月煮酒 提交于 2021-01-27 05:28:34
问题 I am working on a project to recognize text in Business Cards and map them to appropriate fields.I am using opencv for image processing.I need to feed the preprocessed image to Tesseract-OCR engine for text recognition.This link states that images should have atleast a DPI of 300.My image pixel size is 2560x1536 with 72 DPI. How to increase the DPI to 300? It is also said that it is beneficial to resize image.How to resize my image optimally for good OCR results Tesseract works best on images

Changing image DPI for usage with tesseract

北城余情 提交于 2021-01-27 05:28:33
问题 I am working on a project to recognize text in Business Cards and map them to appropriate fields.I am using opencv for image processing.I need to feed the preprocessed image to Tesseract-OCR engine for text recognition.This link states that images should have atleast a DPI of 300.My image pixel size is 2560x1536 with 72 DPI. How to increase the DPI to 300? It is also said that it is beneficial to resize image.How to resize my image optimally for good OCR results Tesseract works best on images