Posts

c++ - Matching contours to level images - OpenCV -

Image
is possible match & level contours in image? possibly symmetric matching? if so, matcher use purpose? demonstration image: in image of lovely imac, can see images passed in unleveled. because took first image @ different height second image.. example: (first image capture) (second image capture) so, instead of matching features on image, wondering if opencv has feature matcher limit me match edges of 1 image ends, , other 1 begins. way, straighten them up. what use: bestof2nearestmatcher gridadaptedfeaturedetector gfttdetector siftdescriptorextractor refining camera parameters based on features basic opencv sample what hope result: my target result align images in demonstration image above. i kind of working on same issue. can surely limit feature points using mask. in case know there 50% overlap in adjacent images, have used features in later half (x > im.cols)of first image , initial half of second image(x < im.co...

Java response.sendRedirect() not clearing angularjs state providers url after # -

currently working in angular js , j2ee frameworks. currently http:something.com/home/#/main but if redirect above url java servlet using response.sendredirect("http:something.com/login/") it redirects me page in browsers url "#/main" remains after redirecting below.... http:something.com/login/#/main. i don't want angulars state after redirection. thanks in advance the prevailing browser behaviour preserve url fragments after redirects . if location in redirect contains url fragment, override carried on url fragment. so append empty url fragment (hash mark # ) redirect clears being carried over. response.sendredirect("http://something.com/login/#")

php - WP Cron Job Runs On Every Page Load -

i trying wrap head around wp cron jobs , have been playing around following snippet of code, supposed send email specified email address once hour, provided of course visitor has visited site , triggered job (wp cron jobs aren't apparently real chron jobs, i've come understand). now, job works in email gets sent email address, there 2 problems: the email gets sent multiple times per chron job cron jobs seem triggered on every page load though it's not supposed run more once hour here's code (retrived wp_schedule_event not firing ): if ( ! wp_next_scheduled( 'prefix_hourly_event' ) ) { wp_schedule_event( time(), 'hourly', 'prefixhourlyevent'); } add_action( 'prefixhourlyevent', 'prefix_do_this_hourly' ); function prefix_do_this_hourly() { wp_mail('myemail@gmail.com','cron working', 'cron working: ','',''); } would able give me idea of why not 1 email ge...

Java debugging on CodeHS -

i need debugging this; problems on lines 10-13. says can't convert string int, don't know how fix it. code looks word "bug" within given strings. public class bughunter extends consoleprogram { public void run() { string test1 = "debug"; string test2 = "bugs bunny"; string test3 = "boogie"; string test4 = "baby buggie"; int index1 = findbug(test1); int index2 = findbug(test2); int index3 = findbug(test3); int index4 = findbug(test4); printbug(test1, index1); printbug(test2, index2); printbug(test3, index3); printbug(test4, index4); } // returns index of string "bug" inside string str // if str not contain string "bug", returns -1 public string findbug(string str) { str.indexof("bug"); } public void printbug(string test, int index) { ...

ios - EXC_BAD_ACCESS Using IBInspectable -

Image
i trying use ibinspectable add borders views. extension uiview { private func getborder(integer: int) -> uirectedge { if integer == 1 { return .top } else if integer == 2 { return .left } else if integer == 3 { return .right } else if integer == 4 { return .bottom } return .all } @ibinspectable var border: int? { { return self.border } set (value) { self.border = value v in addborder(edges: self.getborder(integer: self.border!)) { self.addsubview(v) } } } @ibinspectable var bordercolor: uicolor? { { return self.bordercolor } set (value) { self.bordercolor = value //exc_bad_access here v in addborder(edges: self.getborder(integer: self.border!), color: bordercolor!) { self.addsubview(v) ...

html - CSS vw and vh but relative to the parent instead of viewport -

i'm trying create fixed aspect ratio box resizes not overflow parent. the classic padding-bottom trick able define height in terms of parent width, , testable here allows element grow taller parent width increases. not good. using vh , vw however, can accomplish want restriction parent dimensions of viewport. testable here . <style> div { max-width: 90vw; max-height: 90vh; height: 50.625vw; /* height defined in terms of parent width (90*9/16) */ width: 160vh; /* width defined in terms of parent height, missing padding-bottom trick (90*16/9) */ background: linear-gradient(to right, gray, black, gray); } </style> <div></div> is there way have vh , vw equivalent references parent instead of viewport? or there complimentary trick padding-bottom trick fixes problems? css ratio property? also, images have sort of intrinsic ratio , i'm unsure how take advantage of this. you can use similar did in maintain aspect...

python - Interpret regular expression -

this question has answer here: what differences between lazy, greedy , possessive quantifiers? 1 answer i'm trying parse output looks below. 1 192.168.1.1 0.706 ms 0.654 ms 0.697 ms 2 10.10.10.10 4.215 ms 4.199 ms 4.175 ms 3 123.123.123.123 4.000 ms * * i have regular expression works, follows. this regex works: re.compile(r'^\s*(\d+)\s+?([\s\s]+?(?=^\s*\d+\s+))', re.m) this capture each line properly. ('1', ' 192.168.7.1 0.706 ms 0.654 ms 0.697 ms\n') ('2', ' 10.10.10.10 4.215 ms 4.199 ms 4.175 ms\n') ('3', ' 123.123.123.123 4.000 ms * *\n') my question bold ? in front of (?=^\s*\d+\s+) i.e. changing regular expression follows. this regex not work . difference ? mark removed. re.compile(r'^\s*(\d+)\s+?([\s\s]+(?=^\s*\d+\s+))...