image-processing

Detecting a lego baseplate in an image

a 夏天 提交于 2020-07-08 07:29:26
问题 I want my code to find the corners of a square lego plate in an image like the one attached. I also want to find its dimensions, i.e. the number of "blops" in both dimensions (48x48 in the attached image). I am currently looking at detecting the individual "blops", and the result so far is pretty good: a combination of blur, adaptiveThreshold, findContours and selection based on area finds the contours rendered in the second attached image (coloring is random). I'm now looking for an

Accelerate - Lower the threshold for contrast stretching

ぃ、小莉子 提交于 2020-07-07 09:07:09
问题 I am using Swift and Accelerate and am trying to color-correct an image using the vImageContrastStretch method available in Accelerate's vImage module. When I try to stretch the histograms I get a result which does do exactly what I want, but it is a bit too relaxed. The resulting image histograms still have unwanted space on the sides. As you can see in the image, the result of the vImageContrastStretch (middle) operation still has some room for snipping on both sides of the histogram

Crop exactly document paper from image

邮差的信 提交于 2020-07-07 07:14:34
问题 I am using the following code to crop image currently def crop_image(image): image = cv2.imread(image) original_img = image.copy() hsv_img = convert_hsv(image) lower_blue = np.array([0, 0, 120]) upper_blue = np.array([180, 38, 255]) masked_image = mask_img(hsv_img, lower_blue, upper_blue) result = cv2.bitwise_and(image, image, mask=masked_image) contours = cv2.findContours(masked_image.copy(), cv2.RETR_LIST, cv2.CHAIN_APPROX_SIMPLE) contours = imutils.grab_contours(contours) cv2.drawContours

OpenCV - How to draw a line inside contour?

痞子三分冷 提交于 2020-07-07 06:53:39
问题 I'm working on a DIY 3d Scanner project. I'll use a pretty common algorithm for it. See here: https://lesagegp.wordpress.com/2013/12/04/laser-scanning-explained/ I've totally understood the algorithm and wrote a code for it. All I got to do now is processing the images. I've captured couple images for testing. Here is one of them: And I've managed to find contours of the laser with a very simple code: image = cv2.imread("frame/1.png") image = cv2.flip(image, 1) hsv_frame = cv2.cvtColor(image,

OpenCV - How to draw a line inside contour?

三世轮回 提交于 2020-07-07 06:53:08
问题 I'm working on a DIY 3d Scanner project. I'll use a pretty common algorithm for it. See here: https://lesagegp.wordpress.com/2013/12/04/laser-scanning-explained/ I've totally understood the algorithm and wrote a code for it. All I got to do now is processing the images. I've captured couple images for testing. Here is one of them: And I've managed to find contours of the laser with a very simple code: image = cv2.imread("frame/1.png") image = cv2.flip(image, 1) hsv_frame = cv2.cvtColor(image,

OpenCv create 3 channel Mat from continuous data array

老子叫甜甜 提交于 2020-07-06 11:27:10
问题 I'd like to create an OpenCV 3-channel Mat using data allocated elsewhere where the pixels of each channel are together, unlike the data for an OpenCV Mat where the data from different channels is interleaved. Mat outputMat = Mat(dimY, dimX, CV_8UC3, rawData); // This works only if rawData interleaves channel data like an OpenCv Mat Is there a way to create an OpenCV Mat without having to resort to the below solution of splitting channels from a temporary Mat and copying the right channel

How to detect bullet holes on the target using Android Opencv

我只是一个虾纸丫 提交于 2020-07-06 05:21:52
问题 I am working in a project where I have to scan the target and recognize the holes in the target and have to score according to the shots. I am not aware of the exact code how to recognize the holes in the target. I imported the opencv library and gone through a program where if I touch it will recognize the corresponding color. Now I am stuck in the coding part. Here is the screenshot of the target sheet that is given to me. Could anyone please help me how to proceed further. Thanks in

Rectification of uncalibrated cameras, via fundamental matrix

百般思念 提交于 2020-07-05 09:35:56
问题 I'm trying to do calibration of Kinect camera and external camera, with Emgu/OpenCV. I'm stuck and I would really appreciate any help. I've choose do this via fundamental matrix, i.e. epipolar geometry. But the result is not as I've expected. Result images are black, or have no sense at all. Mapx and mapy points are usually all equal to infinite or - infinite, or all equals to 0.00, and rarely have regular values. This is how I tried to do rectification: 1.) Find image points get two arrays

How can I segment my OCT images like this [closed]

狂风中的少年 提交于 2020-07-05 04:52:30
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 17 days ago . Improve this question I'm working on a project with OCT images with machine learning, and I think if I could segment some relevant parts of the image, the result would be better. Recently I found this example: I really like it because emphasize the accumulated fluids (my goal). How can I do a

How can I segment my OCT images like this [closed]

自作多情 提交于 2020-07-05 04:52:25
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 17 days ago . Improve this question I'm working on a project with OCT images with machine learning, and I think if I could segment some relevant parts of the image, the result would be better. Recently I found this example: I really like it because emphasize the accumulated fluids (my goal). How can I do a