将图像作为参数传递 [英] passing images as arguments

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

问题描述

您好,我想传递少量图像作为参数,但是完成后,所有图像都具有相同的值.这是我的一些代码.请帮助我,谢谢.

Hello,I want to pass few images as arguments but when done,all the images get the same value.here is some of my codes.please help me,thanks in advance

Bitmap[] ima = new Bitmap[20];
           ima[0] = new Bitmap(Main_P.Image);
           ima[1] = gray(ima[0]);//Setting the picture trough gray scale
           ima[2] = noise(ima[1]);
           ima[3] = histogram(ima[2]);
           ima[4] = binary(ima[3]);
           ima[5] = reverse_binary(ima[4]);
           ima[6] = distance2(ima[5]);
           ima[7] = max2(ima[6]);
           ima[8] = extension_binary(ima[7]);
           ima[9] = complementary_0f_distance(ima[6]);
           ima[10] = apply_sign_image_to_basis_image(ima[9], ima[8], ima[5]);




          Main_P.Image =(Bitmap)ima[7];


在这里所有图像都具有相同的值!


here all the images get the same value!

推荐答案

您的问题可能不在于如何将图像作为参数传递,而是您要做的事情在将它们发送到的功能中使用它们.请记住,参数是作为引用发送的,因此您操作该参数的任何操作都会影响对它的所有引用.
It is likely that your issues aren''t in how you pass the images as arguments, but rather what you do with them in the functions you are sending them to. Remember that arguments are being sent as references so that anything you do to manipulate the argument will affect all references to it.


您正在调用的这些函数是否有可能正在修改通过参数以及返回参数.您可以发布一个代码吗?
Is it possible that these functions you are calling are modifying the value of the passed params as well as returning them. Could you post the code of one?


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

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