Preview

Project 01

Good Essays
Open Document
Open Document
6251 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Project 01
#!/usr/bin/env python

'''
Simple example of stereo image matching and point cloud generation.
#!/usr/bin/env python

'''
Simple example of stereo image matching and point cloud generation.

Resulting .ply file cam be easily viewed using MeshLab ( http://meshlab.sourceforge.net/ )
'''

import numpy as np import cv2

ply_header = '''ply format ascii 1.0 element vertex %(vert_num)d property float x property float y property float z property uchar red property uchar green property uchar blue end_header '''

def write_ply(fn, verts, colors): verts = verts.reshape(-1, 3) colors = colors.reshape(-1, 3) verts = np.hstack([verts, colors]) with open(fn, 'w') as f: f.write(ply_header % dict(vert_num=len(verts))) np.savetxt(f, verts, '%f %f %f %d %d %d')

cap1 = cv2.VideoCapture(1) cap2 = cv2.VideoCapture(2)

window_size = 3 min_disp = 16 num_disp = 112-min_disp stereo = cv2.StereoSGBM(minDisparity = min_disp, numDisparities = num_disp,
SADWindowSize = window_size, uniquenessRatio = 10, speckleWindowSize = 100, speckleRange = 32, disp12MaxDiff = 1,
P1 = 8*3*window_size**2,
P2 = 32*3*window_size**2, fullDP = False)

while( cap1.isOpened()) : #& cap2.isOpened() -----for second camera if __name__ == '__main__': #print 'loading images...' #imgL = cv2.pyrDown( cv2.imread('../gpu/aloeL.jpg') ) # downscale images for faster processing #imgR = cv2.pyrDown( cv2.imread('../gpu/aloeR.jpg') ) ret,L=cap1.read() ret,R=cap2.read() imgL = cv2.pyrDown(L,(320,240)) imgR = cv2.pyrDown(R,(320,240)) # disparity range is tuned for 'aloe' image pair

#print 'computing disparity...' disp = stereo.compute(imgL, imgR).astype(np.float32) / 16.0

print 'generating 3d point cloud...', h, w = imgL.shape[:2] f = 0.8*w # guess for focal length

You May Also Find These Documents Helpful

  • Good Essays

    Object distance, d0, is positive to the left of the lens and negative to the right of the lens.…

    • 745 Words
    • 6 Pages
    Good Essays
  • Good Essays

    From the Workflow menu, I ran the photo’s alignment, which can fix the camera locations and create sparse point could. As I don’t have a mask for my object, I had to delete all the unnecessary points in the sparse point cloud using the selection tools on the toolbar. So, the masking is not really an initial step here. I was able to view the conjugate points, and the camera’s locations. But, this wasn’t a clear view of the object, and it looked similar to the data we get from Lidar. In addition, adjusting the bounding box is strongly recommended in this step because the next steps will only be applied to the points inside the box. Also, we may fix the axis by rotating the box so that the object will be displayed perfectly when exported to other…

    • 909 Words
    • 4 Pages
    Good Essays
  • Satisfactory Essays

    Lab 2

    • 1738 Words
    • 13 Pages

    6. Calculate the size of the diameter of the field of view for each objective lens and record the data. Remember that 1mm…

    • 1738 Words
    • 13 Pages
    Satisfactory Essays
  • Satisfactory Essays

    project 2

    • 394 Words
    • 2 Pages

    TAX 4001 Project 2 Due Date Handed in to class on November 5, 2014 Your assignment is to individually prepare a memorandum to the tax file (see Chapter 2, Figure 2-6, page 2-27 in the 2015 Edition of the text for an example). The relevant facts are Carol is a successful physician who owns 100 of her incorporated medical practice. She and her husband Dick are considering the purchase of a commercial office building located near the local community hospital. If they purchase the building, Carol would move her medical practice to the new location and rent space at an arms length price. The rent income that Carol and Dick receive will be available to absorb passive losses generated by other passive activities they own. The net effect of this arrangement is a reduction in their income tax liability. Will Carol and Dicks plan work Explain. Your memorandum should include the Facts, Tax Issue(s), Conclusion, and Analysis. Use the UCF library website to search a database (CCH Internet Tax Research Network, RIA Checkpoint, or LexisNexis Academic database can be used). Hint - you will find guidance from the following sources of tax law. These sources should provide you with adequate information to come to a definitive conclusion regarding whether or not Carol and Dick will achieve the results they are hoping for. You will find guidance from the regulations under Reg. 1.469-2. Locate the specific section of Reg. 1.469-2 that applies to this fact pattern, and be sure to cite this specific section in the memorandum. After you have located the section of the regulation that applies to this fact pattern, review the following court cases that are relevant to this issue to help you in your analysis and conclusion (be sure to cite all three in the memorandum) Fransen v. U.S., 98-2 USTC 50,776…

    • 394 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    project 340

    • 4718 Words
    • 14 Pages

    The auto industry is highly concentrated. The top 10 global automakers account for roughly 80% of the worldwide production and nearly 90% of total vehicles sold in the U.S.…

    • 4718 Words
    • 14 Pages
    Powerful Essays
  • Satisfactory Essays

    ProjectP 1

    • 869 Words
    • 3 Pages

    Transforming a brick-and-mortar business to an e business is not an easy task. The first step in creating an e-business is to conduct a market research on the competition we need to gather information such as shipping costs, price points, web navigation shopping cart procedures, and alternate revenue streams. The next step would be to create a detailed business plan with sales projections, budgets, goals, and actions. The third step is creating a Domain name that reflects your business for example: UNFO.com/ UNFO.ORG. After this step we have clearly identified the target market in the different fishing towns in Michigan, then an advertising budgets for online strategies, we also need to establish different distribution channels of the merchandise if shipping is required. Then we UNFO need to determine if the company is going to sell goods or services or advertising. One of the most important aspect of the customer information that is going to be handle would be Data Management, since we are handling customer data, such as credit cards information, mailing addresses, it is essential to have a published policy detailing how the information would be gathered, stored, and secured. A well effective return policy would be clearly stated and acknowledged by the customers. The other important aspect is weather the data will be updated and maintained in-house or outsource support. At last we will need to implement a Customer Service department and determine the methods for online customer service.…

    • 869 Words
    • 3 Pages
    Satisfactory Essays
  • Powerful Essays

    project1

    • 1043 Words
    • 4 Pages

    4) Briefly describe a patent medicine. Patent medicine is a drug or an ingredient that can be purchased over-the-counter without a prescription from the doctor. It provides access to drugs that can be harmful to a person. It can cause for…

    • 1043 Words
    • 4 Pages
    Powerful Essays
  • Satisfactory Essays

    Project one

    • 683 Words
    • 3 Pages

    Write an analysis of either “Goodbye Columbus” or “The Trouble with Diversity,” that considers what the text reveals about the rhetorical choices, assumptions, and beliefs of its author. What rhetorical strategies does the author employ in order to make his argument? How effective are they?…

    • 683 Words
    • 3 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lens and Microscope

    • 379 Words
    • 2 Pages

    4.State the name of each of the tagged parts on the microscope shown above in Step 1 of the Procedures: (11 points)…

    • 379 Words
    • 2 Pages
    Satisfactory Essays
  • Better Essays

    project

    • 914 Words
    • 4 Pages

    You must define the asset or policy with sufficient detail to justify your assessment. Your assessment must include:…

    • 914 Words
    • 4 Pages
    Better Essays
  • Satisfactory Essays

    Project

    • 539 Words
    • 6 Pages

    Directions: Select activities and exercises from the list below. The list is not comprehensive. Please feel free to insert activities, exercises that may not be on the list. Create a 40-minute fitness plan that you will continue to use after this class is over. Keep in mind variety, motivation and your overall goal!…

    • 539 Words
    • 6 Pages
    Satisfactory Essays
  • Powerful Essays

    Multi layer forests

    • 9006 Words
    • 35 Pages

    H ERTZMANN , A., AND S EITZ , S. 2005. Example-based photometric stereo: Shape reconstruction with general, varying BRDFs.…

    • 9006 Words
    • 35 Pages
    Powerful Essays
  • Powerful Essays

    of these vision tasks, we also discuss some hardwarespeci c implementations of the proposed method as far…

    • 4322 Words
    • 20 Pages
    Powerful Essays
  • Powerful Essays

    The software cannot read or identified detailed model if it contents shadow. The picture also need taking on suitable distance, such as in figure 6.4 illustrated the largest object like house need suitable distance for taking picture that catch whole building. The software only read and identified several part of object only, for example in red circle showed the software cannot read the model part in others terms it is missing part of model. The software also only reads and needed one sources of pictures (phone camera/DSLR), even the picture illustrated the some object. Moreover, the software needed 100% connected to internet which is for software jointed the whole picture into 3D model.…

    • 1340 Words
    • 6 Pages
    Powerful Essays
  • Best Essays

    Radke, Richard J and Richard J. Radke. Computer Vision for Visual Effects. United Kingdom : Cambridge University Press, 2012.…

    • 2110 Words
    • 9 Pages
    Best Essays