tiff

Using SRTM tif file in R

为君一笑 提交于 2019-12-11 16:28:38
问题 I'm trying to import a SRTM dataset into R. I've downloaded the data in a tif file however am having trouble reading it in "R". Ive tried using the following code: t = readTIFF("srtm_56_06/srtm_56_06.tif", as.is=TRUE) load('srtm_56_06/srtm_56_06.tif') read_file<-as.matrix(raster("srtm_56_06/srtm_56_06.tif") However I am still getting error messages: load('srtm_56_06/srtm_56_06.tif') # Error: bad restore file magic number (file may be corrupted) -- no data loaded # In addition: Warning message

Python and memory consumption when opening TIFF images

自古美人都是妖i 提交于 2019-12-11 14:13:49
问题 I am writing a program that deals with several 16-bit TIFF images that consumes a lot of RAM. If I am opening images like this: import cv2 for i in range(1000): img = cv2.imread(file[i]) Does each image array go to memory, or does it get deleted when I assign it to the new value? If it does not get deleted, how can I delete it before opening a new one? Thanks! 回答1: For each iteration, img gets reassigned, so the old frames will get deleted automatically by the garbage collector. 回答2: If, for

C# - Image can't be opened in Windows XP but same code works in Windows 7

白昼怎懂夜的黑 提交于 2019-12-11 13:58:19
问题 I have two tiff images, one is black and white, the other is grayscale8. I need to show them in picture box, when I try to open them: Image.FromFile("path"); The BW one opens with no issues, the grayscale one give me an exception: "out of memory" That only happens when I execute the code in a WinXP SP3 machine, a colleague with a Windows 7 has no problems in both cases Any ideas? More info: MS Paint and standard Microsoft Image Viewer can't open the grayscale image, while Office Picture

Algorithm issue with TIFF CCITT Group 4 decompression (T.6)

巧了我就是萌 提交于 2019-12-11 11:35:12
问题 I work for an engineering design house and we store black and white design drawings in TIFF format compressed with CCITT Group 4 compression. I am working on a project to improve our software for working with these drawings. I need to be able to load the raw data into my program obviously, so I must decompress it. I tried using LibTiff but gave up on that rather quickly. It wouldn't build, generating over 2000 errors. I found many obvious syntax errors in the library and concluded it was junk

Creating tiff image at runtime in WPF

社会主义新天地 提交于 2019-12-11 09:30:00
问题 I'm trying to generate a simple tiff image at runtime. This image consists of white background and image downloaded from remote server. Here's the code I've written for reaching that goal: const string url = "http://localhost/barcode.gif"; var size = new Size(794, 1123); var drawingVisual = new DrawingVisual(); using (var drawingContext = drawingVisual.RenderOpen()) { drawingContext.DrawRectangle(new SolidColorBrush(Colors.White), null, new Rect(size)); var image = new BitmapImage(new Uri(url

Issue ImageMagick-6.9.8-Q16 on win server 2012R2 .NET

痴心易碎 提交于 2019-12-11 08:07:45
问题 After downloading ImageMagick-6.9.8-Q16 from the official site of ImageMagick, i receive this error when i try to convert a file .tiff to .pdf using this command: convert -resample 200X200 dir.tif dir.pdf error and when i try to run using .NET program, this command can't create a file.pdf ProcessStartInfo pinfo = new ProcessStartInfo(); pinfo.UseShellExecute = false; pinfo.RedirectStandardOutput = true; pinfo.CreateNoWindow = true; pinfo.FileName = converterPath; pinfo.Arguments = "convert

Merging multiple TIFF files in one TIFF file

只愿长相守 提交于 2019-12-11 08:07:09
问题 I've been trying to use the mergeTiffStreams method of the TiffUtil class posted at: http://kseesharp.blogspot.com/2007/12/class-for-tiff-manipulation.html However, like other people have commented on that thread, the end result is that I receive a Stream that only contains my first TIFF file. The other TIFFs that I passed in the MemoryStream array are not included. Has anyone else run into this problem before? If so, any advice would be most appreciated. Thanks. [UPDATE] Here's the code I

Extract a full-scale image from a SVS file

百般思念 提交于 2019-12-11 07:50:42
问题 I am trying to extract the first page of a SVS file using Libtiff. The SVS file uses JPEG2000 compression for this image. My plan is: extracting raw tiles from the first page of the SVS, and decoding it using OpenJPEG. Below is what I tried to extract raw tiles from the SVS. I only got a 43KB output file from 152MB svs file (it failed to extract the raw tiles). I hope someone could let me know how to extract tiles from a SVS file. int main() { const char* filename = "input.svs"; TIFF* tiff_in

Split TIFF Files to multiple files

半腔热情 提交于 2019-12-11 06:17:30
问题 I will need to split a tiff file to multiple tiff file using the delimiter II* , so I'm using the below code to convert the tiff file to base64 and using the substring to extract the first image . However I'm getting the error as below. Please advise how to extract only the first image from the tiff file using this delimiter II* (base64 code is SUkq). I'm able to decode to image without performing the sub string. Exception in thread "main" java.lang.StringIndexOutOfBoundsException: String

Best way to convert PDF to high-resolution image in Cocoa

末鹿安然 提交于 2019-12-11 05:39:37
问题 What is the best way to convert PDF to 300 dpi (for example) tiff in Cocoa? I use PDFImageRep for creating NSImage but I cannot find the way to enlarge the resolution. 回答1: The solution is to create a graphics context for your image and render the PDF page in that context. When you create you context you specify the desired resolution. This code will do the job: + (UIImage *) convertPDFPageToImage: (CGPDFPageRef) page withResolution: (float) resolution { CGRect cropBox = CGPDFPageGetBoxRect