http://www.cc.gatech.edu/classes/AY2000/cs7495_fall/participants/sashag/ps3/getchaincode.m
offset = N/2; %offset between ajacent pixels
I don't understand what the above mean?
http://www.cc.gatech.edu/classes/AY2000/cs7495_fall/participants/sashag/ps3/getchaincode.m
offset = N/2; %offset between ajacent pixels
I don't understand what the above mean?
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!!