bmp

C++ OpenCV imdecode slow

天大地大妈咪最大 提交于 2019-12-09 23:59:12
问题 I send a byte array of an image from C# to a C++ Library. I decode the image with OpenCV (Version 3.3.1) BMP images are fast in decoding but JPEG images are slow. How i can speed up the decoding time for JPEG images? (Multithreading, GPU, ...?) Performance of decode --------------------------------------------------------- | Resolution | Format | Size | Duration | | --------------------------------------------------------- | 800x600 | BMP | 2MB | 0.7 ms | | -----------------------------------

How do i save an UIImage as a BMP file in documents directory

北慕城南 提交于 2019-12-08 12:04:22
问题 Similar questions has been asked but they always contain the answer "use UIImagePNGRepresentation or UIImageJPEGRepresentation" But that wont work for me since i have to send this file to an external webservice that only accepts BMP images. This is what i have implemented so far -(NSData*)getBitmapRepresentationFromUIImage:(UIImage*)img{ CGImageRef cgiImg =[img CGImage]; CGColorSpaceRef colorSpaceRef = CGImageGetColorSpace(cgiImg); size_t bitsPerComponent = CGImageGetBitsPerComponent(cgiImg);

BMP decoding in JavaScript and drawing to Explorer Canvas

痞子三分冷 提交于 2019-12-08 10:11:50
问题 I need to download a BMP with JavaScript and render it to the screen, in Internet Explorer. First off, yes, I know this is insane, I'm not going to get into why, let's just accept for a moment that img src is not working because of security constraints, but an ajax request with the proper authentication in the post will pull back the image. This example bypasses all the security for the sake of simplicity and just proves we can render something. The best idea I could come up with was to fetch

crop and align inserted BMP in Delphi

狂风中的少年 提交于 2019-12-08 07:14:53
问题 I want to crop and align the inserted BMP from the clipboard. I'm trying for 2 days but still nothing workable... procedure TForm1.act1Execute(Sender: TObject); var BMP : TBitmap; begin BMP := TBitmap.Create; BMP.Assign(Clipboard); BMP.SetSize(400,200); Img1.picture.Graphic := BMP; BMP.Free; end; procedure TForm1.act1Update(Sender: TObject); begin (Sender as TAction).Enabled := Clipboard.HasFormat(CF_BITMAP); end; end. 回答1: If I understand you right, you need to center the bitmap in the Image

Convert PPM to JPG or BMP in java

ぐ巨炮叔叔 提交于 2019-12-08 02:58:08
问题 I need to know how feasible is it to write a function in java to read a ppm file and convert it to jpg or bmp format. Anyone has experience with this? I am able to achieve the goal using tools such as ImageMagick but I want to do it in pure Java way. 回答1: I would search for ImageMagick Application Programmer Interfaces. They have interfaces for every significant language. I find the Java philosophy is to extensively research what already exists, find the best solution for your needs, then

Remove bmp header to encrypt

£可爱£侵袭症+ 提交于 2019-12-08 02:47:02
问题 I'm pretty new to C# and got handed this AES encryption project on images. There's probably a very simple thing that I'm missing here. I'm trying to remove the header from a bmp and encrypt the rest then add the header back. If I don't remove the header the program works well. To remove, I tried this (bmp header is 54 bytes): MyImage = new Bitmap("path"); MemoryStream ms = new MemoryStream(); MyImage.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp); byte[] Header=null, picture=null,

How to convert UIImage to BMP and save as Data (not JPG or PNG)

被刻印的时光 ゝ 提交于 2019-12-08 01:48:21
问题 I am syncing BMP images between my iOS app (Swift 3) and an app (on MS Windows) that supports only BMP format. BMP images created on the MS Windows app are downloaded as base64 strings, saved as Data and displayed quite easily using some lines of code like: let imageData = Data(base64Encoded: value) let image = UIImage(data: imageData) This is generating a UIImage from downloaded BMP image and works perfectly because I cas display the image. But I also need to create BMP images (drawn

Find nearest RGB value using color palette array in C

橙三吉。 提交于 2019-12-07 23:11:53
问题 I have some part of code done, but in some comparisons, nearest values are incorrectly. Example: Correct: Rgb value | Value from array 0xFFFFFD = 0xFFFFFF Incorrect: Fixed code Rgb value | Value from array 0xF4F939 = 0xFF0000 (should be 0xFFFF00) Console Output: (Correct) C:\Users\honguito\Desktop\Bat\Game_Batch_Files\24_to_8_bitmap>24_to_8_bit_palett e The closest color of 0xFFFFFD is: '0xFFFFFF' C:\Users\honguito\Desktop\Bat\Game_Batch_Files\24_to_8_bitmap> Console Output: (Incorrect) C:

谈谈Unicode编码,简要解释UCS、UTF、BMP、BOM等名词

谁都会走 提交于 2019-12-07 15:07:17
整理这篇文章的动机是两个问题: 问题一: 使用Windows记事本的“另存为”,可以在GBK、Unicode、Unicode big endian和UTF-8这几种编码方式间相互转换。同样是txt文件,Windows是怎样识别编码方式的呢? 我很早前就发现Unicode、Unicode big endian和UTF-8编码的txt文件的开头会多出几个字节,分别是FF、FE(Unicode),FE、FF(Unicode big endian),EF、BB、BF(UTF-8)。但这些标记是基于什么标准呢? 问题二: 最近在网上看到一个ConvertUTF.c,实现了UTF-32、UTF-16和UTF-8这三种编码方式的相互转换。对于Unicode(UCS2)、GBK、UTF-8这些编码方式,我原来就了解。但这个程序让我有些糊涂,想不起来UTF-16和UCS2有什么关系。 查了查相关资料,总算将这些问题弄清楚了,顺带也了解了一些Unicode的细节。写成一篇文章,送给有过类似疑问的朋友。本文在写作时尽量做到通俗易懂,但要求读者知道什么是字节,什么是十六进制。 ###0、big endian和little endian big endian和little endian是CPU处理多字节数的不同方式。例如“汉”字的Unicode编码是6C49。那么写到文件里时,究竟是将6C写在前面

c# PDF to Bmp for free

北慕城南 提交于 2019-12-07 14:32:50
问题 I am writing a program that uses OCR (tessnet2) to scan an image file and extract certain information. This was easy before I found out that I was going to be scanning attachments of PDFs from an Exchange server. The first problem I am working on is how to convert my PDFs to BMP files. From what I can tell so far of TessNet2, it can only read in image files - specifically BMP. So I am now tasked with converting a PDF of indeterminate size (2 - 15 pages) to BMP image. After that is done I can