Search found 4458 matches

by kwagyeman
Mon Aug 24, 2020 7:12 pm
Forum: Technical Discussion
Topic: NEOPIXEL AS A LED RING LIGHT
Replies: 15
Views: 4455

Re: NEOPIXEL AS A LED RING LIGHT

Just make the line high and low and use delay_us().

The STM32 has a lot of interrupts however. So, it probably won’t work. The OpenMV Cam has a lot going on. You kinda need to use the hardware features to get any timing control. (You could disable interrupts... but, that would not be a good idea)
by kwagyeman
Mon Aug 24, 2020 6:12 pm
Forum: General Topics
Topic: Cut an image and count white pixels
Replies: 2
Views: 109

Re: Cut an image and count white pixels

Use find_blobs(). Set the threshold to look for white pixels. Then, count the number of pixels in each blog returned. You can target the roi for find_blobs() to an area of the image.
by kwagyeman
Mon Aug 24, 2020 6:11 pm
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

Yeah, i didn’t have an algorithm template to work with for designing this. I need to fix the robust linear regression however.
by kwagyeman
Mon Aug 24, 2020 6:09 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

Glad you were able to solve it. Sounds like we should add a method that forces manual mode. Can you create a GitHub feature request for this?
by kwagyeman
Mon Aug 24, 2020 3:52 pm
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

Magnitude is a different calculation for robust versus non-robust. For non-robust it's basically how liney the line is. I.e. it gets higher the more straight and thin the line is. For robust its the size of the line thinkness basically. Basically, the length of the mx/my vector that gives the line i...
by kwagyeman
Mon Aug 24, 2020 3:15 pm
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

Robust is not stable for a pure horizontal line...

Must be something here loosing precision.

https://github.com/openmv/openmv/blob/m ... ts.c#L1070

...

I think it's something to do with the atan2 as x gets close close to zero.
by kwagyeman
Mon Aug 24, 2020 3:06 pm
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

Seems like something is wrong with robust linear regression. It gets the answer wrong with the horizontal line. BINARY_VIEW = True GRAYSCALE_THRESHOLD = (200, 255) MAG_THRESHOLD = 12 MAG_THRESHOLD_HORIZONTAL = 5 import sensor, image, time, math, pyb sensor.reset() sensor.set_pixformat(sensor.GRAYSCA...
by kwagyeman
Mon Aug 24, 2020 2:50 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

For what its worth I reached out to Omnivision tech support for assistance. Good luck... they don't provide help support. On product path for us is moving to OnSemi products for us. They cost more, but, are better and we have access to all documentation currently. ... You just do this to dump all r...
by kwagyeman
Mon Aug 24, 2020 1:05 pm
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

That's definitely not expected behavior.

Upload a pic of the unmodified image and I'll fix your code.
by kwagyeman
Mon Aug 24, 2020 1:03 pm
Forum: Technical Discussion
Topic: NEOPIXEL AS A LED RING LIGHT
Replies: 15
Views: 4455

Re: NEOPIXEL AS A LED RING LIGHT

Yes, use the machine spi module: https://docs.openmv.io/library/machine.SPI.html

It's bit banged spi.
by kwagyeman
Mon Aug 24, 2020 12:35 pm
Forum: Technical Discussion
Topic: NEOPIXEL AS A LED RING LIGHT
Replies: 15
Views: 4455

Re: NEOPIXEL AS A LED RING LIGHT

We have not changed the behavior of the pyb.SPI driver. That’s how the STM32 hardware SPI works. It’s not a firmware thing. This, this has been an issue with the code posted from day 1 in this case. When you load data into the SPI peripheral the leading bit is put on the wire before the clock starts...
by kwagyeman
Mon Aug 24, 2020 12:27 pm
Forum: General Topics
Topic: face mak detection with openmv
Replies: 4
Views: 137

Re: face mak detection with openmv

You can use edge impulse to do that. You have to create a data set and train a CNN.

Pretty much all the work is in collecting a dataset.
by kwagyeman
Mon Aug 24, 2020 10:46 am
Forum: General Topics
Topic: How use apriltag rotations to correct image rotation
Replies: 5
Views: 120

Re: How use apriltag rotations to correct image rotation

Yes. If you want to move it then you need to write some matrix multiply code to translate and rotate the rotation vector in 3D space.
by kwagyeman
Mon Aug 24, 2020 10:42 am
Forum: General Topics
Topic: Raspberry 4 installation problems
Replies: 9
Views: 167

Re: Raspberry 4 installation problems

I have a Raspberry Pi 4 in the mail. It arrives this week. Will fix.
by kwagyeman
Mon Aug 24, 2020 10:40 am
Forum: Technical Discussion
Topic: Detecting and navigating in a matrix
Replies: 17
Views: 205

Re: Detecting and navigating in a matrix

Mmm, do this. Zero the roi at the top of the image. I.e draw a black rectangle in the area where you see the center of the vertical line at the top. This will remove that.

You should use the vertical line center to dynamically move the rectangle center.
by kwagyeman
Mon Aug 24, 2020 10:37 am
Forum: General Topics
Topic: Extracting the pixel value of the image
Replies: 10
Views: 259

Re: Extracting the pixel value of the image

You’re trying to use bumpy like indexing on the image array. We don’t support that. Please read the API on the image module under the docs. Mmm, under closer inspection it looks like you are just trying to use desktop python code on the camera, you cannot do that. Anyway, you shouldn’t try to do any...
by kwagyeman
Mon Aug 24, 2020 10:33 am
Forum: Project Discussion
Topic: Triggering an Arduino Due when a person enters the frame
Replies: 7
Views: 216

Re: Triggering an Arduino Due when a person enters the frame

No, the global shutter camera is not needed.
by kwagyeman
Sun Aug 23, 2020 4:31 pm
Forum: Technical Discussion
Topic: record
Replies: 3
Views: 57

Re: record

Right click on the frame buffer. Select save.
by kwagyeman
Sun Aug 23, 2020 4:22 pm
Forum: Technical Discussion
Topic: histogram
Replies: 3
Views: 53

Re: histogram

Yes, most of the time you only see less than 10 bins since it would be hard do more by hand. But, on a computer, you can have a bin per value. :)
by kwagyeman
Sun Aug 23, 2020 4:02 pm
Forum: Technical Discussion
Topic: record
Replies: 3
Views: 57

Re: record

The file is recorded in temp and then when you click save it's saved wherever you want. The file is an MJPEG video that is transcoded into whatever you like using FFMPEG when you click save.
by kwagyeman
Sun Aug 23, 2020 3:54 pm
Forum: Technical Discussion
Topic: histogram
Replies: 3
Views: 53

Re: histogram

A histogram is the chart of the number of occurrences of a pixel value. Grayscale 0-255 per pixel. The histogram then shows the distribution normalized such that all bins when summed up sum to 1. There are 256 bins in the histogram. If you stop the camera, and then hover your mouse over an area on t...
by kwagyeman
Sun Aug 23, 2020 3:32 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

Hmm, I see what you mean. I apologize, I've never tested the code by removing all light. It appears the sensor does something else and modifies the behavior. Since the OV7725 doesn't really have any more doucmentation than the datasheet which isn't that detailed I don't know what's going on. I've tr...
by kwagyeman
Sat Aug 22, 2020 4:10 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

I'm using firmware v3.6.7.
by kwagyeman
Sat Aug 22, 2020 4:10 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

This works as expected: import sensor # Setup Image Sensor sensor.reset() sensor.set_framesize(sensor.QVGA) sensor.set_pixformat(sensor.GRAYSCALE) print("Start exposure == %d" % sensor.get_exposure_us()) sensor.skip_frames(time = 1000) # Wait for settings to take effect # Setup Image Sensor manual g...
by kwagyeman
Sat Aug 22, 2020 4:08 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

This works as expected on the H7: # Sensor Exposure Control # # This example shows off how to cotnrol the camera sensor's # exposure manually versus letting auto exposure control run. # What's the difference between gain and exposure control? # # Well, by increasing the exposure time for the image y...
by kwagyeman
Sat Aug 22, 2020 10:40 am
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

Hi, I have some time to today to mess with this. I’ll see what’s going on.
by kwagyeman
Sat Aug 22, 2020 10:39 am
Forum: Technical Discussion
Topic: Recording audio?
Replies: 4
Views: 86

Re: Recording audio?

If there’s an I2S interface on SPI2 then you just need to write a C driver and then you can support a Microphone. The STM32 hardware will take care of audio data reception.
by kwagyeman
Sat Aug 22, 2020 10:36 am
Forum: Project Discussion
Topic: OpenMV as Autoguider for astrophotography?
Replies: 51
Views: 1055

Re: OpenMV as Autoguider for astrophotography?

Measure the screw sizes... with the camera you have. We are just buying cheap sub $1 M12 lens mounts. It’s not really engineered by us. The screws are just self tapping screws. You need not get exactly the right size for them. Regarding C mount. I haven’t explored it. Given C mount lenses are more e...
by kwagyeman
Sat Aug 22, 2020 2:34 am
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

The IDE just displays JPEGs. Question, what are you expecting to happen? Can you print what the contrast and gain is set to after setting it? It should be about the same value. If so, then some other sensor auto control method is triggering. Please note that the sensor supports night mode where it w...
by kwagyeman
Sat Aug 22, 2020 2:29 am
Forum: General Topics
Topic: why can't build CMSIS-PACK
Replies: 1
Views: 73

Re: why can't build CMSIS-PACK

Dunno, that’s a question to ask them.
by kwagyeman
Fri Aug 21, 2020 4:29 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

Mmm, it might be night mode. Um, I don't really have time to look into this more right now. But, you can disable this stuff forcablity via register settings: Use sensor.__write_reg(addr, val) and sensor.__read_reg(addr) to read/write register addresses on the OV7725. https://cdn.sparkfun.com/datashe...
by kwagyeman
Fri Aug 21, 2020 4:24 pm
Forum: Technical Discussion
Topic: No terminal connection
Replies: 1
Views: 49

Re: No terminal connection

Add dialout support to your username.

https://askubuntu.com/a/112572
by kwagyeman
Fri Aug 21, 2020 1:31 pm
Forum: Project Discussion
Topic: Triggering an Arduino Due when a person enters the frame
Replies: 7
Views: 216

Re: Triggering an Arduino Due when a person enters the frame

output() returns an array. You have to index in via []. See the print line.

You should put another if around the if else you added and only activate the if/else if you are looking at index 2.
by kwagyeman
Fri Aug 21, 2020 1:25 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

Just something like 100 to 200 ms. If it’s not enough you will know.

You want to add the delay after setting everything but exposure.
by kwagyeman
Fri Aug 21, 2020 11:41 am
Forum: Project Discussion
Topic: Triggering an Arduino Due when a person enters the frame
Replies: 7
Views: 216

Re: Triggering an Arduino Due when a person enters the frame

There’s an example that has zoom in the name. It’s not named exactly that, there are literally two person detection examples. Use the other one.
by kwagyeman
Fri Aug 21, 2020 10:22 am
Forum: Technical Discussion
Topic: Gabor filter
Replies: 1
Views: 55

Re: Gabor filter

You should just hand code the kernels for use, then use the morph() method on the image. You can create copies of the small image patch you want to look at with crop() and then morph() the different kernels there. You can then sum up each morphed image using a method like get_stats() to commute imag...
by kwagyeman
Fri Aug 21, 2020 10:18 am
Forum: Technical Discussion
Topic: Recording audio?
Replies: 4
Views: 86

Re: Recording audio?

The ADC pin can record audio. However, there’s no driver software to make a WAV file for this.
by kwagyeman
Thu Aug 20, 2020 10:23 pm
Forum: General Topics
Topic: not green
Replies: 1
Views: 72

Re: not green

Put your code in the code tags. I can’t tell from the lack of formatting.
by kwagyeman
Thu Aug 20, 2020 8:12 pm
Forum: Project Discussion
Topic: Triggering an Arduino Due when a person enters the frame
Replies: 7
Views: 216

Re: Triggering an Arduino Due when a person enters the frame

Yeah, voltages are fine. The STM32 has robust 5v tolerant i/os. If you want to include children and dogs you need to train a new network using Edge Impulse. You'll need to find a dataset of children and dogs... but, otherwise, it's not a compute or coding issue. You just need to train a new network ...
by kwagyeman
Thu Aug 20, 2020 4:48 pm
Forum: Project Discussion
Topic: counting flowers
Replies: 30
Views: 468

Re: counting flowers

Code: Select all

import pyb, time

start_ms = pyb.millis()

clock = time.clock()
while True:
    clock.tick()
    while pyb.elapsed_millis(start_ms) < 50: pyb.delay(1)
    start_ms += 50
    print(clock.fps())
if should have been while.
by kwagyeman
Thu Aug 20, 2020 3:07 pm
Forum: Project Discussion
Topic: counting flowers
Replies: 30
Views: 468

Re: counting flowers

Yeah, I miss named the variable. But, do you see the idea of what the code is doing?
by kwagyeman
Thu Aug 20, 2020 2:07 pm
Forum: Technical Discussion
Topic: Sensor fixed gain/exposure not working
Replies: 25
Views: 332

Re: Sensor fixed gain/exposure not working

You're hitting a race condition, please add a delay after the camera starts up before setting the gain/exposure. The camera chips internally update their state automatically on startup and if you force settings right then and there the logic onboard will override the value you set. See the camera co...
by kwagyeman
Thu Aug 20, 2020 11:34 am
Forum: General Topics
Topic: How use apriltag rotations to correct image rotation
Replies: 5
Views: 120

Re: How use apriltag rotations to correct image rotation

No, it’s a 3D math problem. Unless everything but z translation is all 0 you can rotate the image without issue.

Think of the camera in 3D space and the tag in 3D space. Rotations make sense based on the translation of where they are in 3D space.
by kwagyeman
Wed Aug 19, 2020 11:29 pm
Forum: Technical Discussion
Topic: Normalization of Floats in TFLite
Replies: 1
Views: 60

Re: Normalization of Floats in TFLite

You should use Edge Impulse for deep learning training: https://edgeimpulse.com/?gclid=CjwKCAjwm_P5BRAhEiwAwRzSO3qBN4OxK2n49xx8JQTqMowIveH1ldKMOSJ21vt3_157C87b_rLLuxoC_9IQAvD_BwE They let you write keras code but take care of the normalization process for you. -1 to 1 is the float range... but, valu...
by kwagyeman
Wed Aug 19, 2020 6:26 pm
Forum: General Topics
Topic: Raspberry 4 installation problems
Replies: 9
Views: 167

Re: Raspberry 4 installation problems

Really common issue: https://www.google.com/search?sxsrf=ALeKk03VGQq2N9DT6BQeG6OiJSi21f5Klg%3A1597875861075&source=hp&ei=lKY9X5H-PIuQtAbvz7XYBg&q=error+while+loading+shared+libraries%3A+libGLESv2.so%3A+cannot+open+shared+object+file%3A+No+such+file+or+directory&oq=error+while+loading+shared+librarie...
by kwagyeman
Wed Aug 19, 2020 6:23 pm
Forum: General Topics
Topic: Raspberry 4 installation problems
Replies: 9
Views: 167

Re: Raspberry 4 installation problems

Mmm, I've seen a similar error before. Try out following this: https://www.raspberrypi.org/forums/view ... p?t=191857

I have patched the IDE to work on a fresh Raspberry Pi 3 with the latest OS I have at home. I thought this error was fixed. Others encountered similar issues and fix their problem.
by kwagyeman
Wed Aug 19, 2020 5:21 pm
Forum: General Topics
Topic: Raspberry 4 installation problems
Replies: 9
Views: 167

Re: Raspberry 4 installation problems

Does the IDE run however?

If you look into the setup script it's just kicking off a lot of sudo apt-get installs which may or may not be available for the system.

I.e. you can ignore those errors.
by kwagyeman
Wed Aug 19, 2020 4:51 pm
Forum: Project Discussion
Topic: counting flowers
Replies: 30
Views: 468

Re: counting flowers

When connected to the PC the camera has the load of streaming images to the PC. When not connected it's not loaded anymore. You can give a fixed FPS by rate limiting the script using the pyb module: import pyb start_ms = pyb.millis() while True: if (pyb.mills() - start) < 50: pyb.delay(1) start += 5...
by kwagyeman
Wed Aug 19, 2020 3:59 pm
Forum: Project Discussion
Topic: counting flowers
Replies: 30
Views: 468

Re: counting flowers

I'm binarizing the image first, then apply the erode and dilate filters, and then finding the blobs.

This is two threshold steps. The second step isn't really needed... but, find_blobs() always thresholds things so I'm just passing it a list of thresholds that select an already thresholded image.

Go to advanced search