edge-detection

jQuery tooltip detect screen edge

拥有回忆 提交于 2019-12-08 05:32:04
问题 I have some basic hover/tooltip code working that needs to be modified so that a second class name is added when the tooltip hits the edge of the browser window. Can anyone lend a hand? this.tooltip = function () { $(".challenge_card").hover(function (e) { $(this).parent().append("<div id='tooltip'></div>"); $("#tooltip") .fadeIn("fast"); }, function () { $("#tooltip").remove(); }); }; 回答1: var wW = $(window).width(); var $tooltip = $('#tooltip'); if($tooltip.offset().left + $tooltip

How to draw a rectangle around the contours?

大兔子大兔子 提交于 2019-12-08 02:47:34
问题 I am just starting out with opencv and I am trying to make a program that puts squares around a picture of rocks on some sand. The documentation for the function here includes an example of how to use it. findContours( src, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); The prototype of findContours is void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point()) ; I have two questions. 1. The third

Accessing negative pixel values OpenCV

戏子无情 提交于 2019-12-08 00:53:32
问题 I am attempting to perform a zero-crossing edge detection on an image in OpenCV. I blur and use the cvLaplace() then scale it from (0, max). My question is: How can I access the pixel values in that image in such a way as to correctly identify negative values? Using the function provided by OpenCV (cvPtr2D) returns unsigned chars. Any ideas or comments? Thank you 回答1: Pixels are stored internally as IPL_DEPTH_8U, which means 8-bit unsigned char, ranging from 0 to 255. But you could also pack

detecting multi color document with OpenCV4Android

谁说胖子不能爱 提交于 2019-12-07 15:33:07
问题 I am new to OpenCv with Android.I am trying to make an application which auto detects documents using OpenCv - 2.4.13 . In my app, there is a functionality of detection documents (like a Scanbot app) and then prospect it to document. So, far I am able to detect documents with single colour or documents which are clearly distinguishable from background. But the problem arises when the document is of multi-color. To clearly understand the problem , I have attached an image: As you can see, the

Differences between 'imfilter' and 'conv2' [MATLAB]

人盡茶涼 提交于 2019-12-07 10:56:58
问题 I use this both function to find edges on a scale. You have a input image, you apply a mask (for ex. prewitt) to the input image, and get the resultant pic. mypic = imread('examplepic.jpg') hy = fspecial('prewitt') yimfilter = imfilter(mypic,hy) % Using imfilter yconv2 = conv2(mypic,hy) % Using conv2 Which is the theorical difference between these two? I know I got different outputs, but which is the difference? Thanks 回答1: conv2 outputs the entire 2-D convolution, which means that yconv2

drawContours around detected document using opencv for android gives strange bug

僤鯓⒐⒋嵵緔 提交于 2019-12-06 13:18:43
问题 I am new to OpenCv4Android. I am trying to auto detect document using OpenCv4Android sdk. Initially i have gone through issue of landscape opencv camera . Somehow i managed to change the orientation of opencv JavaCameraview to portrait. I made following changes in default classes of opencv sdk to orient opencv camera in portrait : 1) In CameraBridgeViewBase class Matrix matrix = new Matrix(); matrix.setRotate(90f); Bitmap bitmap = Bitmap.createBitmap(mCacheBitmap, 0, 0, mCacheBitmap.getWidth(

How to draw a rectangle around the contours?

故事扮演 提交于 2019-12-06 12:57:10
I am just starting out with opencv and I am trying to make a program that puts squares around a picture of rocks on some sand. The documentation for the function here includes an example of how to use it. findContours( src, contours, hierarchy, CV_RETR_CCOMP, CV_CHAIN_APPROX_SIMPLE ); The prototype of findContours is void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point()) ; I have two questions. 1. The third argument in the example hierarchy is a vector<Vec4i> does not match the type findContours expects. Why is

2D numpy array- check to see if all adjacent terms are equal

你离开我真会死。 提交于 2019-12-06 09:41:58
问题 I am starting with a nxm boolean array, that defines regions- true if it is in the region, false if not. For example: r = np.array([[ 0, 0, 1, 1, 1], [ 0, 1, 1, 0, 0], [ 0, 1, 1, 1, 0], [ 1, 1, 1, 0, 0], [ 1, 1, 0, 0, 0]]) The line between regions can be defined as an n-1 x m-1 array, which would represent a 'point' in between each set of four values. If all 4 surrounding values are the same, you are not on the edge between regions. If any of the 4 values are different, you are. For r above:

Getting corners from convex points

痞子三分冷 提交于 2019-12-06 06:18:52
问题 I have written algorithm to extract the points shown in the image. They form convex shape and I know order of them. How do I extract corners (top 3 and bottom 3) from such points? I'm using opencv. 回答1: if you already have the convex hull of the object, and that hull includes the corner points, then all you need to to do is simplify the hull until it only has 6 points. There are many ways to simplify polygons, for example you could just use this simple algorithm used in this answer: How to

Edge detection and removal

扶醉桌前 提交于 2019-12-06 04:19:03
I am new to Image Processing. I am developing a web application. I need to take an image (free hand drawings) and remove parts of it. For example, take an image of cat and remove everything except its eye. P.S-> I am developing a pictionary game based authentication system. It requires user to select an image co-relating his password, and I would morph it by detecting the edges and removing the parts of it and store it as a cue and display it to him, so that it makes sense only to him and not an attacker. Edge detection is done via a process called Convolution. There are various convolution