Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Compiling in Windows #18

Open
mingledj2 opened this issue Aug 31, 2015 · 8 comments
Open

Compiling in Windows #18

mingledj2 opened this issue Aug 31, 2015 · 8 comments

Comments

@mingledj2
Copy link

I've spent a few days trying to get this to compile in Windows. I figured I would ask if anyone has had any success compiling this for use in a Windows Desktop application?

@josharian
Copy link
Member

I don't know of anyone, but I would be interested to hear of people's experiences.

What are the build failures you are experiencing? I don't have any windows experience, but maybe I could provide some hints or guesses.

@mingledj2
Copy link
Author

There have been a few things (such as likely/unlikely) that I've had to work around due to them not existing in Windows. Currently I'm dealing with about 30 linker errors that seem to stem from opencv. I've been working towards trying to figure out those issues.

@josharian
Copy link
Member

Cool. Feel free to ask for help (with details) if you so desire.

@mingledj2
Copy link
Author

Update: I have it compiling in Windows. Still running across some issues actually getting a card to scan. I grabbed one of the sample images and have had issues getting it to work. Perhaps you guys can help, my code is as follows (modeled after some of the JNI code from the Android Card.IO source):

int main(int argc, char** argv)
{
dmz_context* context = dmz_context_create();
scanner_initialize(&scannerState);

int ret = dmz_has_opencv();
if (ret == 1)
{
IplImage* iplImage = cvLoadImage(argv[1], 1);

  IplImage *image = cvCreateImageHeader(cvSize(iplImage->width, iplImage->height), IPL_DEPTH_8U, 1);
  image->imageData = iplImage->imageData;

  IplImage *cbcr = cvCreateImageHeader(cvSize(iplImage->width / 2, iplImage->height / 2), IPL_DEPTH_8U, 2);
  cbcr->imageData = iplImage->imageData + iplImage->width * iplImage->height;

  IplImage *cb, *cr;
  dmz_deinterleave_uint8_c2(cbcr, &cb, &cr);
  cvReleaseImageHeader(&cbcr);

  dmz_edges found_edges;
  dmz_corner_points corner_points;
  bool cardDetected = dmz_detect_edges(image, cb, cr, FrameOrientationPortrait, &found_edges, &corner_points);

  if (cardDetected)
  {
     IplImage *cardY = NULL;
     dmz_transform_card(NULL, image, corner_points, FrameOrientationLandscapeRight, false, &cardY);

     FrameScanResult result;
     scanner_add_frame(&scannerState, cardY, &result);

     if (result.usable)
     {
        ScannerResult scanResult;
        scanner_result(&scannerState, &scanResult);
     }
  }

}

In this case, cardDetected is always false regardless of the FrameOrientation (I've tried them all).

Thanks for any advice in advance.

@josharian
Copy link
Member

card.io requires a stream of images of the same card. This provides extra confidence (see https://www.youtube.com/watch?v=T9TkkZg1L7s). As a short term hack experiment, try providing the same image frame repeatedly. Note that not all frames will work; you might have to try several to find a readable one (which is part of the reason we require a stream of images).

@mingledj2
Copy link
Author

I'm actually sending it frames from a live stream now. None of them ever come back as usable though. I'm looking through some of the JNI/Java Wrapper to see if there's any special processing that needs to be done.

@ryanburdettkofax
Copy link

mingledj2,

I've been tasked with doing the same. Would you mind sharing some of the details of your experience getting it compiling? What toolset did you use? Code changes necessary?

@moneer88
Copy link

Hi Everyone

I would like ask the same question if there is any possibility to build cardio on windows

Best Regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants