-
crack code
i'm having a problem with crack code representing the contour of 2 dimension shape.It is a small part of the normally used chain code.I would like to have a basic idea on how to start crack code programme using C++ Builder.Your ideas are highly appreciated.
-
what? Are you doing something illegal, or just not making sense?
Read the board rules.
-
Crack code? Chain code?
What are you talking about.
A 2 dimensional shape is normally represented like this:
Code:
struct point2D
{
double x;
double y; // could be ints as well
//template would be best for this
};
point2D Shape[numpoints];
-
Crack code? That's simple, but there are two versions. I've also included some simple chain code:
Code:
class CrackA {
Pipe _glass;
Torch _torch;
Rock _rock;
public:
void light();
void smoke();
bool isAddicted() const;
void buyRock();
};
class CrackB {
Tissue _toiletPaper;
bool _isClean;
bool _hasRash;
public:
void wipe();
bool smellsGood() const;
};
struct Chain {
Link *links;
int numLinks;
};
Those are some simple definitions. I leave it up to you to write the implementations.
-
so what is crack code and chain code?
is chain code a linked list?
-
As much as I like Lucky's reply......closed for obvious reasons
-
reply to crack code
Excuse me.As far as i am concerned,i'm not doing something that is illegal.Below are a few descriptions on chain code and crack code that i've read from a legal website.Chain code and crack code are parts of contour representations.
Chain code
We follow the contour in a clockwise manner and keep track of the directions as we go from one contour pixel to the next. For the standard implementation of the chain code we consider a contour pixel to be an object pixel that has a background (non-object) pixel as one or more of its 4-connected neighbors
Crack code
An alternative to the chain code for contour encoding is to use neither the contour pixels associated with the object nor the contour pixels associated with background but rather the line, the "crack", in between. The "crack" code can be viewed as a chain code with four possible directions instead of eight.
Sorry fo the misunderstanding.
-
I normally don't respond to posts that were closed in another thread and its not good practice to post topics that have been closed....but in this instance I understand.
You seem to be talking about grabbing a contour from a bitmap. This can be done much easier than that.
But it also sounds like you might be talking about flood filling.
Please explain more.
-
Thread reopened as it now seems this is not about cracking!
-
sorry for the inconveniences.thanks bubba.yup,actually i'm thinking of extracting features which are coordinates from 2D shapes(bitmap).I'm using chain code to extract the coordinates which is the contour of the shape.It will be the outer coordinates surrounding the shape that i am interested in.I would like to have the basic idea on how to start it in C++ Builder.Thank u.
-
Are you talking about edge detection?
Try creating a histogram of the image.
that is an array of the differences in the pixcel colour (or intensity). I use 256 grey scale images 0 = black, 255 = white.
Edges can be detected as peaks and troughs (rapid changes in the histogram)