将LPBYTE变量视为图像 [英] Viewing LPBYTE variable as an Image

查看:96
本文介绍了将LPBYTE变量视为图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的田径训练中,我遇到了LPBYTE变量,它以帧形式传送给我

我想找到一种在我的电脑上查看这些帧的方法

因为我没有太多的经验,我有点卡在那里:(



LPBYTE作为无法识别的符号到达我,如:



,价优惠¥ ¥¥¥¥¥¥|||§§§§§§§§§§§§§§§|||||||§§§§¨¨¨©©©ھھھھھھھھھھھ©©¨¨©©¨© ©©©©©©©©©©©©ھھھ«««««««««««ھھ««ھ««««¬¬¬¬¬¬¬¬¬¬¬ھھ©©©©§§ §|¥¥||©ھ««¬¬¬¬¬¬¬¬¬¬©>fccccXuv\¬«ھ«ھھھ««¬¬¬¬®®®®®®®®®®® ®®®®®®®®¯°°°°¯®®®®®®®®®®®®®®®®¯°¯¯®®¬®®¬¬¬¬¬¬¬¬¬¬« «««« ھ«««««««¬¬©¨<|,??ں>




并保存为(。 JPEG或.bmp)它不会打开,

所以,我认为它可能是原始像素数据,但仍然找不到查看它的方法



任何人都可以帮我在我的电脑上查看这些帧吗?

In my feild training i've come across LPBYTE variable that is streamed to me as frames
I want to find a way to view these frames on my pc
since i don't have a lot of experiance, i'm kinda stuck there :(

the LPBYTE arrives to me as unrecognized symbols, like:

،¤¤¤££££££££££¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¥¥¥¥¥¥¥¥¥¥¥¥¥¥¦¦¦§§§§§§§§§§§§§§§¦¦¦¦¦¦¦§§§§¨¨¨©©©ھھھھھھھھھھھ©©¨¨©©¨©©©©©©©©©©©©©ھھھ«««««««««««ھھ««ھ««««¬¬­¬¬¬¬¬¬¬­¬¬ھھ©©©©§§§¦¥¥¦¦¨©ھ««¬¬¬¬¬¬¬¬¬­­­­­­­­­­­­­­­­­­­­­­­­­­­¬©›„fccccXuv\"¬«ھ«ھھھ««¬¬¬­­­­­­­­­­¬®®­®®®®®®®®®®®­­®®­®®®®¯°°°°¯®­­®®­®®®®®®®®®®®­­­­®®¯°¯¯®®­­­­­¬®®­­­¬¬¬¬¬¬­­­­¬­­­­­­¬¬¬«««««ھھ««ھ««««¬¬ھ©¨‹¦‚ں


and when saving it as (.JPEG or .bmp) it wont open,
so, I was thinking that it may be raw pixel data, but still can't find a way to view it

can any one help me to view these frames on my pc ?

推荐答案

有没有_important_详细信息?



■每帧中有多少字节?

■图像的预期位深度是多少?

■什么是分辨率?



无论如何,尝试使用图像的一小部分 - 可能是5或10像素。

1)保存收到的数据到二进制文件

2)用十六进制编辑器打开文件并写下15-> 20或30-> 40的字节(即5个像素的3或4个字节,或者3个或4个字节,10个像素)

3)打开您喜欢的图像编辑程序并开始输入数据。



即如果前6个字节是FF 000 00 FF 00 00,那么您可以尝试假设图像是24位。然后你可以说2像素的颜色值是(255,0,0)和(255,0,0) - 如果你不熟悉十六进制数字,可以在程序员模式下使用windows计算器。



在几个像素(可能是5或10)之后,您可以将数据识别为图像。

另请注意,我假设数据是存储为RR GG BB RR GG BB等。您可能还希望尝试BB GG RR BB GG RR。



最后,根据您的设备,它甚至可能不会是rgb数据 - 即使它是原始的,未压缩的视频帧。如果数据以YUV格式出现,那将不会让我感到惊讶 - 这种格式源于模拟电视信号。需要转换为rgb或hsl颜色模型的数据。虽然,YUV会使我的下一个建议不那么有用。



一个好的方法也可能是将数据打印为ascii字符,确保每行的字符数是与每行预期像素数相同。虽然它不会真正揭示​​图片,但它可以是视觉识别图案的快速方式。如果数据只有8位也会有所帮助。你不会有调色板,但你可以看到图像。



正如你所看到的,有很多潜在的陷阱和事情可能会阻碍你的努力。

祝你好运!
Got any of the _important_ details?
I.e
■ How many bytes are in each frame?
■ What is the expected bit-depth of the images?
■ What's the resolution?

Anyway, Try working with a small section of the image - perhaps 5 or 10 pixels.
1) Save the received data to a binary file
2) Open the file with a hex editor and write down 15->20 or 30->40 of the bytes (I.e 3 or 4 bytes for 5 pixels, or 3 or 4 bytes for 10 pixels)
3) Open your favourite image editing program and start entering the data.

I.e if the first 6 bytes are FF 000 00 FF 00 00, then you may try working with an assumption that the image is 24 bits. You could then say that the colour values for 2 pixels are (255,0,0) and (255,0,0) - use windows calculator in programmer mode if you're not familiar with hexidecimal numbers.

After several pixels - perhaps 5 or 10, you may be able to recognize the data as an image.
Also note, I've assumed that the data is stored as RR GG BB RR GG BB etc. You may also wish to try BB GG RR BB GG RR.

Finally, depending on your device, it may not even be rgb data - even if it is raw, uncompressed video frames. It wouldn't surprise me if the data came out in the YUV format - one that draws roots from analog tv signals. Data that would need conversion to either of the rgb or hsl colour models. Though, YUV would make my next suggestion less useful.

A good approach may also be to print the data as ascii characters, ensuring that the number of chars per line is the same as the number of expected pixels per row. Although it wont really reveal the picture, it can be a fast way of visually recognising a pattern. It would also be helpful if the data was only 8 bit. You wouldn't have the palette, but you could see the image.

As you can see, there are lots of potential pitfalls and things that may thwart your efforts.
Good luck!


这篇关于将LPBYTE变量视为图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆