将十六进制文件转换为 bmp [英] Converting a hex file into a bmp
问题描述
我正在使用一个公开可用的库(如开源")测试电子芯片(软件模拟).该芯片的测试(与库一起提供)有一个十六进制文件作为输入..... 这个十六进制文件应该是实际 bmp 的转储.
I am testing an electronic chip (software simulated) with an openly available library (as in "open source"). The test for this chip (available with the library) has a hex file as an input ..... This hex file is supposedly a dump of an actual bmp.
作为测试人员,我遵循信任但验证"的座右铭:) 所以我想看看这个转储是否真的是一个正确的图像,即如果这个十六进制转储是正确的,那么我必须能够将它转换回一个bmp.任何地方都有这样的工具/脚本吗?
As a tester, I follow the "Trust but verify" motto :) so I want to see whether this dump is actually a correct image i.e. if this hex dump is correct, then I must be able to convert this back into a bmp. Is there such a tool/script available anywhere ?
预先感谢并感谢您的帮助.
Thanks in advance and appreciate the help.
推荐答案
我在实现图像过滤算法时做过类似的事情.我使用 Matlab 将十六进制数据作为矩阵读入.然后使用 imshow(
函数将数据显示为图像.没有必要摆弄 BMP 标头.
I have one done simmilar things while implementing an image filter algorithm. I used Matlab to read in the HEX Data as a matrix. Then use the imshow(<matrix>)
function to display the data as an image. There was no need to fiddle around with BMP headers.
我你没有Matlab,或者不愿意付费,那你可以试试Scilab,这是一个免费和开源的替代方案.我还没有广泛使用它,但据说 Scilab 是(在大多数情况下)与 Matlab 语法兼容.
I you do not have Matlab, or are not willing to pay for it, then you can try Scilab, which is an free and open source alternative. I have not yet used it extensively but it is said, that Scilab ist (for the most part) compatible with the Matlab syntax.
这篇关于将十六进制文件转换为 bmp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!