use as a contrast sensor

General discussion about topics related to OpenMV.
rajeshktym
Posts: 33
Joined: Wed Mar 07, 2018 7:04 pm
Location: KOCHI
Contact:

use as a contrast sensor

Postby rajeshktym » Tue Nov 12, 2019 2:05 am

Hi,
In my project, i am trying to use H7 sensor work like a contrast sensor, means i can minimise the capture area to set sensor.set_windowing((40, 10)) to detect black mark from rotating roller with in 1 milli second. image processing may took more time if any another function can use to achieve the result (black / white frame detection).

Thanks in advance
User avatar
kwagyeman
Posts: 4458
Joined: Sun May 24, 2015 2:10 pm

Re: use as a contrast sensor

Postby kwagyeman » Tue Nov 12, 2019 2:42 am

Use get_stats() or get_histogram().
Nyamekye,
rajeshktym
Posts: 33
Joined: Wed Mar 07, 2018 7:04 pm
Location: KOCHI
Contact:

Re: use as a contrast sensor

Postby rajeshktym » Wed Nov 13, 2019 12:50 am

Code: Select all

import sensor, image, time

sensor.reset()                      # Reset and initialize the sensor.
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QQQVGA)
sensor.set_windowing((60, 10))      # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000)     # Wait for settings take effect.
sensor.ioctl(sensor.IOCTL_SET_TRIGGERED_MODE, True)
clock = time.clock()                # Create a clock object to track the FPS.

while(True):
    clock.tick()                    # Update the FPS clock.
    img = sensor.snapshot()         # Take a picture and return the image.
    dd = img.get_stats().mean()
    #dd = img.get_histogram()
    #print(dd)
    if dd < 100:
        print("FPS:%d > %s"% (clock.fps(),dd))              # Note: OpenMV Cam runs about half as fast when connected
Hi Iwas trying to use above code for detect black frame with global shutter trigger mode, but it still detect black in very low FPS, with this approach can we get black or white detection with in 100-200 micro seconds?
User avatar
kwagyeman
Posts: 4458
Joined: Sun May 24, 2015 2:10 pm

Re: use as a contrast sensor

Postby kwagyeman » Wed Nov 13, 2019 1:58 am

You have to set the camera exposure to be a low value. See the Global Shutter example high FPS script.

That said, 100-200 microseconds isn't happening except on an FPGA... That's obscenely fast. You can get 400 FPS max. 100-200 microsecond is much faster than that. I do not know where you are getting this 100-200 microsecond number from.
Nyamekye,
rajeshktym
Posts: 33
Joined: Wed Mar 07, 2018 7:04 pm
Location: KOCHI
Contact:

Re: use as a contrast sensor

Postby rajeshktym » Wed Nov 13, 2019 2:12 am

Hi kwagyeman

I m capturing this black mark from moving conveyer which run in speed of 100 - 250 meter per minute (4000 mm /sec) means with in 250 micro second 1 mm mark will be move from sensor,
User avatar
kwagyeman
Posts: 4458
Joined: Sun May 24, 2015 2:10 pm

Re: use as a contrast sensor

Postby kwagyeman » Wed Nov 13, 2019 11:13 am

Understood, but, even if you set the resolution to be 80x60 and the exposure to be very low to get the 400fps rate this doesn't get you up to 100 microseconds... You need a 10k fps camera to hit that.

Can you send an image of the problem? Maybe it's possible to lower the frame rate.
Nyamekye,
rajeshktym
Posts: 33
Joined: Wed Mar 07, 2018 7:04 pm
Location: KOCHI
Contact:

Re: use as a contrast sensor

Postby rajeshktym » Thu Nov 14, 2019 12:10 am

Hi
I m planning to use TSL1401CL 128X1 Linear CCD Camera Sensor, which can read 128 pixel data with 38 micro seconds. I hv realised openmv will not meet my this requirement,

Thanks
User avatar
kwagyeman
Posts: 4458
Joined: Sun May 24, 2015 2:10 pm

Re: use as a contrast sensor

Postby kwagyeman » Thu Nov 14, 2019 3:09 pm

Yeah, that kind of sensor would be more suited to your task.
Nyamekye,

Return to “General Topics”

Who is online

Users browsing this forum: No registered users and 1 guest