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

    Here you will become familiar and practice with a mathematical formula called “the thin lens formula.” This…

    • 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

    Project 1

    • 300 Words
    • 2 Pages

    The purpose of this summary is to explain the changes made in the to-be diagram from the previous as-is diagram. Also, to note the protective hardware added, and the justification for the changes made. The to-be diagram has been changed or altered to reflect a defense in depth approach. This diagram is upgraded with the addition of multiple security layers. This diagram has the removal of its wireless access points and the addition of VLAN subnetting for improving network performance and reducing network congestion.…

    • 300 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Lab 2

    • 1738 Words
    • 13 Pages

    How wide is the field of view of the scanning power (40X) in micrometers (µm)? 4400…

    • 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
  • Satisfactory Essays

    Project 2

    • 454 Words
    • 2 Pages

    4. What trend can you observe from the data? List reasons that could explain the…

    • 454 Words
    • 2 Pages
    Satisfactory 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

    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
  • Good Essays

    Project 1

    • 817 Words
    • 2 Pages

    After reading the California Infant/Toddler and Development Foundations book I found the information very helpful and surprising. Knowing that in California the infant and toddler development is aligned with the preschool learning foundations is something I was not aware of. Having infant/toddler programs focus on social emotional development along with the other areas of focus is very important at such a young age. The main areas all the programs focus on are very critical areas of development at these particular ages. If I were a teacher in an infant toddler program the information in the book would help me with dealing with infant and toddlers development accurately. The information would also help me be able to define behavior issues or challenges among certain children.…

    • 817 Words
    • 2 Pages
    Good Essays
  • Powerful Essays

    Multi layer forests

    • 9006 Words
    • 35 Pages

    Figure 1: (a, b) Our approach turns any 2D camera into a cheap depth sensor for close-range human capture and 3D interaction scenarios.…

    • 9006 Words
    • 35 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
  • 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
  • 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