public bool GetTags(string imgpath) { //List<string> result = new List<string>(); ImageAnalysis dal = new ImageAnalysis(); ImageDetails DrugImage = new ImageDetails(imgpath); bool result = false; Dictionary <string, double> listimg = dal.GetTags(DrugImage); List <string> option = new List <string>() { "pills", "bottle", "medicine", "medical", "pill bottle", "pill", "drug", "drugs", "cure", "prescription drug" }; List <string> listresult = new List <string>(); foreach (var item in DrugImage.Details) { if (item.Value > 69) { if (option.Contains(item.Key)) { result = true; } } } /* var listresult=from re in listimg * where re.Value>70&& option.Contains(re.Key) * select re.Key;*/ //צריך לבדוק מה הkey // List<string> Li = (List<string>)listresult; return(result); }
public List <string> GetTags(string path) { List <string> Result = new List <string>(); ImageContent DrugImage = new ImageContent(path); ImageAnalysis dal = new ImageAnalysis(); dal.GetTags(DrugImage); var Threshold = 50.0; foreach (var item in DrugImage.Details) { if (item.Value > Threshold) { Result.Add(item.Key); } else { break; } } return(Result); }