[sikuli] 20/53: Drop useless patch no-opencv-surf-module.patch
Gilles Filippini
pini at moszumanska.debian.org
Sun Jun 29 20:38:45 UTC 2014
This is an automated email from the git hooks/post-receive script.
pini pushed a commit to branch master
in repository sikuli.
commit e05f14ad66f59916a76d5a1c55f5ff582e2e43f7
Author: Gilles Filippini <pini at debian.org>
Date: Sun May 11 16:26:11 2014 +0200
Drop useless patch no-opencv-surf-module.patch
---
debian/patches/no-opencv-surf-module.patch | 605 -----------------------------
debian/patches/series | 2 -
2 files changed, 607 deletions(-)
diff --git a/debian/patches/no-opencv-surf-module.patch b/debian/patches/no-opencv-surf-module.patch
deleted file mode 100644
index 213207f..0000000
--- a/debian/patches/no-opencv-surf-module.patch
+++ /dev/null
@@ -1,605 +0,0 @@
-Description: Remove unused code with dependency on the opencv SURF module
- Since release 2.4 the opencv Debian package doesn't ship the SURF module
- anymore which is considered non-free. Fortunately, Sikuli actually
- doesn't use the code depending on it.
- This patch removes the corresponding portions of code.
- .
- PATCH DEACTIVATED for upstream release 1.0.1 which has commented out the
- code using SURF. Keeping it around for now.
-Author: Gilles Filippini <pini at debian.org>
-Index: sikuli/vision-proxy/src/cvgui.h
-===================================================================
---- sikuli.orig/vision-proxy/src/cvgui.h 2013-10-19 16:32:09.000000000 +0200
-+++ sikuli/vision-proxy/src/cvgui.h 2013-10-19 16:32:09.000000000 +0200
-@@ -180,7 +180,6 @@
-
- public:
-
-- static void segmentScreenshot(const Mat& screen, vector<Blob>& text_blobs, vector<Blob>& image_blobs);
- static void getLineBlobsAsIndividualWords(const Mat& screen, vector<LineBlob>& lineblobs);
- static void getParagraphBlobs(const Mat& screen, vector<ParagraphBlob>& parablobs);
-
-Index: sikuli/vision-proxy/src/imgdb.cpp
-===================================================================
---- sikuli.orig/vision-proxy/src/imgdb.cpp 2013-10-19 16:32:09.000000000 +0200
-+++ sikuli/vision-proxy/src/imgdb.cpp 2013-10-19 16:32:09.000000000 +0200
-@@ -24,38 +24,6 @@
- }
-
-
--vector<ImageRecord>
--Database::find(Mat image){
-- vector<ImageRecord> top_matches;
-- vector<ImageRecord> records;
--
-- records = create_image_records_from_image(image);
--
-- for (vector<ImageRecord>::iterator r = records.begin();
-- r != records.end(); ++r){
--
-- //cout << endl << r->area << " : ";
-- vector<ImageRecord> matches = find(*r);
-- for (vector<ImageRecord>::iterator m = matches.begin();
-- m != matches.end(); ++m){
--
-- //cout << "(" << m->screenshot_id << ":" << m->id << ")";
-- }
--
-- if (!matches.empty())
-- top_matches.push_back(matches[0]);
-- }
--
-- return top_matches;
--
--}
--
--vector<ImageRecord>
--Database::find(const char* filename){
-- Mat image = imread(filename, 1);
-- return find(image);
--}
--
- void
- Database::insert(const ImageRecord& b){
- _image_records.push_back(b);
-@@ -111,89 +79,6 @@
-
- #include <fstream>
-
--void
--Database::insert_file(const char* filename, int screenshot_id){
--
-- Mat image = imread(filename, 1);
--
--
-- char buf[200];
--// sprintf(buf,"%s.ui",filename);
--// std::ofstream fout(buf);
--
-- sprintf(buf,"%s.ui",filename);
-- std::ofstream fout_loc(buf);
--
-- vector<Blob> text_blobs, image_blobs;
-- cvgui::segmentScreenshot(image, text_blobs, image_blobs);
--
--
-- vector<ImageRecord> records;
-- records = create_image_records_from_blobs(image, image_blobs);
--
-- for (int i = 0; i < image_blobs.size(); ++i){
--
--
-- Blob& b = image_blobs[i];
-- ImageRecord& r = records[i];
--
-- // ignore small elements
-- if (r.width < 15 || r.height < 15)
-- continue;
--
-- vector<ImageRecord> matches;
-- matches = find(r);
--
-- if (matches.empty()){
--
-- r.id = word_id;
--
-- insert(r);
--#if 0
-- char buf[80];
-- Mat part(image, b.bound);
-- sprintf(buf, "research/result/ir-%d-%d.png",word_id,image_record_id);
-- imwrite(buf, part);
--#endif
-- word_id++;
--
-- }else{
--
-- r.id = matches[0].id;
-- }
--
-- //fout << "ui" << r.id << " ";
--
--
--
-- fout_loc << r.x << " " << r.y << " " << r.width << " " << r.height << " ";
-- fout_loc << "ui" << r.id;
-- fout_loc << endl;
-- }
--
-- //fout << endl;
-- //fout.close();
-- fout_loc.close();
--}
--
--vector<ImageRecord>
--Database::create_image_records_from_image(Mat image){
-- vector<Blob> text_blobs;
-- vector<Blob> image_blobs;
--
-- cvgui::segmentScreenshot(image, text_blobs, image_blobs);
-- return create_image_records_from_blobs(image, image_blobs);
--}
--
--
--
--vector<ImageRecord>
--Database::create_image_records_from_imagefile(const char* filename){
-- Mat image = imread(filename, 1);
-- return create_image_records_from_image(image);
--}
--
--
- vector<ImageRecord>
- Database::create_image_records_from_blobs(const Mat& src, const vector<Blob> image_blobs){
-
-Index: sikuli/vision-proxy/src/imgdb.h
-===================================================================
---- sikuli.orig/vision-proxy/src/imgdb.h 2013-10-19 16:32:09.000000000 +0200
-+++ sikuli/vision-proxy/src/imgdb.h 2013-10-19 16:32:09.000000000 +0200
-@@ -56,9 +56,6 @@
- vector<ImageRecord> find(const char* filename);
- vector<ImageRecord> find(Mat image);
-
-- void insert_file(const char* filename, int screenshot_id);
--
--
- void write(std::ostream& output_stream);
- void read(std::istream& input_stream);
-
-@@ -67,8 +64,6 @@
- vector<ImageRecord> _image_records;
-
- vector<ImageRecord> create_image_records_from_blobs(const Mat& src, const vector<Blob> image_blobs);
-- vector<ImageRecord> create_image_records_from_imagefile(const char* imagefile);
-- vector<ImageRecord> create_image_records_from_image(Mat image);
-
- };
-
-Index: sikuli/vision-proxy/src/vision.cpp
-===================================================================
---- sikuli.orig/vision-proxy/src/vision.cpp 2013-10-19 16:32:09.000000000 +0200
-+++ sikuli/vision-proxy/src/vision.cpp 2013-10-19 16:32:09.000000000 +0200
-@@ -391,75 +391,12 @@
- return text.getString();
- }
-
--string
--Vision::query(const char* index_filename, cv::Mat image){
--
-- Database db;
-- ifstream in(index_filename, ios::binary);
-- db.read(in);
-- in.close();
--
--
-- string ret = "";
--
-- vector<ImageRecord> results = db.find(image);
-- for (vector<ImageRecord>::iterator r = results.begin();
-- r != results.end(); ++r){
--
-- ImageRecord& record = *r;
--
-- //cout << "ui" << record.id << " ";
-- char buf[50];
-- sprintf(buf,"ui%d",record.id);
-- ret = ret + string(buf) + " ";
-- }
--
-- return ret;
--}
--
--
- OCRText
- Vision::recognize_as_ocrtext(Mat image){
- return OCR::recognize(image);
- }
-
-
--vector<FindResult>
--Vision::findTextBlobs(const cv::Mat& image){
-- return findBlobs(image, true);
--}
--
--vector<FindResult>
--Vision::findBlobs(const cv::Mat& image, bool textOnly){
--
-- vector<FindResult> results;
-- vector<Blob> out_text_blobs;
-- vector<Blob> out_img_blobs;
--
-- cvgui::segmentScreenshot(image, out_text_blobs, out_img_blobs);
--
--
-- for (vector<Blob>::iterator i = out_text_blobs.begin();
-- i != out_text_blobs.end(); ++i){
--
-- Blob& b = *i;
-- FindResult fr(b.x,b.y,b.width,b.height,1);
-- results.push_back(fr);
-- }
--
-- if(!textOnly){
-- for (vector<Blob>::iterator i = out_img_blobs.begin();
-- i != out_img_blobs.end(); ++i){
--
-- Blob& b = *i;
-- FindResult fr(b.x,b.y,b.width,b.height,1);
-- results.push_back(fr);
-- }
-- }
--
-- return results;
--}
--
- cv::Mat Vision::createMat(int _rows, int _cols, unsigned char* _data){
- Mat mat_ref = Mat(_rows, _cols, CV_8UC4, _data);
- Mat mat;
-Index: sikuli/vision-proxy/src/vision.h
-===================================================================
---- sikuli.orig/vision-proxy/src/vision.h 2013-10-19 16:32:09.000000000 +0200
-+++ sikuli/vision-proxy/src/vision.h 2013-10-19 16:32:09.000000000 +0200
-@@ -95,13 +95,8 @@
- static void initOCR(const char* ocrDataPath);
-
-
-- static string query(const char* index_filename, cv::Mat image);
--
- static OCRText recognize_as_ocrtext(cv::Mat image);
-
-- static std::vector<FindResult> findBlobs(const cv::Mat& image, bool textOnly=false);
-- static std::vector<FindResult> findTextBlobs(const cv::Mat& image);
--
- static std::string recognize(cv::Mat image);
- static std::string recognizeWord(cv::Mat image);
-
-Index: sikuli/vision-proxy/src/cvgui.cpp
-===================================================================
---- sikuli.orig/vision-proxy/src/cvgui.cpp 2013-10-19 16:31:56.000000000 +0200
-+++ sikuli/vision-proxy/src/cvgui.cpp 2013-10-19 16:31:50.000000000 +0200
-@@ -1548,325 +1548,6 @@
- // VLOG("OCR-Result", ocr_result_image);
- }
-
--void
--cvgui::segmentScreenshot(const Mat& screen, vector<Blob>& text_blobs, vector<Blob>& image_blobs){
--
-- VLOG("Input", screen);
--
-- Mat gray, screen_gray;
-- if(screen.channels() > 1){
-- cvtColor(screen,gray,CV_RGB2GRAY);
-- }
-- else
-- gray = screen;
--
-- screen_gray = gray.clone();
--
-- adaptiveThreshold(gray, gray, 255, ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY_INV, 5, 1);
-- VLOG("AdaptiveThresholded", gray);
--
--
-- Mat lines;
-- cvgui::findLongLines(gray, lines);
--
-- Mat lines_viz = lines.clone();
-- dilate(lines_viz, lines_viz, Mat::ones(4,4,CV_8UC1));
-- VLOG("LongLinesFound", lines_viz);
--
-- Mat not_lines;
-- bitwise_not(lines, not_lines);
--
-- Mat foreground;
-- bitwise_and(gray, not_lines, foreground);
--
-- gray.setTo(0, lines);
-- VLOG("LongLinesRemoved",gray);
--
--
-- denoise(gray);
-- VLOG("NoiseRemoved", gray);
--
-- dilate(gray,gray,Mat::ones(1,3,CV_8UC1));
-- VLOG("Dilated",gray);
--
-- vector<Rect> rects;
-- //cvgui::extractRects(gray, rects);
--
-- vector<Blob> blobs;
-- cvgui::extractBlobs(gray, blobs);
--
--
-- Mat dilated = gray.clone();
--
--
-- // visualization
-- Mat result;
-- Mat g;
-- cvtColor(screen, g, CV_RGB2GRAY);
--
-- Mat ss[3] = {g,g,g};
-- merge(ss,3,result);
-- result = result * 0.5;
--
-- Mat bg = result.clone();
-- Mat screen_darken = bg.clone();
--
--
-- text_blobs.clear();
--
-- for (vector<Blob>::iterator b = blobs.begin(); b != blobs.end(); ++b){
--
-- Blob& blob = *b;
-- Rect& bound = blob;
-- Mat part(screen, bound);
-- //paste(part, result, r->x, r->y);
--
-- Mat p = part.clone();
-- Mat g;
-- cvtColor(p, g, CV_RGB2GRAY);
-- adaptiveThreshold(g, g, 255,
-- ADAPTIVE_THRESH_MEAN_C,
-- THRESH_BINARY_INV, 3, 1);
-- vector<Rect> rs;
-- cvgui::extractSmallRects(g, rs);
-- for (vector<Rect>::iterator r = rs.begin();r != rs.end(); ++r){
-- r->x += bound.x;
-- r->y += bound.y;
-- }
--
-- vector<Rect> rs0;
-- for (vector<Rect>::iterator q = rs.begin();
-- q != rs.end(); ++q){
--
-- // exclude overly short element (e.g., dot of i)
-- if (q->height < 5)
-- continue;
--
-- rs0.push_back(*q);
-- }
--
-- rs = rs0;
--
-- // re-calculate the bounds
-- int x1,y1,x2,y2;
-- x1 = bound.x + bound.width;
-- y1 = bound.y + bound.height;
-- x2 = bound.x;
-- y2 = bound.y;
--
-- for (vector<Rect>::iterator r = rs.begin();
-- r != rs.end(); ++r){
-- x1 = min(x1, r->x);
-- y1 = min(y1, r->y);
-- x2 = max(x2, r->x + r->width);
-- y2 = max(y2, r->y + r->height);
-- }
--
-- //blob.bound = Rect(x1-2,y1-2,x2-x1+4,y2-y1+4);
-- //blob.bound = Rect(x1,y1,x2-x1,y2-y1);
--
-- // make the bound bigger to be consistent with the dilated blobs
-- blob = Blob(Rect(x1-2,y1-1,x2-x1+4,y2-y1+2));
--
--
-- int MINIMUM_NUM_CHARBLOBS = 2;
--
-- if (cvgui::areHorizontallyAligned(rs) && rs.size()>=MINIMUM_NUM_CHARBLOBS)
-- Painter::drawRects(result, rs, Scalar(0,255,0));
-- else
-- Painter::drawRects(result, rs, Scalar(0,0,255));
--
-- if (cvgui::areHorizontallyAligned(rs) && rs.size()>=MINIMUM_NUM_CHARBLOBS){
-- text_blobs.push_back(blob);
-- }
--
-- }
--
-- //drawRects(result, rects, Scalar(255,0,0));
-- Painter::drawBlobs(result, blobs, Scalar(255,0,0));
--
-- VLOG("TextBlocksExtracted",result);
--
--
--
-- Mat text_mask = Mat::zeros(screen.size(), CV_8UC1);
--
--
-- for (vector<Blob>::iterator b = text_blobs.begin();
-- b != text_blobs.end(); ++b){
--
-- Rect& r = *b;
-- Mat m(text_mask,
-- Range(r.y,r.y+r.height),
-- Range(r.x,r.x+r.width));
--
-- m = 255;
--
-- }
--
-- VLOG("TextBinaryMaskComputed", text_mask);
--
--
--
--
-- gray.setTo(0, text_mask);
-- VLOG("AfterTextRemoved",gray);
--
-- dilate(gray,gray,Mat());
-- VLOG("DilatedAgain",gray);
--
-- Mat dilated_again = gray.clone();
--
-- vector<Blob> temp;
-- //cvgui::extractRects(gray, temp);
-- cvgui::extractBlobs(gray, temp);
--
-- // only keep image rects larger than n pixels
--
-- const int MIN_IMAGE_RECT_AREA = 150;
--
-- image_blobs.clear();
-- for (vector<Blob>::iterator b = temp.begin();
-- b != temp.end(); ++b){
--
-- if (b->width * b->height < MIN_IMAGE_RECT_AREA)
-- continue;
--
-- // // blob is too big, something is wrong
-- // if (b->bound.width > 0.8 * screen.width)
-- // continue;
-- // if (b->bound.height > 0.8 * screen.height)
-- // continue;
--
-- image_blobs.push_back(*b);
--
-- }
--
-- Mat image_result = bg.clone();
--
-- Painter::drawBlobs(image_result, image_blobs, Scalar(0,0,255));
-- VLOG("ImageRecordsExtracted", image_result);
--
-- return;
--
-- Mat ui_mask = Mat::zeros(screen.size(), CV_8UC1);
-- Mat photo_mask = Mat::zeros(screen.size(), CV_8UC1);
-- for (vector<Blob>::iterator b = image_blobs.begin();
-- b != image_blobs.end(); ++b){
--
-- Rect& r = *b;
-- Mat mask;
-- if (r.height < 100)
-- mask = ui_mask;
-- else
-- mask = photo_mask;
--
-- Mat m(mask,
-- Range(r.y,r.y+r.height),
-- Range(r.x,r.x+r.width));
--
-- m = 255;
-- }
--
-- VLOG("UIMask", ui_mask);
-- VLOG("PhotoMask", photo_mask);
--
-- Mat segmap;
-- Mat segmapr;
-- Mat segmapg;
-- Mat segmapb;
--
-- bitwise_and(dilated,text_mask,segmapr);
-- bitwise_and(dilated,ui_mask,segmapg);
-- bitwise_and(dilated_again,photo_mask,segmapb);
-- //segmapb = photo_mask;
--
--
-- Mat cs[3] = {segmapb, segmapg,segmapr};
-- merge(cs,3,segmap);
-- VLOG("SegMap", segmap);
--
--
-- //Mat wordmap = screen_darken.clone();//segmap.clone();
-- Mat wordmap = Mat::zeros(screen.size(), CV_8UC3);
--
--
-- screen.copyTo(wordmap, segmapg);
-- screen.copyTo(wordmap, photo_mask);
-- screen.copyTo(wordmap, text_mask);
--
--
--
-- Mat random_ids = Mat::ones(1,100,CV_8UC1);
-- randu(random_ids, 22, 80);
--
-- Scalar white(255,255,255);
-- Scalar black(0,0,0);
-- Scalar yellow(255,255,0);
--
--
-- int i = 0;
--
-- for (vector<Blob>::iterator b = image_blobs.begin();
-- b != image_blobs.end(); ++b){
--
-- Rect& r = *b;
--
--
-- char vwstr[100];
--
--
-- if (r.height < 100){
--
-- int xc = r.x + r.width/2;
-- int yc = r.y + r.height/2;
--
--
-- // putTextWithBackgroundCentered(black, wordmap, "u12", Point(xc,yc),
-- // FONT_HERSHEY_SIMPLEX, 0.5, white);
--
-- int id = random_ids.at<uchar>(0,i++);
-- sprintf(vwstr,"u%d",id);
--
--// putTextWithBackgroundCentered(white, wordmap, vwstr, Point(xc,yc),
--// FONT_HERSHEY_DUPLEX, 0.5, black);
--
--
-- }else{
--
--
--//TODO SURF surf_extractor(6.0e3);
-- vector<KeyPoint> keypoints;
--
-- // printf("Extracting keypoints\n");
--//TODO surf_extractor(screen_gray, photo_mask, keypoints);
-- //printf("Extracted %d keypoints from the image\n", (int)keypoints.size());
--
-- for (vector<KeyPoint>::iterator it = keypoints.begin(); it != keypoints.end(); ++it){
-- KeyPoint& p = *it;
--
-- circle(wordmap, p.pt, p.size*1.5, yellow);
--
-- // putTextWithBackgroundCentered(black, wordmap, "v12", p.pt,
-- // FONT_HERSHEY_SIMPLEX, 0.5, white);
--
-- int id = random_ids.at<uchar>(0,i++);
-- sprintf(vwstr,"s%d",id);
--
--// putTextWithBackgroundCentered(white, wordmap, vwstr, p.pt,
--// FONT_HERSHEY_DUPLEX, 0.5, black);
--
-- }
-- }
--
--
-- }
--
-- VLOG("WordMap", wordmap);
--}
--
--
--
-
- static int L1dist(Vec3b p1, Vec3b p2){
- return max(p1[0],p2[0])-min(p1[0],p2[0])+
diff --git a/debian/patches/series b/debian/patches/series
index 9a306e1..785bb9f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,8 +1,6 @@
native.patch
install-extension.patch
#tess3.patch
-# This patch isn't needed currently. See patch Description
-# no-opencv-surf-module.patch
setTextAndMnemonic.patch
# printhelp.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/sikuli.git
More information about the pkg-java-commits
mailing list