hessian_入门级运用

1.下载jar包

http://hessian.caucho.com/
2.配置web.xml

  <servlet>
    <servlet-name>HelloServlet</servlet-name>
    <!-- hession 提供的servlet -->
    <servlet-class>com.caucho.hessian.server.HessianServlet</servlet-class>
    <init-param>
    	<param-name>home-class</param-name>
    	<param-value>com.asarja.hessian.HelloImpl</param-value>
    </init-param>
    <init-param>
    	<param-name>home-api</param-name>
    	<param-value>com.asarja.hessian.IHello</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>HelloServlet</servlet-name>
    <url-pattern>/helloServlet</url-pattern>
  </servlet-mapping>

3.创建接口和实现类,服务器端和客户端使用相同的接口

public interface IHello {
    String sayHello();
}

public class HelloImpl implements IHello{

    public String sayHello() {
        return "hello hession!";
    }

}

4.测试

public class Test {
    public static void main(String[] args) throws HessianProtocolException {
        String url = "http://127.0.0.1:8080/hessian/helloServlet";
        HessianProxyFactory hessianProxyFactory = new HessianProxyFactory();
        try {
            IHello iHello;
            iHello = (IHello)hessianProxyFactory.create(IHello.class,url);
            System.out.println("result="+iHello.sayHello());
        } catch (MalformedURLException e){
            e.printStackTrace();
        } catch (HessianRuntimeException e){
            e.printStackTrace();
        }
    }
}

使用hessian,客户端远程调用服务器端

Python的hessian_matrix函数是在scikit-image库中的skimage.feature.corner模块中实现的。该函数用于计算给定图像的Hessian矩阵。 在计算Hessian矩阵时,hessian_matrix函数主要经历了以下三个步骤: 1. 调用scipy.ndimage.gaussian_filter函数对输入图像进行高斯滤波。在这一步中,可以通过调整参数sigma、mode和cval来控制高斯滤波的效果。 2. 使用numpy.gradient函数计算经过高斯滤波后图像的一阶梯度。这一步返回的结果是图像的Iy和Ix。 3. 对第二步得到的梯度图像Iy和Ix再次计算梯度,即求二阶梯度。函数中的order参数决定了二阶梯度的顺序。 下面是一个使用hessian_matrix函数的例子: ```python import numpy as np from skimage.feature import hessian_matrix square = np.zeros([5,5]) square = 4 Hxx, Hxy, Hyy = hessian_matrix(square, 0.1, order='rc') fy, fx = np.gradient(square) fyy, fyx = np.gradient(fy) fxy, fxx = np.gradient(fx) ``` 值得注意的是,除了scikit-image库之外,还有其他库也提供了计算Hessian矩阵的函数,比如numdifftools和AlgoPy。但在此问题中,我们只关注scikit-image库中的hessian_matrix函数。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* [skimage.feature.hessian_matrix源码分析](https://blog.csdn.net/weixin_42694889/article/details/116978554)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] - *3* [中心差分法的MATLAB代码-numdifftools:解决一个或多个变量的自动数值微分问题](https://download.csdn.net/download/weixin_38554193/18972082)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值