Ask Your Question
0

Capture image of cylinder from Video

asked 2018-05-29 00:42:51 -0600

updated 2018-05-30 03:06:31 -0600

berak gravatar image

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. C:\fakepath\Opencv.jpg

edit retag flag offensive close merge delete

Comments

please show, what you've tried so far.

berak gravatar imageberak ( 2018-05-29 00:56:10 -0600 )edit

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

Rashmita Dudhat gravatar imageRashmita Dudhat ( 2018-05-30 03:04:40 -0600 )edit

Please Help In my question Thank You.

Rashmita Dudhat gravatar imageRashmita Dudhat ( 2018-05-30 03:05:29 -0600 )edit

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.

berak gravatar imageberak ( 2018-05-30 03:09:10 -0600 )edit

cap = cv2.VideoCapture("C:\Users\ABC\Downloads\choo\SIMPLIFIED CONVEYOR_C40mm_R80mm.avi")

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
Rashmita Dudhat gravatar imageRashmita Dudhat ( 2018-05-30 03:12:34 -0600 )edit

have you any idea regard my question?

Rashmita Dudhat gravatar imageRashmita Dudhat ( 2018-05-30 03:34:44 -0600 )edit

1 answer

Sort by » oldest newest most voted
0

answered 2018-05-30 03:35:12 -0600

i want this in python

edit flag offensive delete link more

Question Tools

1 follower

Stats

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

Seen: 766 times

Last updated: May 30 '18