示例#1
0
        /// <summary>
        /// Reason : To get color codes from image
        /// Image devided into #x# parts to pickup pixel colors
        /// </summary>
        /// <param name="imageInputObj">Accepts object of ImageFileInput</param>
        /// <returns>returns list of List<ColorModel> model</returns>
        public List <Colors> GetImageColors(ImageFile imageInputObj)
        {
            List <ColorModel> colorModel = _imageGrabber.GetImageColors(imageInputObj.FileName);

            return(PrepareColorModel(colorModel));
        }
 /// <summary>
 ///Extract text from Image frame 
 /// </summary>
 /// <param name="fileNameObj">Accepts Object of ImageFileInput</param>
 /// <returns></returns>
 public ImageContent ExtractTextFromImage(ImageFile fileNameObj)
 {
     ImageContent _imageContent = new ImageContent();
     _imageContent.Content = _imageGrabber.ExtractTextFromImage(fileNameObj.FileName);
     return _imageContent;
 }
 /// <summary>
 /// Reason : To get color codes from image
 /// Image devided into #x# parts to pickup pixel colors
 /// </summary>
 /// <param name="imageInputObj">Accepts object of ImageFileInput</param>
 /// <returns>returns list of List<ColorModel> model</returns>
 public List<Colors> GetImageColors(ImageFile imageInputObj)
 {
     List<ColorModel> colorModel = _imageGrabber.GetImageColors(imageInputObj.FileName);
     return PrepareColorModel(colorModel);
 }
        public void Stub()
        {
            IGrabber imageGrab = new ImageVideoGrabber.Grabber();
            ImageFile fileInput = new ImageFile();
            fileInput.FileName = txtFilePath.Text;
            //test1
             
            var result = imageGrab.ExtractTextFromImage(fileInput);
            var v = result;
            //test2
            fileInput.FileName = txtFilePath.Text; 
            List<Colors> result2= imageGrab.GetImageColors(fileInput);
            var v2 = result2;

            //test3
            VideoFileDetail videoFielOutput = new VideoFileDetail();
            string frameName = Guid.NewGuid().ToString();
            string outputImgFilePath = appStartPath + @"\bin\img\";
            string filePath = txtFilePath.Text.ToString().Trim();
            string batchFilePath = appStartPath + @"\ff-prompt.bat";

            videoFielOutput.ApplicationStartupPath = appStartPath;
            videoFielOutput.OutputImagePath = outputImgFilePath;
            videoFielOutput.InputFilePath = filePath;
            videoFielOutput.BatchFilePath = batchFilePath;          
             
            var result3 = imageGrab.GetVideoDetails(videoFielOutput);
            var v3 = result3;

            //test4
            ImageFileDetails imageFileDupCheck = new ImageFileDetails();
            string targetDirPath = @"D:\git-code\ImageProcessing\KantarImageProcessing\ImageProcessing\bin\Debug\bin\img";
            imageFileDupCheck.FilePath = txtFilePath.Text.ToString();
            imageFileDupCheck.FileLength = 100000;
            imageFileDupCheck.FolderPath = targetDirPath;
            imageFileDupCheck.ApplicationStartupPath = appStartPath;
            var result4 = imageGrab.GetAllSimilarImages(imageFileDupCheck);
            var v4 = result4;

            //upload image
            imageGrab.UploadImageFile(txtFilePath.Text.ToString(),appStartPath);

            //download file
            string imagePath = txtFilePath.Text.ToString();
            imageGrab.DownloadFile(imagePath.Contains("\\") ? imagePath.Split('\\')[imagePath.Split('\\').Count() - 1] : imagePath);

        }