声振论坛

 找回密码
 我要加入

QQ登录

只需一步,快速开始

查看: 1136|回复: 6

[综合讨论] matlab web server应用遇到的问题,虚心求教!

[复制链接]
发表于 2007-4-24 17:25 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?我要加入

x
本人利用matlab web server编写了一个远程图像处理的系统,具体是这样的:客户机发送图片给服务器,服务器对图片进行去噪、边缘检测等操作,最后把结果返回到客户机。但遇到了一个难题,客户机并不是什么图片都能传得过去,只有C盘下windows自带的一些示例图片才能应用,否则在客户端浏览器上会出现提示:matlab application error:imread('图片路径\图片名.jpg')does not exit.我尝试把能够处理的那几幅示例图片转移到其它文件夹,结果是不能处理,出现同样错误。
    输入HTML文件重点如下:
<form action="/cgi-bin/matweb.exe" method="get"  target="outputwindow">
<input type="hidden" name="mlmfile" value="test2">     %test2为要调用的M文件
<input type="file" name="pic" >                                    %pic为输入图片的变量名
   

    M文件为:
function result=test2(Input)
cd(Input.mldir);
image=imread(Input.pic);
if (isfield(Input,'method'))   %判断是否为构架域
   meth = getfield(Input,'method');%getfield 获知构架数组的域
   if strcmp(meth, 'jiaoyan');
     I=imnoise(image,'salt & pepper');
   end
   if strcmp(meth, 'gaussian');
     I=imnoise(image,'gaussian',0,0.05);
   end
   if strcmp(meth, 'junheng');  
     I=histeq(image);
   end
s.OutFile=sprintf('%spic.jpg',Input.mlid);
s.outstruct=sprintf('%simage.jpg',Input.mlid);
imwrite(I,s.OutFile,'jpg');
imwrite(image,s.outstruct,'jpg');
result=htmlrep(s,'out1.html');

请高手赐教,是不是image=imread(Input.pic);这句出了问题?还是其它?令我非常不解的是为什么windows自带的示例图片能够成功。谢谢!
回复
分享到:

使用道具 举报

发表于 2007-4-24 18:18 | 显示全部楼层
原帖由 sinotalent 于 2007-4-24 17:25 发表
本人利用matlab web server编写了一个远程图像处理的系统,具体是这样的:客户机发送图片给服务器,服务器对图片进行去噪、边缘检测等操作,最后把结果返回到客户机。但遇到了一个难题,客户机并不是什么图片都 ...



把图片的完整路径传过去试试
 楼主| 发表于 2007-4-24 18:43 | 显示全部楼层
请问怎样把完整路径传过去?我是使用image=imread(Input.pic)来读入图片的。谢谢
发表于 2007-4-24 18:50 | 显示全部楼层
原帖由 sinotalent 于 2007-4-24 18:43 发表
请问怎样把完整路径传过去?我是使用image=imread(Input.pic)来读入图片的。谢谢



自己测试一下你读取不到的图片的Input.pic值
 楼主| 发表于 2007-4-24 18:56 | 显示全部楼层

回复 #4 eight 的帖子

我的Q是271395660
能详细聊一下吗?谢谢
 楼主| 发表于 2007-4-26 09:17 | 显示全部楼层
没有人肯出手帮助?
发表于 2007-4-26 21:11 | 显示全部楼层
会不会是你的图片太大了啊??
您需要登录后才可以回帖 登录 | 我要加入

本版积分规则

QQ|小黑屋|Archiver|手机版|联系我们|声振论坛

GMT+8, 2024-9-24 15:28 , Processed in 0.054952 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表