Shop OBEX P1 Docs P2 Docs Learn Events
TSL 1401 lineScan — Parallax Forums

TSL 1401 lineScan

Alejo83Alejo83 Posts: 28
edited 2013-09-16 14:03 in General Discussion
Hi, I am just looking for help with TSL 1401 lineScan.

I am just want to know what is the piece of code the would display the width of an object as accurate as possible in inches.

Thank you so much!

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-09-14 08:51
    Hi again,
    I am still no expert with the TSL 1401, but I did locate Parallax's resources for it. They recently changed their website. Are you having trouble locating that material?

    http://www.parallax.com/search?search_api_views_fulltext=tsl1401

    Since this is simply a camera with electronics, the issue of measuring inches requires knowing what is involved setting up the camera physically in a situation and calibrating it with items of known dimentions. A piece of code can provide a number to refer to, but not the calibration. That will require some trial and error on your part.

    Code from Parallax tends to provide two services - a. to prove that the device is in good working order, and b., to demonstrate all the aspects of its basic use. There may be more useful info from the manufacturer, including Application Notes.

    So, it takes identifying what is useful in what code is provided to get to an actual working application.

    It looks like the manual. pdf provides what you need. Are you being overwhelmed by the literature? Maybe asking about particular pages will get more response.
  • Alejo83Alejo83 Posts: 28
    edited 2013-09-14 09:49
    Thanks loopy, I am using the code that parallax provides with the camera and it works perfect.
    I have my camera 4 inches distance from the object and I also installed a backlight.

    The code that parallax provides is working fine and I can see in the debug terminal the 2 edges detected by the camera and it also shows that the object has an extend(width) of 20, I am assuming that 20 is refering to the pixels. Here is the thing, now how can I know that those 20 pixels are measuring the actual size of the object that is .3" width?

    I am really thinking now in changing the method, I like the idea of connecting two opto-reflective sensors one next to each edge of the object. The object is 0.3" width and has a tolerance of .09", so if I install the opto reflective sensor's beam at a .09" distance from the object I think it can detect any change in the object's width and that would solve my problem.

    Do you think this would work? I think It worth to give a shot to see the results knowing that the opto reflective is an inexpensive sensor!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-09-14 12:05
    You've got a good setup with the TSL1401, it sounds like. I would move the camera closer to your subject, though, so that the width subtends more pixels. That way you can obtain more precision over your measurement. (To focus closer, unscrew the lens from the housing.)

    To convert a pixel count to inches, you will have to calibrate your system against a known width standard. It is also important that the subject distance from the camera always remains the same. Otherwise the width will appear to change, i.e. closer will appear bigger; farther, smaller.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-09-14 12:12
    I can't really say that there would be an advantage to the opto-reflective sensors without actually doing what your are doing.. a lot of trial and error research.

    They are a simpler sensor and may be quite adequate in your content. But it takes a technical person that is working with the actual situation to be able to say which is a better solution.

    Nonetheless, it is much nicer to have two solutions to compare when management comes calling and wants to know if you have given them the best you can.

    The opto-reflective use one wavelength of light, so they can be blind to some materials. You mentioned color variations in the product runs in your previous discussion. So I am uncertain that you would have to have a means to readjust sensitivity for changes in the product color. You may have to do this with either method. But one will show itself as being easier to manage.
  • Alejo83Alejo83 Posts: 28
    edited 2013-09-14 12:23
    You've got a good setup with the TSL1401, it sounds like. I would move the camera closer to your subject, though, so that the width subtends more pixels. That way you can obtain more precision over your emasurement. (To focus closer, unscrew the lens from the housing.)

    To convert a pixel count to inches, you will have to calibrate your system against a known width standard. It is also important that the subject distance from the camera always remains the same. Otherwise the width will appear to change, i.e. closer will appear bigger; farther, smaller.

    -Phil

    Thank you Phil, you are right the setup is working perfectly and the distance from the camera to subject is fixed. Due that I am not very familiar with the terminology of this kind of topics(I still learning english as my second language) can you please describe to me what to mean to calibrate my system against a known width. It is the only part that I have left to get this done, measuring the width.


    Thank you Phil again!
  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-14 12:34
    Use an object, like a ruler or tape measure, as the object being scanned. Place the ruler or tape measure at the same distance and in the same lighting as the objects you plan to use eventually. It helps if the ruler or tape measure has the same reflectivity as your other objects. Count the number of pixels from one known mark on the ruler or tape measure to the next known mark. When you scan your other objects and get the same pixel count between two points on the object, you should be able to measure the same distance between the two points as you got with the ruler or tape measure. That's calibrating against a known width.
  • Alejo83Alejo83 Posts: 28
    edited 2013-09-14 12:41
    Thanks for your quick replay! I am going to give a shot to the opto reflective sensor and compare the results against the lineScan.
    As you said the profile come in different colors(as 10 of them) but I don't mind to make a separate set up for each color, so in that way the guys only have to change the fix set up of each profile.
    We will see later the results of this procedure and I will let you know how it did. Thank you so much for your help!
  • Alejo83Alejo83 Posts: 28
    edited 2013-09-14 12:50
    Great! Thank you so much Mike, I can see know what Phil meant before. I am going to start working with your idea right away and let you know how I did. I am very grateful with all you guys, you can't imagine all the things that I have learned in this forums. Thank you again!
  • Alejo83Alejo83 Posts: 28
    edited 2013-09-16 14:03
    Wow! Thank you Mike and everybody, after calibrating the system the way you provided to me it is really working! It's impressive what this tiny camera can do;although, I think I am going to have issues trying to do this with dark profiles but I can resolve this with another method.

    Thank you again for your help and have an amazing day!
Sign In or Register to comment.