Mani,
Sorry to bother you once again.
It appear servo behavior is nothing to do with servo rotation direction or change of +, - of X or Y direction to Update the position variable in facetrack.ino file, rather it may have something to do with Opencv processing, Python, facetrack.ino, Mezzanine or 410c board.
Things I did to come-up with this guess is that;
1: I used your original facetrack.ino file and servos are connected directly to Mezzanine as it shown on your Github diagram at this time.
2: When Mezzanine is plugged onto 410c and powered up, it hung or freezes on first power up on cold boot (When power source is unplugged more than 10 minutes)
couple of stuck on boot messages as example are follow;
“[ 15.615669] Bluetooth: hico command timeout 0x1003 tx timeout”
“[ 6.19973]x3: ffffffff00000000 x12 0000000000000038”
and upon unplug and re powering, it is able to boot into GUI on second time in most of boot cases.
3: Bluetooth from GUI application is not connecting but it shows bluetooth device and address, and even shows pairing number screen output for bluetooth keyboard yet does not connect to keyboard or mouse despite they are shown with address with connect prompt that I clicked on.
4: I tried with multiple diffirent servos to duplicate outcome to figure out HW or SW issues as follow; Futaba S148(Analog Servo)-- Upon "Sudo Python facetrack.py followed by name input, it goes all the way back or forward depend on +,- changes and shows Opencv error “name print----”, unless I hold Cam to focus on my face within couple of second, and then Cam progressively goes into end point and stuck on endpoint regardless of +,- changes on X (tilt) axe on facetrack.ino, it stuck on all the way on forward or backward depend on +,- changes. (my face shown with bounding box until it disappear out of screen and servo stop.
Hitech5485HB (Digital Servo)-- Same result, and I changed servo rotation direction (I bought Hitech digital servo for this test purpose) and the result was same with analog servo above.
5: I tried with external power supply to drive servo to see it any changes, yet result are same as above 3 & 4 for both kind.
6: USB Cam is mounted same way as your setup; mounted on Y axe mounted over X axe.
Update 11/12
I tried with different Webcam (one that I had problem with Dataset —Logitech c270).
Working!!! but it continueoly circle around screen area and my face all over on left corner as it seems to recognize that’s the center of screen area. And it’s movement is too fast that video stream is all too jerky.
I set screen size to 640*480 in facetrack.ino and it circle around center position this time (still all over around fast).
I set “int incx = 1; and int inc = 1;” but this doesn’t change speed, and still circle around too fast same.
It also generate same msg stream “Corrupt JPEG data: 1 extraneous bytes before marker 0xd1” continuously.
Thinking that msg may cause of “circle around fast” problem, I installed v41-utils and plugged c920 back and restart, hoping that will fix.
It boots up on first try now and no more “Corrupt —” msg, but it still circle around all over fast behavior.
On both cam, upon “sudo python facetrack.py and name entry” servo always swing back about 45 degree fast and come right back to position very fast and it misses face and terminate itself back to prompt in most of time.
1: How do I maintain default servo position upon command? so it doesn’t quit processing.
2: How do I slow down servo position change speed? for stabilized video stream and processing.
3: Do I need to rebuild Opencv because of v41utils installation?
4: Can this project can be duplicated in Hikey960 same way per your project instruction? if so, will it make difference in terms of accuracy (recognition process)?
Bluetooth is still not working and I haven’t done cold boot on Mezzanine.
Thank you very much and help is appreciated.
Martin,