Camera settings of a program that recognizes both color and circle

Discussion related to "under the hood" OpenMV topics.
merlin
Posts: 6
Joined: Wed Jul 17, 2019 3:48 am

Camera settings of a program that recognizes both color and circle

Postby merlin » Sat Jul 20, 2019 1:49 pm

I tried to identify color block and circles in one program at the same time. image.find_circle and image.find_blobs have different settings for the image. The settings for the circle are as follows:
-----------------------------------------------------
Sensor.set_pixformat(sensor.RGB565) # use RGB565.
Sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed.
Sensor.set_contrast(3)
Sensor.set_gainceiling(16)
---------------------------------------------------
After the circle is recognized, the color block settings are as follows:
------------------------------------------------------------------------
Sensor.set_pixformat(sensor.RGB565) # use RGB565.
Sensor.set_framesize(sensor.QVGA) # use QQVGA for speed.
Sensor.set_auto_whitebal(False)
--------------------------------------------------------------------------
But when it recognized the circle after color block recognition, I found that the color of the image is abnormal, I think
-------------------------
Sensor.set_contrast(3)
Sensor.set_gainceiling(16)
------------------------
is the reason, What do I do to get this working?
Last edited by merlin on Sat Aug 03, 2019 12:39 am, edited 1 time in total.
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: Camera settings of a program that recognizes both color and circle

Postby iabdalkader » Sat Jul 20, 2019 8:20 pm

When you change the settings the sensor needs time to adjust and settle down, you could either skip some frames

Code: Select all

 sensor.skip_frames(100)
to skip 100 frames or

Code: Select all

 sensor.skip_frames(time=300)
to skip frames for 300ms or you could keep the settings the same (maybe use set_windowing to reduce the frame).
merlin
Posts: 6
Joined: Wed Jul 17, 2019 3:48 am

Re: Camera settings of a program that recognizes both color and circle

Postby merlin » Sat Jul 20, 2019 9:14 pm

iabdalkader wrote:
Sat Jul 20, 2019 8:20 pm
When you change the settings the sensor needs time to adjust and settle down, you could either skip some frames

Code: Select all

 sensor.skip_frames(100)
to skip 100 frames or

Code: Select all

 sensor.skip_frames(time=300)
to skip frames for 300ms or you could keep the settings the same (maybe use set_windowing to reduce the frame).
I tried it, but failed. The color of the image is abnormal when it recognize the color after recognizing the circle. I think I should change contrast and gainceiling to the default parameter using
------------------------
Sensor.set_contrast(default parameter)
Sensor.set_gainceiling(default parameter)
-------------------------
but I don't know what the parameters are?
Last edited by merlin on Sat Jul 20, 2019 9:17 pm, edited 1 time in total.
User avatar
iabdalkader
Posts: 1141
Joined: Sun May 24, 2015 3:53 pm

Re: Camera settings of a program that recognizes both color and circle

Postby iabdalkader » Sat Jul 20, 2019 9:17 pm

abnormal how ? can you post a screenshot ?
merlin
Posts: 6
Joined: Wed Jul 17, 2019 3:48 am

Re: Camera settings of a program that recognizes both color and circle

Postby merlin » Sat Jul 20, 2019 9:26 pm

iabdalkader wrote:
Sat Jul 20, 2019 9:17 pm
abnormal how ? can you post a screenshot ?
P2 is the picture that identifies the circle
P1 is an abnormal picture when recognizing colors
Attachments
p2.png
p1.png
User avatar
kwagyeman
Posts: 3805
Joined: Sun May 24, 2015 2:10 pm

Re: Camera settings of a program that recognizes both color and circle

Postby kwagyeman » Sat Jul 20, 2019 11:06 pm

Hi, you need to turn auto white balance off immediately. It changes the color of the image when the picture isn't staring at a complex scene. So, before the skip frames call turn auto white balance off using the set_auto_whitebalance() method.
Nyamekye,
merlin
Posts: 6
Joined: Wed Jul 17, 2019 3:48 am

Re: Camera settings of a program that recognizes both color and circle

Postby merlin » Sun Jul 21, 2019 11:22 am

kwagyeman wrote:
Sat Jul 20, 2019 11:06 pm
Hi, you need to turn auto white balance off immediately. It changes the color of the image when the picture isn't staring at a complex scene. So, before the skip frames call turn auto white balance off using the set_auto_whitebalance() method.
I tried , but it did not work too
User avatar
kwagyeman
Posts: 3805
Joined: Sun May 24, 2015 2:10 pm

Re: Camera settings of a program that recognizes both color and circle

Postby kwagyeman » Sun Jul 21, 2019 12:20 pm

Okay, I don't really understand the problem you having then. The images look okay. Can you be more detailed?
Nyamekye,

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests