So is there a chance it could get re-merged? or are we losing this function forever ?
Quote from: Naito on 24 / June / 2012, 09:07:04So is there a chance it could get re-merged? or are we losing this function forever ?There is a chance, but using the screen re-draw seems pretty hokey to me. If you tell me which camera and firmware version you have, I'll try to make you a test build with this feature in it.I did some digging in the Canon face code yesterday and it seems like there should be a better way. If that turns out to be a dead end, then I'll consider re-adding this.
I agree, it does seem hokey to do it that way. I'm trying to put it on a SX110 and an SD1000 camera, is there anything I can do to help? I'm not much help with C coding, but I can write scripts well.
face_count_addr=0x193b0while peek(face_count_addr,2) < 1 dosleep(10)endshoot()
ROM:FFDA5E38 LDR R6, =0x54D9CROM:FFDA5E3C ADR R0, aDetectfaceinfo ; "\r\n DetectFaceInfo#%u"ROM:FFDA5E40 LDRH R1, [R6]ROM:FFDA5E44 BL nullsub_218ROM:FFDA5E48 LDRH R2, [R6,#4]ROM:FFDA5E4C LDRH R1, [R6,#2]ROM:FFDA5E50 ADR R0, aHsizeUVsizeU ; "\r\n Hsize = %u, Vsize = %u"ROM:FFDA5E54 BL nullsub_218ROM:FFDA5E58 LDRH R1, [R6,#6]ROM:FFDA5E5C ADR R0, aNum_of_resultU ; "\r\n Num_Of_Result = %u"ROM:FFDA5E60 BL nullsub_218ROM:FFDA5E64 LDRH R1, [R6,#8]ROM:FFDA5E68 ADR R0, aAll_num_of_res ; ", All_Num_Of_Result = %u"ROM:FFDA5E6C BL nullsub_218ROM:FFDA5E70 LDR R1, [R6,#0xC]ROM:FFDA5E74 ADR R0, aFsetframeinfoD ; "\r\n fSetFrameInfo = %d"ROM:FFDA5E78 BL nullsub_218ROM:FFDA5E7C LDR R1, [R6,#0x10]ROM:FFDA5E80 ADR R0, aFexistprimaryf ; ", fExistPrimaryFace = %d"
f you let me know which version of the sd1000 you have, I can do one for that.
My first idea, which hasn't panned out so far was that the information might be in a propcase. You mentioned that you went through them with get_prop_str, but unless you have the correct sizes, it would be easy to miss something. I thought propcase 9 (for propset 2, length 156 bytes) looked likely, because it is read and set in face detection related tasks. But after playing with it, I didn't see anything that clearly indicated if a face was detected. Also it (like most propcases) only seems to update on halfpress.
There are some other large propcases that might be candidates, 0x70 (length 300 bytes) is also used in these tasks.I've attached a list of all the propcase numbers and sizes I got from extracting all the propcase related calls I could find from the d10 firmware. This is a propset 2 camera, so should be applicable to your cameras if you want to look more.The approach I'm looking into now is variables referenced by the face detection tasks. Unfortunately, canon didn't put many log messages in this area, so it's quite difficult to figure out what is going on. I've found at least 3 face detection related tasks:FaceFrameDispFaceChaceFace
Good news and bad news.Good news: I'm pretty sure I've found a variable that stores the number of faces, in a structure shared by DispFace and ChaseFace. On D10, this structure is at 0x193A4, and the face count is a 16 bit int at offset 0xC. This address is found at the start of ChaseFace.This seems to run all the time, whether you are in face detect mode or not, and reacts quite quickly. The value updates both in plain live view and half press. It's even updated in MF If you find the equivalent address on your cameras, it should be trivial to write face detect script with this using peek, e.g:Code: [Select]face_count_addr=0x193b0while peek(face_count_addr,2) < 1 dosleep(10)endshoot()Bad news: I don't see ChaseFace or DispFace in sx110. However, I do see some apparently face related debug strings that don't exist on d10:Code: [Select]ROM:FFDA5E38 LDR R6, =0x54D9CROM:FFDA5E3C ADR R0, aDetectfaceinfo ; "\r\n DetectFaceInfo#%u"ROM:FFDA5E40 LDRH R1, [R6]ROM:FFDA5E44 BL nullsub_218ROM:FFDA5E48 LDRH R2, [R6,#4]ROM:FFDA5E4C LDRH R1, [R6,#2]ROM:FFDA5E50 ADR R0, aHsizeUVsizeU ; "\r\n Hsize = %u, Vsize = %u"ROM:FFDA5E54 BL nullsub_218ROM:FFDA5E58 LDRH R1, [R6,#6]ROM:FFDA5E5C ADR R0, aNum_of_resultU ; "\r\n Num_Of_Result = %u"ROM:FFDA5E60 BL nullsub_218ROM:FFDA5E64 LDRH R1, [R6,#8]ROM:FFDA5E68 ADR R0, aAll_num_of_res ; ", All_Num_Of_Result = %u"ROM:FFDA5E6C BL nullsub_218ROM:FFDA5E70 LDR R1, [R6,#0xC]ROM:FFDA5E74 ADR R0, aFsetframeinfoD ; "\r\n fSetFrameInfo = %d"ROM:FFDA5E78 BL nullsub_218ROM:FFDA5E7C LDR R1, [R6,#0x10]ROM:FFDA5E80 ADR R0, aFexistprimaryf ; ", fExistPrimaryFace = %d"If you use peek (or the memory browser and misc debug display) to look at the above offset from 0x54D9C, you may find something useful.sd1000 looks to be different still...
I'd attach the script I used, but I seem to have left the SD card with it at home. I basically just looped through prop_id 1-500, stored the values in one array, and then looped through them again and compared each current value with the previous value, then printed the prop# and value if a change was detected. I saw several prop_ids in the 200 range pop up, but they were all gibberish since I didn't have the lengths wrong.
QuoteFaceFrameDispFaceChaceFaceWhere do you find these log messages?
FaceFrameDispFaceChaceFace
That seems to be exactly what we're looking for!! I will have to dig on both cameras to see if there are equivalents. How did you figure out the memory address to look at?
face_count_addr=0x54D9Crepeatprint(peek(face_count_addr+6,2))sleep(100)until false
SUCCESS on the SX110!!!Quoteface_count_addr=0x54D9Crepeatprint(peek(face_count_addr+6,2))sleep(100)until falseThat gave me the count of faces detected on the SX110!!
SD1000 seems to use a different address, but I think you found the strings we need to look for.
Would be fantastic to generalize it and put it in the main CHDK build!
Started by a710 Feature Requests
Started by Duncan General Help and Assistance on using CHDK stable releases
Started by LjL Feature Requests
Started by starman General Help and Assistance on using CHDK stable releases
Started by tedrobphoto Hello, I'm a NEWBIE - HELP!! (Newbies assistance, User Guides and thank you notes)