# Capture image of cylinder from Video

Breaking down the .avi video into pictures (a bunch of pictures from frame 1 till last frame). From the of picture, set the 3 lines in the image to capture the pixel (set to 1 pixel width). As shown in the picture below. 3 lines with an equal spacing (40mm from my 3D cad software, I am not sure in pixel distance). Must read the 1st image till the last image. Each line have to cover 120° of area of cylinder. So, after line 1 capture the 1st 120° of cylinder 1, line 2 will capture the 2nd of 120° of cylinder 1 and so to line 3 will capture the 3rd of 120° of cylinder 1. During line 2 capture the 2nd of 120° of cylinder 1. Line 1 will start to capture the 1st of 120° of cylinder 2 and so the rest. The line of pixels captured in step 3 will need to be stitched into a picture. It seems like we flatten the surface of the round cylinder. Lastly, named the image as Cylinder 1, Cylinder 2,….and so on. (this is the result I need) At the end, we can delete all the images which we capture at step 1. edit retag close merge delete

Please Find My Attachment on My question Thank You C:\fakepath\Opencv.jpg

we can help you improve what you already have, but we won't* write your program*, so again, -- we need to see your current attempt at it.

x1 = 938 y1 = 140 w1 = 150 h1 = 315

x2 = 1076 y2 = 140 w2 = 150 h2 = 315

x3 = 800 y3 = 140 w3 = 150 h3 = 315

contours1 = [] contours2 = [] idx = 0 while(1): ret, frame = cap.read()

 if(ret == True):

gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
a = frame[y1:y1 + h1,x1:x1 + w1]
b = frame[y2:y2 + h2,x2:x2 + w2]
c = frame[y3:y3 + h3,x3:x3 + w3]
#cv2.rectangle(frame, (800, 140), (800 + 138, 140 + 312), (0, 255, 0), 1)
#cv2.rectangle(frame, (938, 140), (938 + 138, 140 + 312), (0, 255, 0), 1)
#cv2.rectangle(frame, (1076, 140), (1076 + 138, 140 + 312), (0, 0, 255), 1)
edged_frame = cv2.Canny(a, 100, 200)

img2, con


have you any idea regard my question?

Sort by » oldest newest most voted

i want this in python

more

Official site

GitHub

Wiki

Documentation

## Stats

Asked: 2018-05-29 00:42:51 -0500

Seen: 515 times

Last updated: May 30 '18