Search Results

Search found 38 results on 2 pages for 'typoknig'.

Page 1/2 | 1 2  | Next Page >

  • XAMPP vs WAMP security and other on Windows XP

    - by typoknig
    Not long ago I found WAMP and thought it was a God send because it had all the things I wanted/needed (Apache, PHP, MySQL, and phpMyAdmin) all built into one installer. One thing about WAMP has been making me mad is an error I get in phpMyAdmin about the advanced features not working. I have tried to fix that error long enough on that error for long enough. http://stackoverflow.com/questions/2688385/problem-with-phpmyadmin-advanced-features I now read that most people prefer XAMPP over WAMP, but I am a bit concerned that XAMPP might have some extra security holes with Mercury and Perl, two thing that I don't really need or want right now. Are my security concerns justified or not? Is there any other reasons to go with XAMPP over WAMP or vice versa?

    Read the article

  • Cannot change the device folder where WMP 12 syncs to...

    - by typoknig
    I just got a new phone (HD2) and I am trying to sync some music from WMP 12. When I first plugged it in I went to Set up sync in WMP and changed the sync path on the device to N:\Music. It worked fine, but now I changed my mind and I want my music to sync to N:\My Documents\My Music, the only problem is that now when I go to Set up sync I do not get the option to change the device sync path. What is the deal here and how to I get this to work how I want?

    Read the article

  • Software that will extract the individual audio channels from a WMA file

    - by typoknig
    I have a 6 channel WMA file and I would like to extract each of those 6 channels into its own mono WAV file. This is a simple task with AC-3 audio files, but apparently not with WMA. I could re-encode the WMA as an AC-3 then extract the streams, but I want lossless solution. Please only confirmed solutions. I have put a lot of time into searching for a solution and have had my fill of "try this" and "this might work".

    Read the article

  • Compare images after canny edge detection in OpenCV (C++)

    - by typoknig
    Hi all, I am working on an OpenCV project and I need to compare some images after canny has been applied to both of them. Before the canny was applied I had the gray scale images populating a histogram and then I compared the histograms, but when canny is added to the images the histogram does not populate. I have read that a canny image can populate a histogram, but have not found a way to make it happen. I do not necessairly need to keep using the histograms, I just want to know the best way to compare two canny images. SSCCE below for you to chew on. I have poached and patched about 75% of this code from books and various sites on the internet, so props to those guys... // SLC (Histogram).cpp : Defines the entry point for the console application. #include "stdafx.h" #include <cxcore.h> #include <cv.h> #include <cvaux.h> #include <highgui.h> #include <stdio.h> #include <sstream> #include <iostream> using namespace std; IplImage* image1= 0; IplImage* imgHistogram1 = 0; IplImage* gray1= 0; CvHistogram* hist1; int main(){ CvCapture* capture = cvCaptureFromCAM(0); if(!cvQueryFrame(capture)){ cout<<"Video capture failed, please check the camera."<<endl; } else{ cout<<"Video camera capture successful!"<<endl; }; CvSize sz = cvGetSize(cvQueryFrame(capture)); IplImage* image = cvCreateImage(sz, 8, 3); IplImage* imgHistogram = 0; IplImage* gray = 0; CvHistogram* hist; cvNamedWindow("Image Source",1); cvNamedWindow("gray", 1); cvNamedWindow("Histogram",1); cvNamedWindow("BG", 1); cvNamedWindow("FG", 1); cvNamedWindow("Canny",1); cvNamedWindow("Canny1", 1); image1 = cvLoadImage("image bin/use this image.jpg");// an image has to load here or the program will not run //size of the histogram -1D histogram int bins1 = 256; int hsize1[] = {bins1}; //max and min value of the histogram float max_value1 = 0, min_value1 = 0; //value and normalized value float value1; int normalized1; //ranges - grayscale 0 to 256 float xranges1[] = { 0, 256 }; float* ranges1[] = { xranges1 }; //create an 8 bit single channel image to hold a //grayscale version of the original picture gray1 = cvCreateImage( cvGetSize(image1), 8, 1 ); cvCvtColor( image1, gray1, CV_BGR2GRAY ); IplImage* canny1 = cvCreateImage(cvGetSize(gray1), 8, 1 ); cvCanny( gray1, canny1, 55, 175, 3 ); //Create 3 windows to show the results cvNamedWindow("original1",1); cvNamedWindow("gray1",1); cvNamedWindow("histogram1",1); //planes to obtain the histogram, in this case just one IplImage* planes1[] = { canny1 }; //get the histogram and some info about it hist1 = cvCreateHist( 1, hsize1, CV_HIST_ARRAY, ranges1,1); cvCalcHist( planes1, hist1, 0, NULL); cvGetMinMaxHistValue( hist1, &min_value1, &max_value1); printf("min: %f, max: %f\n", min_value1, max_value1); //create an 8 bits single channel image to hold the histogram //paint it white imgHistogram1 = cvCreateImage(cvSize(bins1, 50),8,1); cvRectangle(imgHistogram1, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //draw the histogram :P for(int i=0; i < bins1; i++){ value1 = cvQueryHistValue_1D( hist1, i); normalized1 = cvRound(value1*50/max_value1); cvLine(imgHistogram1,cvPoint(i,50), cvPoint(i,50-normalized1), CV_RGB(0,0,0)); } //show the image results cvShowImage( "original1", image1 ); cvShowImage( "gray1", gray1 ); cvShowImage( "histogram1", imgHistogram1 ); cvShowImage( "Canny1", canny1); CvBGStatModel* bg_model = cvCreateFGDStatModel( image ); for(;;){ image = cvQueryFrame(capture); cvUpdateBGStatModel( image, bg_model ); //Size of the histogram -1D histogram int bins = 256; int hsize[] = {bins}; //Max and min value of the histogram float max_value = 0, min_value = 0; //Value and normalized value float value; int normalized; //Ranges - grayscale 0 to 256 float xranges[] = {0, 256}; float* ranges[] = {xranges}; //Create an 8 bit single channel image to hold a grayscale version of the original picture gray = cvCreateImage(cvGetSize(image), 8, 1); cvCvtColor(image, gray, CV_BGR2GRAY); IplImage* canny = cvCreateImage(cvGetSize(gray), 8, 1 ); cvCanny( gray, canny, 55, 175, 3 );//55, 175, 3 with direct light //Planes to obtain the histogram, in this case just one IplImage* planes[] = {canny}; //Get the histogram and some info about it hist = cvCreateHist(1, hsize, CV_HIST_ARRAY, ranges,1); cvCalcHist(planes, hist, 0, NULL); cvGetMinMaxHistValue(hist, &min_value, &max_value); //printf("Minimum Histogram Value: %f, Maximum Histogram Value: %f\n", min_value, max_value); //Create an 8 bits single channel image to hold the histogram and paint it white imgHistogram = cvCreateImage(cvSize(bins, 50),8,3); cvRectangle(imgHistogram, cvPoint(0,0), cvPoint(256,50), CV_RGB(255,255,255),-1); //Draw the histogram for(int i=0; i < bins; i++){ value = cvQueryHistValue_1D(hist, i); normalized = cvRound(value*50/max_value); cvLine(imgHistogram,cvPoint(i,50), cvPoint(i,50-normalized), CV_RGB(0,0,0)); } double correlation = cvCompareHist (hist1, hist, CV_COMP_CORREL); double chisquare = cvCompareHist (hist1, hist, CV_COMP_CHISQR); double intersection = cvCompareHist (hist1, hist, CV_COMP_INTERSECT); double bhattacharyya = cvCompareHist (hist1, hist, CV_COMP_BHATTACHARYYA); double difference = (1 - correlation) + chisquare + (1 - intersection) + bhattacharyya; printf("correlation: %f\n", correlation); printf("chi-square: %f\n", chisquare); printf("intersection: %f\n", intersection); printf("bhattacharyya: %f\n", bhattacharyya); printf("difference: %f\n", difference); cvShowImage("Image Source", image); cvShowImage("gray", gray); cvShowImage("Histogram", imgHistogram); cvShowImage( "Canny", canny); cvShowImage("BG", bg_model->background); cvShowImage("FG", bg_model->foreground); //Page 19 paragraph 3 of "Learning OpenCV" tells us why we DO NOT use "cvReleaseImage(&image)" in this section cvReleaseImage(&imgHistogram); cvReleaseImage(&gray); cvReleaseHist(&hist); cvReleaseImage(&canny); char c = cvWaitKey(10); //if ASCII key 27 (esc) is pressed then loop breaks if(c==27) break; } cvReleaseBGStatModel( &bg_model ); cvReleaseImage(&image); cvReleaseCapture(&capture); cvDestroyAllWindows(); }

    Read the article

  • Creating line graph/chart in vb.net (VS2008)

    - by typoknig
    I am reluctant to ask this question because a lot of similar questions have been asked, but after reading through them I am not getting the info I need. I am trying to follow this tutorial and I think it is going to work ok, but I have a lot of data to put in and the tutorial has the reader create the chart data points manually. I want the data points to be generated from an integer which can change while the program is running (thus the chart size needs to change) and the y coordinate of the data points needs to come from an array. I have attempted to "bind" the data but I am messing it up somehow and I don't even think that is the best way to do what I want. Also, I do not have to use the methods suggested in the tutorial, I am looking for the highest quality most efficient way to generate a line graph in vb.net (VS2008) based on the criteria I previously mentioned.

    Read the article

  • Joystick input in Java

    - by typoknig
    Hi all, I am making a 2D game in Java and I want to use a joystick to control the movement of some crosshairs. Right now I have it so the mouse can control those crosshairs. My only criteria for this is that the control for the crosshair must stay in the game window unless a user clicks off into another window. Basically I want my game to capture whatever device is controlling the crosshairs much like a virtual machine captures a mouse. The joystick I am using (Thrustmaster Hotas Cougar) comes with some pretty advanced features, so that may make this easier (or harder). I have tried the solution listed on this page, but I am using a 64bit computer and for some reason it does not like that. I have also tried to use the key emulation feature of my joystick, but with little success. Here is what I have so far, any pointer would be appreciated. Main Class: import java.awt.Color; import java.awt.Cursor; import java.awt.event.MouseEvent; import java.awt.event.MouseMotionListener; import java.awt.Graphics; import java.awt.Image; import java.awt.image.BufferStrategy; import java.awt.image.MemoryImageSource; import java.awt.Point; import java.awt.Toolkit; import javax.swing.JFrame; public class Game extends JFrame implements MouseMotionListener{ private int windowWidth = 1280; private int windowHeight = 1024; private Crosshair crosshair; public static void main(String[] args) { new Game(); } public Game() { this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); this.setSize(windowWidth, windowHeight); this.setResizable(false); this.setLocation(0,0); this.setVisible(true); this.createBufferStrategy(2); addMouseMotionListener(this); initGame(); while(true) { long start = System.currentTimeMillis(); gameLoop(); while(System.currentTimeMillis()-start < 5) { //empty while loop } } } private void initGame() { hideCursor(); crosshair = new Crosshair (windowWidth/2, windowHeight/2); } private void gameLoop() { //game logic drawFrame(); } private void drawFrame() { BufferStrategy bf = this.getBufferStrategy(); Graphics g = (Graphics)bf.getDrawGraphics(); try { g = bf.getDrawGraphics(); Color darkBlue = new Color(0x010040); g.setColor(darkBlue); g.fillRect(0, 0, windowWidth, windowHeight); drawCrossHair(g); } finally { g.dispose(); } bf.show(); Toolkit.getDefaultToolkit().sync(); } private void drawCrossHair(Graphics g){ Color yellow = new Color (0xEDFF62); g.setColor(yellow); g.drawOval(crosshair.x, crosshair.y, 40, 40); g.fillArc(crosshair.x + 10, crosshair.y + 21 , 20, 20, -45, -90); g.fillArc(crosshair.x - 1, crosshair.y + 10, 20, 20, -135, -90); g.fillArc(crosshair.x + 10, crosshair.y - 1, 20, 20, -225, -90); g.fillArc(crosshair.x + 21, crosshair.y + 10, 20, 20, -315, -90); } @Override public void mouseDragged(MouseEvent e) { //empty method } @Override public void mouseMoved(MouseEvent e) { crosshair.x = e.getX(); crosshair.y = e.getY(); } private void hideCursor() { int[] pixels = new int[16 * 16]; Image image = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(16, 16, pixels, 0, 16)); Cursor transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0, 0), "invisiblecursor"); getContentPane().setCursor(transparentCursor); } } Another Class: public class Crosshair{ public int x; public int y; public Crosshair(int x, int y) { this.x = x; this.y = y; } }

    Read the article

  • The relationship between OPC and DCOM

    - by typoknig
    Hi all, I am trying to grasp the link between OPC and DCOM. I have watched all four of the tutorials here and I think I have a good feeling for what OPC is, but in one of the tutorials (the third one 35 seconds in) the narrator states that OPC is based on DCOM, but I do not understand how the two are really linked. My confusion comes from a question my professor posed in which he asked "How and where would you deploy OPC instead of DCOM and vice-versa." His question makes it seem like the two are not as linked as my research suggests. I'm not looking for anyone to answer the question, I just want to know the relation between OPC and DCOM, then I can figure the rest out. Specifically I would like to know if: 1.) One is always based on the other 2.) One can always be deployed without the other.

    Read the article

  • Drop Down Box and other stuff in ASP.NET with VB.NET (VS 2008)

    - by typoknig
    Hi all, I am trying to polish up a program a program that I have converted from a Windows Form in to an ASP.NET Web Application. I have several questions: 1.) I have a drop down box where users can select their variables, but users can also enter their variables manually into various text fields. What I want is for the drop down box to show a string like "Choose Variables" when ever the user enters their variables manually. I want this to happen without having to reload the page. 2.) In the Windows Form version of this application I had a RichTextBox that populated with data (line by line) after a calculation was made. I used "AppendText" in my Windows Form, but that is not available in ASP.NET, and neither is the RichTextBox. I am open to suggestions here, I tried to use just a text box but that isn't working right. 3.) In my Windows Form application I was using "KeyPress" events to prevent incorrect characters from being entered into the text fields. My code for these events looked similar to this: Private Sub TextBox_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox.KeyPress If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> ControlChars.Back AndAlso e.KeyChar <> "." Then e.Handled = True End If End Sub How can I make this work again... also without reloading the page. 4.) This is not a major issue, but I would like all of the text to be selected when the cursor enters a field. In my Windows Form application I used "SelectAll", but again, that is not available in ASP.NET Thanks in advanced.

    Read the article

  • Capture (trap) the mouse cursor in a window in Java

    - by typoknig
    Hi all, I am looking for a way to capture or trap the mouse in a window after it has entered that window much like a mouse is trapped in a virtual machine window until a user presses CTRL+ALT+DEL or release the mouse in some other manner. How do I make this happen in Java? Going full screen is not an option.

    Read the article

  • Choosing a VS project type (C++)

    - by typoknig
    Hi all, I do not use C++ much (I try to stick to the easier stuff like Java and VB.NET), but the lately I have not had a choice. When I am picking a project type in VS for some C++ source I download, what project type should I pick? I had just been sticking with Win32 Console Applications, but I just downloaded some code (below) that will not work right even when it compiles with out errors. I have tried to use a CLR Console Application and an empty project too, and have changed many variables along the way, but I cannot get this code to work. I noticed that this code does not have "int main()" at its beginning, does that have something to do with it? Anyways, here is the code, got it from here: /* Demo of modified Lucas-Kanade optical flow algorithm. See the printf below */ #ifdef _CH_ #pragma package <opencv> #endif #ifndef _EiC #include "cv.h" #include "highgui.h" #include <stdio.h> #include <ctype.h> #endif #include <windows.h> #define FULL_IMAGE_AS_OUTPUT_FILE #define cvMirror cvFlip //IplImage *image = 0, *grey = 0, *prev_grey = 0, *pyramid = 0, *prev_pyramid = 0, *swap_temp; IplImage **buf = 0; IplImage *image1 = 0; IplImage *imageCopy=0; IplImage *image = 0; int win_size = 10; const int MAX_COUNT = 500; CvPoint2D32f* points[2] = {0,0}, *swap_points; char* status = 0; //int count = 0; //int need_to_init = 0; //int night_mode = 0; int flags = 0; //int add_remove_pt = 0; bool bLButtonDown = false; //bool bstopLoop = false; CvPoint pt, pt1,pt2; //IplImage* img1; FILE* FileDest; char* strImageDir = "E:\\Projects\\TSCreator\\Images"; char* strItemName = "b"; int imageCount=0; int bFirstFace = 1; // flag for first face int mode = 1; // Mode 1 - Haar Traing Sample Creation, 2 - HMM sample creation, Mode = 3 - Both Harr and HMM. //int startImgeNo = 1; bool isEqualRation = false; //Weidth to height ratio is equal //Selected Image data IplImage *selectedImage = 0; int selectedX = 0, selectedY = 0, currentImageNo = 0, selectedWidth = 0, selectedHeight= 0; CvRect selectedROI; void saveFroHarrTraining(IplImage *src, int x, int y, int width, int height, int imageCount); void saveForHMMTraining(IplImage *src, CvRect roi,int imageCount); // Code for draw ROI Cropping Image void on_mouse( int event, int x, int y, int flags, void* param ) { char f[200]; CvRect reg; if( !image ) return; if( event == CV_EVENT_LBUTTONDOWN ) { bLButtonDown = true; pt1.x = x; pt1.y = y; } else if ( event == CV_EVENT_MOUSEMOVE ) //Draw the selected area rectangle { pt2.x = x; pt2.y = y; if(bLButtonDown) { if( !image1 ) { /* allocate all the buffers */ image1 = cvCreateImage( cvGetSize(image), 8, 3 ); image1->origin = image->origin; points[0] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); points[1] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); status = (char*)cvAlloc(MAX_COUNT); flags = 0; } cvCopy( image, image1, 0 ); //Equal Weight-Height Ratio if(isEqualRation) { pt2.y = pt1.y + (pt2.x-pt1.x); } //Max Height and Width is the image width and height if(pt2.x>image->width) { pt2.x = image->width; } if(pt2.y>image->height) { pt2.y = image->height; } CvPoint InnerPt1 = pt1; CvPoint InnerPt2 = pt2; if ( InnerPt1.x > InnerPt2.x) { int tempX = InnerPt1.x; InnerPt1.x = InnerPt2.x; InnerPt2.x = tempX; } if ( pt2.y < InnerPt1.y ) { int tempY = InnerPt1.y; InnerPt1.y = InnerPt2.y; InnerPt2.y = tempY; } InnerPt1.y = image->height - InnerPt1.y; InnerPt2.y = image->height - InnerPt2.y; CvFont font; double hScale=1.0; double vScale=1.0; int lineWidth=1; cvInitFont(&font,CV_FONT_HERSHEY_SIMPLEX|CV_FONT_ITALIC, hScale,vScale,0,lineWidth); char size [200]; reg.x = pt1.x; reg.y = image->height - pt2.y; reg.height = abs (pt2.y - pt1.y); reg.width = InnerPt2.x -InnerPt1.x; //print width and heght of the selected reagion sprintf(size, "(%dx%d)",reg.width, reg.height); cvPutText (image1,size,cvPoint(10,10), &font, cvScalar(255,255,0)); cvRectangle(image1, InnerPt1, InnerPt2, CV_RGB(255,0,0), 1); //Mark Selected Reagion selectedImage = image; selectedX = pt1.x; selectedY = pt1.y; selectedWidth = reg.width; selectedHeight = reg.height; selectedROI = reg; //Show the modified image cvShowImage("HMM-Harr Positive Image Creator",image1); } } else if ( event == CV_EVENT_LBUTTONUP ) { bLButtonDown = false; // pt2.x = x; // pt2.y = y; // // if ( pt1.x > pt2.x) // { // int tempX = pt1.x; // pt1.x = pt2.x; // pt2.x = tempX; // } // // if ( pt2.y < pt1.y ) // { // int tempY = pt1.y; // pt1.y = pt2.y; // pt2.y = tempY; // // } // //reg.x = pt1.x; //reg.y = image->height - pt2.y; // //reg.height = abs (pt2.y - pt1.y); ////reg.width = reg.height/3; //reg.width = pt2.x -pt1.x; ////reg.height = (2 * reg.width)/3; #ifdef FULL_IMAGE_AS_OUTPUT_FILE CvRect FullImageRect; FullImageRect.x = 0; FullImageRect.y = 0; FullImageRect.width = image->width; FullImageRect.height = image->height; IplImage *regionFullImage =0; regionFullImage = cvCreateImage(cvSize (FullImageRect.width, FullImageRect.height), image->depth, image->nChannels); image->roi = NULL; //cvSetImageROI (image, FullImageRect); //cvCopy (image, regionFullImage, 0); #else IplImage *region =0; region = cvCreateImage(cvSize (reg.width, reg.height), image1->depth, image1->nChannels); image->roi = NULL; cvSetImageROI (image1, reg); cvCopy (image1, region, 0); #endif //cvNamedWindow("Result", CV_WINDOW_AUTOSIZE); //selectedImage = image; //selectedX = pt1.x; //selectedY = pt1.y; //selectedWidth = reg.width; //selectedHeight = reg.height; ////currentImageNo = startImgeNo; //selectedROI = reg; /*if(mode == 1) { saveFroHarrTraining(image,pt1.x,pt1.y,reg.width,reg.height,startImgeNo); } else if(mode == 2) { saveForHMMTraining(image,reg,startImgeNo); } else if(mode ==3) { saveFroHarrTraining(image,pt1.x,pt1.y,reg.width,reg.height,startImgeNo); saveForHMMTraining(image,reg,startImgeNo); } else { printf("Invalid mode."); } startImgeNo++;*/ } } /* Save popsitive samples for Harr Training. Also add an entry to the PositiveSample.txt with the location of the item of interest. */ void saveFroHarrTraining(IplImage *src, int x, int y, int width, int height, int imageCount) { char f[255] ; sprintf(f,"%s\\%s\\harr_%s%d%d.jpg",strImageDir,strItemName,strItemName,imageCount/10, imageCount%10); cvNamedWindow("Harr", CV_WINDOW_AUTOSIZE); cvShowImage("Harr", src); cvSaveImage(f, src); printf("output%d%d \t ", imageCount/10, imageCount%10); printf("width %d \t", width); printf("height %d \t", height); printf("x1 %d \t", x); printf("y1 %d \t\n", y); char f1[255]; sprintf(f1,"%s\\PositiveSample.txt",strImageDir); FileDest = fopen(f1, "a"); fprintf(FileDest, "%s\\harr_%s%d.jpg 1 %d %d %d %d \n",strItemName,strItemName, imageCount, x, y, width, height); fclose(FileDest); } /* Create Sample Images for HMM recognition algorythm trai ning. */ void saveForHMMTraining(IplImage *src, CvRect roi,int imageCount) { char f[255] ; printf("x=%d, y=%d, w= %d, h= %d\n",roi.x,roi.y,roi.width,roi.height); //Create the file name sprintf(f,"%s\\%s\\hmm_%s%d.pgm",strImageDir,strItemName,strItemName, imageCount); //Create storage for grayscale image IplImage* gray = cvCreateImage(cvSize(roi.width,roi.height), 8, 1); //Create storage for croped reagon IplImage* regionFullImage = cvCreateImage(cvSize(roi.width,roi.height),8,3); //Croped marked region cvSetImageROI(src,roi); cvCopy(src,regionFullImage); cvResetImageROI(src); //Flip croped image - otherwise it will saved upside down cvConvertImage(regionFullImage, regionFullImage, CV_CVTIMG_FLIP); //Convert croped image to gray scale cvCvtColor(regionFullImage,gray, CV_BGR2GRAY); //Show final grayscale image cvNamedWindow("HMM", CV_WINDOW_AUTOSIZE); cvShowImage("HMM", gray); //Save final grayscale image cvSaveImage(f, gray); } int maina( int argc, char** argv ) { CvCapture* capture = 0; //if( argc == 1 || (argc == 2 && strlen(argv[1]) == 1 && isdigit(argv[1][0]))) // capture = cvCaptureFromCAM( argc == 2 ? argv[1][0] - '0' : 0 ); //else if( argc == 2 ) // capture = cvCaptureFromAVI( argv[1] ); char* video; if(argc ==7) { mode = atoi(argv[1]); strImageDir = argv[2]; strItemName = argv[3]; video = argv[4]; currentImageNo = atoi(argv[5]); int a = atoi(argv[6]); if(a==1) { isEqualRation = true; } else { isEqualRation = false; } } else { printf("\nUsage: TSCreator.exe <Mode> <Sample Image Save Path> <Sample Image Save Directory> <Video File Location> <Start Image No> <Is Equal Ratio>\n"); printf("Mode = 1 - Haar Traing Sample Creation. \nMode = 2 - HMM sample creation.\nMode = 3 - Both Harr and HMM\n"); printf("Is Equal Ratio = 0 or 1. 1 - Equal weidth and height, 0 - custom."); printf("Note: You have to create the image save directory in correct path first.\n"); printf("Eg: TSCreator.exe 1 E:\Projects\TSCreator\Images A 11.avi 1 1\n\n"); return 0; } capture = cvCaptureFromAVI(video); if( !capture ) { fprintf(stderr,"Could not initialize capturing...\n"); return -1; } cvNamedWindow("HMM-Harr Positive Image Creator", CV_WINDOW_AUTOSIZE); cvSetMouseCallback("HMM-Harr Positive Image Creator", on_mouse, 0); //cvShowImage("Test", image1); for(;;) { IplImage* frame = 0; int i, k, c; frame = cvQueryFrame( capture ); if( !frame ) break; if( !image ) { /* allocate all the buffers */ image = cvCreateImage( cvGetSize(frame), 8, 3 ); image->origin = frame->origin; //grey = cvCreateImage( cvGetSize(frame), 8, 1 ); //prev_grey = cvCreateImage( cvGetSize(frame), 8, 1 ); //pyramid = cvCreateImage( cvGetSize(frame), 8, 1 ); // prev_pyramid = cvCreateImage( cvGetSize(frame), 8, 1 ); points[0] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); points[1] = (CvPoint2D32f*)cvAlloc(MAX_COUNT*sizeof(points[0][0])); status = (char*)cvAlloc(MAX_COUNT); flags = 0; } cvCopy( frame, image, 0 ); // cvCvtColor( image, grey, CV_BGR2GRAY ); cvShowImage("HMM-Harr Positive Image Creator", image); cvSetMouseCallback("HMM-Harr Positive Image Creator", on_mouse, 0); c = cvWaitKey(0); if((char)c == 's') { //Save selected reagion as training data if(selectedImage) { printf("Selected Reagion Saved\n"); if(mode == 1) { saveFroHarrTraining(selectedImage,selectedX,selectedY,selectedWidth,selectedHeight,currentImageNo); } else if(mode == 2) { saveForHMMTraining(selectedImage,selectedROI,currentImageNo); } else if(mode ==3) { saveFroHarrTraining(selectedImage,selectedX,selectedY,selectedWidth,selectedHeight,currentImageNo); saveForHMMTraining(selectedImage,selectedROI,currentImageNo); } else { printf("Invalid mode."); } currentImageNo++; } } } cvReleaseCapture( &capture ); //cvDestroyWindow("HMM-Harr Positive Image Creator"); cvDestroyAllWindows(); return 0; } #ifdef _EiC main(1,"lkdemo.c"); #endif If I put... #include "stdafx.h" int _tmain(int argc, _TCHAR* argv[]) { return 0; } ... before the previous code (and link it to the correct OpenCV .lib files) it compiles without errors, but does nothing at the command line. How do I make it work?

    Read the article

  • How to gray out HTML form inputs?

    - by typoknig
    What is the best way to gray out text inputs on an HTML form? I need the inputs to be grayed out when a user checks a check box. Do I have to use JavaScript for this (not very familiar with JScript) or can I use PHP (which I am more familiar with)? EDIT: After some reading I have got a little bit of code, but it is giving me problems. For some reason I cannot get my script to work based on the state of the form input (enabled or disabled) or the state of my checkbox (checked or unchecked), but my script works fine when I base it on the values of the form inputs. I have written my code exactly like several examples online (mainly this one) but to no avail. None of the stuff that is commented out will work. What am I doing wrong here? <label>Mailing address same as residental address</label> <input name="checkbox" onclick="disable_enable() "type="checkbox" style="width:15px"/><br/><br/> <script type="text/javascript"> function disable_enable(){ if (document.form.mail_street_address.value==1) document.form.mail_street_address.value=0; //document.form.mail_street_address.disabled=true; //document.form.mail_city.disabled=true; //document.form.mail_state.disabled=true; //document.form.mail_zip.disabled=true; else document.form.mail_street_address.value=1; //document.form.mail_street.disabled=false; //document.form.mail_city.disabled=false; //document.form.mail_state.disabled=false; //document.form.mail_zip.disabled=false; } </script>

    Read the article

  • Icons in Windows Form Applications (VS2008)

    - by typoknig
    This is yet another question about .ico files. I have read through many pages trying to figure this out but I am unable to. When I go to Properties - Application of my Windows Form Application there is a place for me to pick the icon for my application. I have made a 32x32 icon and it takes it just fine, but the image is grainy when it is applied to my .exe file, like it is a picture that has been expanded more than it should have. 1.) Why is this? 2.) Is there any .ico file size other than 32x32 than a Windows Form Application can accept? I have tried 48x48 but it doesn't like that. I just want my .exe file to look nice!

    Read the article

  • Exporting to CSV from MySQL via PHP in FireFox

    - by typoknig
    Hi all, I am pulling some info from a database with the following code: <input type="button" value="Export to Excel" onClick="window.navigate('breakfast_service.php?action=export')"> Here is the code for that action. <?php if ($_GET['action'] == 'export') { // Get the registration data $user = 'root'; $pass = 'billiards'; $server = 'localhost'; $link = mysql_connect($server, $user, $pass); if (!$link) { die('Could not connect to database!' . mysql_error()); } mysql_select_db('breakfast', $link); $query = "SELECT * FROM registration"; $result = mysql_query($query); mysql_close($link); // format into CSV $contents = "id, school_id, first_name, last_name, email, attending, created_on\n"; $num = mysql_num_rows($result); for ($i = 0; $i < $num; $i++) { $row = mysql_fetch_array($result); $id = $row['id']; $school_id = $row['school_id']; $fname = $row['first_name']; $lname = $row['last_name']; $email = $row['email']; $attending = ($row['attending'] == 0) ? 'No' : 'Yes'; $date = $row['created_on']; $contents = $contents . "$id, $school_id, $fname, $lname, $email, $attending, $date\n"; } // return as excel file $filename = "export.csv"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); echo $contents; } ?> This combination of code works excellent in IE, but fails to do create/download a file in Firefox or Chrome. Why?

    Read the article

  • SaveFileDialog problem (C#) (VS2008)

    - by typoknig
    Hi all, I am having an issue with SaveFileDialog for some reason. All I want to do is extract data from a text box line by line and write it to a text file, then save that text file to the desktop. The first bit of code works fine (though it doesn't save to the desktop). The second bit of code is what I want to use, but when it creates the text file the text file is empty. What did I do wrong in my second bit of code? This code works, but it does not save to the desktop and it isn't as nice as the second code. //When the Save button is clicked the contents of the text box will be written to a text file. private void saveButton_Click(object sender, EventArgs e) { int textBoxLines = textBox.Lines.Count(); if (File.Exists(saveFile)) { result = MessageBox.Show("The file " + saveFile + " already exists.\r\nDo you want to replace it?", "File Already Exists!", MessageBoxButtons.YesNo); if (result == DialogResult.Yes) { TextWriter tw1 = new StreamWriter(saveFile); for (int i = 0; i < textBoxLines; i++) { tw1.WriteLine(textBox.Lines.GetValue(i)); } tw1.Close(); } if (result == DialogResult.No) { MessageBox.Show("Please move or rename existing " + saveFile + "\r\nBefore attempting to save again.", "Message"); } } else { TextWriter tw2 = new StreamWriter(saveFile); for (int i = 0; i < textBoxLines; i++) { tw2.WriteLine(textBox.Lines.GetValue(i)); } tw2.Close(); } } This code does not work, but it is what I want to use. //When the Save button is clicked the contents of the text box will be written to a text file. private void saveButton_Click(object sender, EventArgs e) { int textBoxLines = textBox.Lines.Count(); Stream saveStream; SaveFileDialog saveDialog = new SaveFileDialog(); saveDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; saveDialog.FilterIndex = 2; saveDialog.RestoreDirectory = true; saveDialog.FileName = (saveFile); saveDialog.InitialDirectory = (Environment.GetFolderPath(Environment.SpecialFolder.Desktop)); if (saveDialog.ShowDialog() == DialogResult.OK) { if ((saveStream = saveDialog.OpenFile()) != null) { StreamWriter tw = new StreamWriter(saveStream); for (int i = 0; i < textBoxLines; i++) { tw.WriteLine(textBox.Lines.GetValue(i)); } saveStream.Close(); } } }

    Read the article

  • How do I make a specific word (variable) in a message box bold in Java?

    - by typoknig
    Hi all, I'm trying to make one word (variable) of a message box bold in my Java program. Here is my code: int n = messageBox.showConfirmDialog(frame, "The File "+ file +" already exists." + "\n" + "Do you want to replace it?", "File Already Exists!", messageBox.YES_NO_OPTION); I want to make the variable "file" appear in bold text in my message box. So far I have only been able to get the entire message box to appear in bold, or none of it at all. How do I do this?

    Read the article

  • VB.NET ASP.NET Web Application woes (VS 2008)

    - by typoknig
    Hi all, I am making my first web application with ASP.NET and I am having a rough time. I have previously created the application I am working on as a Windows Form application and it works great, but I am having problems with the HTML side of things in the web application. My issues are pretty minor, but very annoying. I have worked with websites before and CSS, but as far as I can tell I do not have direct access to a CSS when creating a web application in VS 2008. My biggest issue is the positioning of components that I have dragged onto the "Default.aspx" form. For instance, how am I supposed to float a panel next to another one if I don't have a CSS, or how am I to correctly position a label?

    Read the article

  • Java is open-source, so what?

    - by typoknig
    Hi all, I always here that Java being open-source is a big benefit, but I fail to see how Java being open-source should draw me to use it as opposed to .NET which is closed-source. This website has some Q&A sections (What is the significance of these developments to the industry? in particular) that give a little info, but is being free the only (or the biggest) advantage to Java being open-source? Since I am a beginner, have any of you pros noticed any major difference since the change was made?

    Read the article

  • Crosshairs in Java

    - by typoknig
    I am making a game that needs a crosshair. I have been playing with the java.awt.cursor class and that is easy enough, but the problem is that I do not want the crosshairs to be able to leave the window I create for my game, so I tried this instead: private void drawCrossHair(Graphics g){ Ellipse2D ellipse = new Ellipse2D.Float(); ellipse.setFrame(crossHair.x, crossHair.y, 36, 36); Color yellow = new Color (0xEDFF62); g.setColor(yellow); g.fillOval(crossHair.x, crossHair.y, 40, 40); g.setClip(ellipse); g.clip(ellipse); Basically I am trying to remove the "ellipse" from "g" leaving only a small ring behind. The problem here is that "g.clip(ellipse);" gives me an error. My objective with this code is to create a circle with a transparent center, like a donut. Once the donut is created I will add some small points on the inside of it so it looks more like crosshairs. One thing that may or may not be an issue is that I plan on moving the crosshairs with a joystick, not a mouse... I do not know if that will limit my options for what kind of object my crosshairs can be.

    Read the article

  • Will HTML 5 kill Flash? Is it even worth my time to learn Flash?

    - by typoknig
    Apple is always in the news these days with "i" this and "i" that. One of the biggest beefs people have with Apple is the lack of Flash support. Last year I held the same belief, Apple's choice to exclude Flash support just seemed senseless. HTML 5 seems to have changed this though. One of the most popular users of Flash is YouTube, and they are already getting on the HTML 5 bandwagon (http://www.youtube.com/html5). Still, I am torn between the two technologies. What is your take? Is it better for a budding developer to learn Flash or should their efforts be devoted to HTML5?

    Read the article

  • JavaScript onchange, onblur, and focus weirdness in Firefox

    - by typoknig
    On my form I have a discount field that accepts a dollar amount to be taken off of the total bill (HTML generated in PHP): echo "<input id=\"discount\" class=\"text\" type=\"text\" name=\"discount\" onkeypress=\"return currency(this, event)\" onchange=\"currency_format(this)\" onfocus=\"on_focus(this)\" onblur=\"on_blur(this); calculate_bill()\"/><br/><br/>\n"; The JavaScript function calculate_bill calculates the bill and takes off the discount amount as long as the discount amount is less than the total bill: if(discount != ''){ if(discount - 0.01 > total_bill){ window.alert('Discount Cannot Be Greater Than Total Bill'); document.form.discount.focus(); } else{ total_bill -= discount; } } The problem is that even that when the discount is more than the total bill focus is not being returned to the discount field. I have tried calling the calculate_bill function with onchange but neither IE or Firefox will return focus to the discount field when I do it like that. When I call calculate_bill with onblur it works in IE, but still does not work in Firefox. I have attempted to use a confirmation box instead of an alert box as well, but that didn't work either (plus I don't want two buttons, I only an "OK" button). How can I ensure focus is returned to the discount field after a user has left that field by clicking on another field or tabbing IF the discount amount is larger than the total bill?

    Read the article

  • Labeling a chart in VB.NET (VS 2008)

    - by typoknig
    Hi all, I have created a basic chart in VB.NET (VS 2008) and it is working good, but I would like to label the axies of the chart. The method "AxisLabel" is not what I am looking for. I want to put the word "Dollars" vertically on the far left hand side of my chart (just left of the numbers labeling the "y" axis) and the word "Months" horizontally at the bottom of the chart but above the legend (just below the numbers labeling the "x" axis). Check the picture out...

    Read the article

  • PHP HTML table is too wide

    - by typoknig
    I have a table that I cannot get to size correctly. The table populates with information from a database via a loop. Sometimes if the data is too long the table extends past where it should. When the data is that long I want the data to wrap in the cells so the table stays where it should. I have tried the normal table data but it isn't working. Any ideas? <?php echo "<table> <tr> <th>id</th> <th>700-number</th> <th>First name</th> <th>Last name</th> <th>Email</th> <th>Response</th> <th>Created On</th> </tr>"; $num = mysql_num_rows($result); for ($i = 0; $i < $num; $i++) { $row = mysql_fetch_array($result); $id = $row['id']; $school_id = $row['school_id']; $fname = $row['first_name']; $lname = $row['last_name']; $email = $row['email']; $attending = ($row['attending'] == 0) ? 'No' : 'Yes'; $date = $row['created_on']; $class = (($i % 2) == 0) ? "td2" : "td1"; echo "<tr>"; echo "<td class=" . $class . ">$id</td>"; echo "<td class=" . $class . ">$school_id</td>"; echo "<td class=" . $class . ">$fname</td>"; echo "<td class=" . $class . ">$lname</td>"; echo "<td class=" . $class . ">$email</td>"; echo "<td class=" . $class . ">$attending</td>"; echo "<td class=" . $class . ">$date</td>"; echo "</tr>"; } ?> </table>

    Read the article

  • problem with phpMyAdmin advanced features

    - by typoknig
    Hi all, I am having trouble putting the final touches on my MySQL/Apache/phpMyAdmin install on a Windows XP system. I am trying to get rid of all the error message in phpMyAdmin and I have gotten rid of all of them except the ones related to "advanced features." The exact error message I have is : The additional features for working with linked tables have been deactivated. To find out why click here. I have read up on the cause of the errors but I must be missing something because I still cannot get the warning to go away. Here is what I have done: Created a linked-tables infrastructure (default name "phpmyadmin") per the phpMyAdmin instructions and enabled "pmadb" in my "config.inc.php" file. Specified (enabled) the table names in my "config.inc.php" file (there are 9 tables total). Created a "controluser" and granted only Select privilages per phpMyAdmin instructions Adjusted "controluser" pma and "controlpass" pmapass in "config.inc.php" file From what I can see these are all the instruction phpMyAdmin gives on this subject, and I am unable to locate any tutorials on the specifics of "advanced features" in phpMyAdmin. Any help would be appreciated, and be gentle, this is my first go with MySQL/phpMyAdmin

    Read the article

1 2  | Next Page >