使用Turbo C从图像获取像素值 [英] Get the pixel value from an image using Turbo C

查看:154
本文介绍了使用Turbo C从图像获取像素值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个灰度图像.现在,我需要检索像素值并使用C代码写入文本文件.我需要这些值来压缩图像.以前,我将MATLAB用于该目的.但是目前我需要相同的C代码.

I have a grey scale image. Now I need to retrieve the pixel value and write in a text file using C code. I need those value for compressing the image. Previously I used MATLAB for that purpose. But presently I need C code for the same.

推荐答案

虽然可以将Turbo C用于此目的,但为什么不使用更新的版本呢?编译器?例如,Visual C++ Express Edition是免费提供的.

关于编程问题:一旦知道了图像文件的格式,编写一个函数以提取所需的信息就不应该是一项艰巨的任务.
:)
While it is possible using Turbo C for such a purpose, why don''t you use a more recent compiler? Visual C++ Express Edition is available for free, for instance.

As about the programming question: once you know the format of the image file, it shouldn''t be a daunting task writing a function to extract the required info.
:)


在Windows NT v4.0上,我有一个文本文件.
如果我尝试批量使用下一个代码:

设置zname = Tb.txt
FOR/F"delims ="(%zname%)中的%% i(
回声%% i
)

然后我可以在屏幕上看到文件的内容.
但是,如果文件名中包含空格,例如:

设置zname = T b.txt
FOR/F"delims =" %% i in(%zname%"))可以(
回声%% i
)

那么回显将仅在文件上显示文件名,例如:

T b.txt

而不是文件的内容.拿走"
例如:FOR/F"delims =" %% i in(%zname%)在执行(
我找回错误:
找不到文件T.
On Windows NT v4.0 I have a text-files.
If I try to use in a batch the next code:

set zname=Tb.txt
FOR /F "delims=" %%i in (%zname%) do (
echo %%i
)

Then I can see on the screen the content of the file.
But if the name of the file has spaces, like :

set zname=T b.txt
FOR /F "delims=" %%i in ("%zname%") do (
echo %%i
)

then the echo will print on the screen only the name of the file, like:

T b.txt

instead of the content of the file. By taking away the ""
example: FOR /F "delims=" %%i in (%zname%) do (
I getting back the error:
Cannot find the file T.


这篇关于使用Turbo C从图像获取像素值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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