需要帮助理解这个MATLAB函数的实现函数、MATLAB

2023-09-11 07:18:28 作者:血雨梨花

看着本文 ...

 偏移量= N / 2; ajacent像素%之间的偏移
 

我不明白上面的意思吗?

解决方案

链 - code

  

A 链code 是一种无损COM pression   算法单色图像。该   链codeS的基本原理是   单独连接code分别连接   组件或印迹的形象。

     

有关每个这样的区域,的的边界上的点被选择并且其   坐标传送。

     

的EN codeR然后沿图像的边界移动,并在每个   步,再发射presenting的象征   此运动的方向。本   一直持续到EN codeR返回   起始位置,在该点   印迹已经完全   描述的,和编码继续与   图像中的下一个印迹

假设黑色正白(二进制)图像阵列,U试图形成图像的链 - code。

matlab如何查询函数帮助文档,帮助你了解函数

现在U可以检测的地区的的印迹,通过检查相邻像素为相同的值作为当前像素。这两种类型的邻接规则是4的连接和8的连接。

MOD函数

  code(计数)= MOD(索引+偏移,N);
 

返回在印迹的下一个象素的方向(或位移)(相对于当前像素)。

因此, N / 2 即偏移是 2 或 4 根据< STRONG>相邻ü要征收。的

好运!!

Looking at this article ...

offset = N/2;       %offset between ajacent pixels

I don't understand what the above means?

解决方案

Chain-code

A chain code is a lossless compression algorithm for monochrome images. The basic principle of chain codes is to separately encode each connected component, or "blot", in the image.

For each such region, a point on the boundary is selected and its coordinates are transmitted.

The encoder then moves along the boundary of the image and, at each step, transmits a symbol representing the direction of this movement. This continues until the encoder returns to the starting position, at which point the blot has been completely described, and encoding continues with the next blot in the image.

Assuming the Black-n-White (binary) Image-array, U are trying to form the chain-code of the image.

Now U can detect the the area of a "BLOT" by checking adjacent pixels for the same value as the current pixel. The two types of adjacency rules are 4 connectivity and 8 connectivity.

The mod function

code(count) = mod( index + offset, N);

returns the "direction" (or displacement) of the next pixel in the blot (relative to the current-pixel).

Hence the N/2 i.e. offset is either 2 or 4 depending on the adjacency U want to impose.

GoodLUCK!!