image-processing

How to clear circle in CGContext in iOS

坚强是说给别人听的谎言 提交于 2020-05-26 09:09:21
问题 I want create image using CGcontext. This is simple image with white or black background. also I want to add transperent part which is in circle ( check attached image). I know how to do this in rect. But i want to make it circle. Please anyone help me in this. 回答1: Use the below code to clear circle in your context -(UIImage *) getImageWithcenterClear:(CGPoint) center{ CGRect frame = [[UIScreen mainScreen] bounds]; UIGraphicsBeginImageContextWithOptions([[UIScreen mainScreen] bounds].size,

How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

生来就可爱ヽ(ⅴ<●) 提交于 2020-05-26 07:45:55
问题 I am unable to differentiate the below two contours. cv2.contourArea is giving the same value for both. Is there any function to distinguish them in Python? 回答1: To distinguish between a filled contour and unfilled contour, you can use contour hierarchy when finding contours with cv2.findContours. Specifically, you can select the contour retrieval mode to optionally return an output vector containing information about the image topology. There are the four possible modes: cv2.RETR_EXTERNAL -

How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

送分小仙女□ 提交于 2020-05-26 07:44:47
问题 I am unable to differentiate the below two contours. cv2.contourArea is giving the same value for both. Is there any function to distinguish them in Python? 回答1: To distinguish between a filled contour and unfilled contour, you can use contour hierarchy when finding contours with cv2.findContours. Specifically, you can select the contour retrieval mode to optionally return an output vector containing information about the image topology. There are the four possible modes: cv2.RETR_EXTERNAL -

How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

折月煮酒 提交于 2020-05-26 07:43:35
问题 I am unable to differentiate the below two contours. cv2.contourArea is giving the same value for both. Is there any function to distinguish them in Python? 回答1: To distinguish between a filled contour and unfilled contour, you can use contour hierarchy when finding contours with cv2.findContours. Specifically, you can select the contour retrieval mode to optionally return an output vector containing information about the image topology. There are the four possible modes: cv2.RETR_EXTERNAL -

How to distinguish filled circle/contour and unfilled circle/contour in OpenCV?

江枫思渺然 提交于 2020-05-26 07:42:50
问题 I am unable to differentiate the below two contours. cv2.contourArea is giving the same value for both. Is there any function to distinguish them in Python? 回答1: To distinguish between a filled contour and unfilled contour, you can use contour hierarchy when finding contours with cv2.findContours. Specifically, you can select the contour retrieval mode to optionally return an output vector containing information about the image topology. There are the four possible modes: cv2.RETR_EXTERNAL -

Python CAPTCHA-like image disortion

无人久伴 提交于 2020-05-26 06:09:18
问题 I would like to disort some images the same way standard CAPTCHA disorts fonts. How would I achieve it in python? What libraries/algorithms I should use? Any proof-of-concept? DISCLAIMER: I was googling for some time before I asked this question but I couldn't find any satisfying answer. I'm new to the field so I can't provide any code proving my 'research effort'... 回答1: I think you are looking for PyCaptcha http://svn.navi.cx/misc/trunk/pycaptcha/ The actual code to distort is here: http:/

How to crop image based on binary mask

微笑、不失礼 提交于 2020-05-25 08:20:19
问题 I am using torch with some semantic segmentation algorithms to produce a binary mask of the segmented images. I would then like to crop the images based on that mask. To be clear I need to crop it on a per pixel basis. It seems like a simple problem but the only solution I can conjure up is to either invert a draw mask function like in the Coco API, or iterate over each pixel in the array and mask together setting the pixel to black if not needed. I feel like there is a better way of doing

What is the baseline of a stereo camera?

╄→гoц情女王★ 提交于 2020-05-25 07:40:11
问题 Could someone here explain what exactly is the baseline of a camera? 回答1: You're apparently dealing with stereo, where the baseline is (at least normally) the distance between the two lenses. 回答2: I believe Z (depth) = (focalLength * baseline) / disparity Other coordinates can be found here: http://www.ptgrey.com/support/kb/index.asp?a=4&q=63&ST= 回答3: The baseline (distance between both cameras) will influence the depth range that you can observe with a stereo camera, and also your depth

What is the baseline of a stereo camera?

一个人想着一个人 提交于 2020-05-25 07:40:06
问题 Could someone here explain what exactly is the baseline of a camera? 回答1: You're apparently dealing with stereo, where the baseline is (at least normally) the distance between the two lenses. 回答2: I believe Z (depth) = (focalLength * baseline) / disparity Other coordinates can be found here: http://www.ptgrey.com/support/kb/index.asp?a=4&q=63&ST= 回答3: The baseline (distance between both cameras) will influence the depth range that you can observe with a stereo camera, and also your depth

Line Segment Detector vs Probabalistic Hough Transform

两盒软妹~` 提交于 2020-05-24 20:32:52
问题 In OpenCV, there are two methods of detecting lines that give similar results in the form of a vector of endpoints - the Line Segments Detector (LSD) and the Probabilistic Hough Transform. (Discounting the standard Hough transform as the output given is in terms of equations, not line endpoints.) I haven't been able to find a compare and contrast of these two line detection methods and their pros/cons. Thus - what is the difference between these two functions? Are there any particular