谁知道halcon中,像HByteImage、HRGBImage等类,谁知道它们的说明文档在哪里?

在例程中有看到使用,但在已有的说明文档里却找不到它们的说明,所以都不知道具体的用法,以致于例程里很多地方用到这些类时,有些能推测大概的作用,有的则完全不懂。比如HByte... 在例程中有看到使用,但在已有的说明文档里却找不到它们的说明,所以都不知道具体的用法,以致于例程里很多地方用到这些类时,有些能推测大概的作用,有的则完全不懂。比如HByteImage,在它的声明文件HByteImage.h里,构造函数有N个,拿2个出来:HByteImage(const char *file);HByteImage(int width, int height);前面一个能明白,后面一个不知所云,我发现像这些文档中找不到说明的类还有很多,它们的说明文档在哪里? 展开
 我来答
玲玲是美女
2011-12-12
知道答主
回答量:9
采纳率:0%
帮助的人:4.3万
展开全部
The class HImage is the root class for all derived image classes. By using the class HImage all different pixel types can be handled in a unique way (polymorphism). The class HImage is not virtual, thus it can be instantiated. Besides those operators that can be called via HRegion (see also section “Calling Operators via Classes”), HRegion provides the following member functions:
HImage(void)
Default constructor, empty image.
HImage(const char *file)
Constructing an image by reading from a file, see reference manual entry of read_image.
HImage(int width, int height, const char *type)
Constructing an image of a defined size and a specific pixel type, see reference manual entry of gen_image_const.
HImage(void *ptr, int width, int height, const char *type)
Constructing an image of a defined size and a specific pixel type by copying memory, see reference manual entry of gen_image1.
HImage(const HImage &image)
Copy constructor.
virtual ~HImage(void)
Destructor.
HImage &operator = (const HImage &arr)
Assignment operator.
virtual const char *PixType(void) const
Return the pixel type of the image, see reference manual entry of get_image_type.
int Width(void) const
Return the width of the image, see reference manual entry of get_image_size.
int Height(void) const
Return the height of the image, see reference manual entry of get_image_size.
HPixVal GetPixVal(int x, int y) const
Access a pixel value via the (x, y) coordinates, see reference manual entry of get_grayval.
HPixVal GetPixVal(long k) const
Linear access of a pixel value.
virtual void SetPixVal(int x, int y, const HPixVal &val)
Set the pixel value via the (x, y) coordinates, see reference manual entry of set_grayval.
virtual void SetPixVal(long k, const HPixVal &val)
Set the pixel value by linear access.
virtual void Display(const HWindow &w) const
Display an image in a window.
HImage operator & (const HRegion ®) const
Reduce the domain of an image, see reference manual entry of reduce_domain.
HImage operator + (const HImage &add) const
Adding two images, see reference manual entry of add_image.
HImage operator - (const HImage &sub) const
Subtracting two images, see reference manual entry of sub_image.
HImage operator * (const HImage &mult) const
Multiplication of two images, see reference manual entry of mult_image.
HImage operator - (void) const
Inverting the values of the image, see reference manual entry of invert_image.
HImage operator + (double add) const
HImage operator - (double sub) const
HImage operator * (double mult) const
HImage operator / (double div) const
Arithmetic operators, see reference manual entry of scale_image.
HRegion operator >= (const HImage &image) const
HRegion operator <= (const HImage &image) const
Selecting all pixel with gray values brighter than or equal to (or darker than or equal to, respectively) those of the input image, see reference manual entry of dyn_threshold.
HRegion operator >= (double thresh) const
HRegion operator <= (double thresh) const
HRegion operator == (double thresh) const
HRegion operator != (double thresh) const
Selecting all pixel with gray values brighter than or equal to (or darker than or equal to, or equal to, or not equal to, respectively) a threshold, see reference manual entry of threshold.
Figure 6.5 gives an example of the use of the class HImage.
#include "HalconCpp.h"
using namespace Halcon;
#include "HIOStream.h"
#if !defined(USE_IOSTREAM_H)
using namespace std;
#endif

main ()
{
HImage image("mreut"); // Aerial image
HWindow w; // Output window
image.Display(w); // Display image
// Returning the size of the image
cout << "width = " << image.Width();
cout << "height = " << image.Height() << endl;
// Interactive drawing of a region by using the mouse
HRegion mask = w.DrawRegion();
// Reduce the domain of the image to the mask
HImage reduced = image & mask;
w.ClearWindow(); // Clear the window
reduced.Display(w); // Display the reduced image
// Applying the mean filter in the reduced image
HImage mean = reduced.MeanImage(61,61);
mean.Display(w);
HRegion reg = bild >= (mean + 3);
reg.Display(w);
}
更多追问追答
追问
我要的是HByteImage类及其成员的说明,不是HImage,虽然HbyteImage是从HImage继承而来,但HByteImage也增加了一些自己的函数,因为没有说明,所以我不知道怎么用。
追答
For each pixel type, there exists a corresponding image class derived from HImage, e.g., HByteImage for the pixel type byte (standard 8 bit pixels) or HInt2Image for the pixel type int2 (unsigned 16 bit pixels). The most important derived class is naturally HByteImage, as this pixel type still covers the majority of all applications in the field of image processing. The advantage of the class HByteImage in comparison to the class HImage is the simplified access to the pixel values. This is because the class HPixVal is not necessary. Besides the member functions of HImage, the class HByteImage contains the following extensions: 
HByteImage(void)Default constructor. HByteImage(const char *file)Constructing a byte image by reading a file. HByteImage(int width, int height)Constructing an empty byte image of a given size. HByteImage(HByte *ptr, int width, int height)Constructing a byte image by copying memory. HByteImage(const HByteImage &image)Copy constructor. virtual ~HByteImage(void)Destructor. HByte &operator[] (long k)Setting a pixel value by linear accessing. HByte operator[] (long k) constReading a pixel value by linear accessing. HByte &operator() (long k)Setting a pixel value by linear accessing. HByte operator() (long k) constReading a pixel value by linear accessing. HByte &operator()(int x, int y) Setting a pixel value by accessing it via (x, y) coordinates. HByte operator()(int x, int y) constReading a pixel value by accessing it via (x, y) coordinates. HByteImage operator & (int i)Applying the logical “and”-operation on each pixel with i. HByteImage operator > (int i)Applying a right-shift on each pixel with i. HByteImage operator ~ (void)Complement of each pixel. HByteImage operator & (HByteImage &ima)Pixel by pixel logical “and”-operation of two images. The advantage of the class HByteImage can be seen when accessing each pixel,
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式