Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6015939
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:54:42+00:00 2026-05-23T02:54:42+00:00

Stasm (http://www.milbo.users.sonic.net/stasm/index.html) is a C++ library for finding features on image, applying the concept

  • 0

Stasm (http://www.milbo.users.sonic.net/stasm/index.html) is a C++ library for finding features on image, applying the concept of active shape models.

I am trying to use AsmSearchDll which is on stasm DLL (stasm_dll) like this on a C# project. In C++ the prototype is

void AsmSearchDll(
int *pnlandmarks, // out: number of landmarks, 0 if can't get landmarks
int landmarks[], // out: the landmarks, caller must allocate
const char image_name[], // in: used in internal error messages, if necessary
const char image_data[], // in: image data, 3 bytes per pixel if is_color
const int width, // in: the width of the image
const int height, // in: the height of the image
const int is_color, // in: 1 if RGB image, 0 if grayscale
const char conf_file0[], // in: 1st config filename, NULL for default
const char conf_file1[]); // in: 2nd config filename, NULL for default, "" for none

I am using this in C# with this

[DllImport(@"..\data\stasm_dll.dll")]
public static extern void AsmSearchDll(
        out int pnlandmarks, // out: number of landmarks, 0 if can't get landmarks
        out int[] landmarks, // out: the landmarks, caller must allocate
        [MarshalAs(UnmanagedType.LPStr)]string imagename, // in: used in internal error messages, if necessary
        byte[] imagedata, // in: image data, 3 bytes per pixel if is_color
        int width, // in: the width of the image
        int height, // in: the height of the image
        int is_color, // in: 1 if RGB image, 0 if grayscale
        [MarshalAs(UnmanagedType.LPStr)]string conf_file0, // in: 1st config filename, NULL for default
        [MarshalAs(UnmanagedType.LPStr)]string conf_file1 // in: 2nd config filename, NULL for default, "" for none
    );

The function starts to read the config files, but then it quits the program. I can’t figure out what is going on. Any suggestions?

Best regards

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T02:54:42+00:00Added an answer on May 23, 2026 at 2:54 am

    I tried to bind the same function to python unsuccessfully.

    You have first to allocate the landmarks array and an int, before passing pointer to the function.

    The function need a lot of configuration file in ../data/, be sure it is there.

    The imagename string should actually be the FILEPATH of the image. No kidding. It loads it and process it whatever. Btw, imagedata must point to allocated memory to…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The section Last links in the chain: Stashing and the reflog in http://ftp.newartisans.com/pub/git.from.bottom.up.pdf recommends
If I have a form that's on page http://foo.com/get , but posts to http://foo.com/post
I have used git update-index --assume-unchanged on some files to keep my changes to
I frequently use git stash and git stash pop to save and restore changes
I need a way to stash some data that is global to the browser.
I did a git stash pop and ended up with merge conflicts. I removed
I am experiencing strange behavior using git stash, I have two branches v0 and
I make a change and then I git stash and then I git stash
Is it possible to emulate the behavior of 'git stash' when using fossil/bzr? Basically
In git, I stash away my changes. Is it possible that I can create

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.