Thread: reply to crack code

  1. #1
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    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.

  2. #2
    Pursuing knowledge confuted's Avatar
    Join Date
    Jun 2002
    Posts
    1,916
    what? Are you doing something illegal, or just not making sense?

    Read the board rules.
    Away.

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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];

  4. #4
    Magically delicious LuckY's Avatar
    Join Date
    Oct 2001
    Posts
    856
    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.

  5. #5
    Registered User major_small's Avatar
    Join Date
    May 2003
    Posts
    2,787
    so what is crack code and chain code?

    is chain code a linked list?
    Join is in our Unofficial Cprog IRC channel
    Server: irc.phoenixradio.org
    Channel: #Tech


    Team Cprog Folding@Home: Team #43476
    Download it Here
    Detailed Stats Here
    More Detailed Stats
    52 Members so far, are YOU a member?
    Current team score: 1223226 (ranked 374 of 45152)

    The CBoard team is doing better than 99.16% of the other teams
    Top 5 Members: Xterria(518175), pianorain(118517), Bennet(64957), JaWiB(55610), alphaoide(44374)

    Last Updated on: Wed, 30 Aug, 2006 @ 2:30 PM EDT

  6. #6
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    As much as I like Lucky's reply......closed for obvious reasons

  7. #7
    Registered User
    Join Date
    Nov 2003
    Posts
    6

    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.

  8. #8
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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.

  9. #9
    &TH of undefined behavior Fordy's Avatar
    Join Date
    Aug 2001
    Posts
    5,793
    Thread reopened as it now seems this is not about cracking!

  10. #10
    Registered User
    Join Date
    Nov 2003
    Posts
    6
    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.

  11. #11
    train spotter
    Join Date
    Aug 2001
    Location
    near a computer
    Posts
    3,868
    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)
    "Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
    Friedrich Nietzsche

    "I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
    George Best

    "If you are going through hell....keep going."
    Winston Churchill

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  2. Replies: 1
    Last Post: 03-21-2006, 07:52 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM