Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scaledLM = dataRow.landmarksScaledMinus05_plus05()请教原理 #14

Open
jasminezz opened this issue Dec 11, 2017 · 0 comments
Open

scaledLM = dataRow.landmarksScaledMinus05_plus05()请教原理 #14

jasminezz opened this issue Dec 11, 2017 · 0 comments

Comments

@jasminezz
Copy link

DataRow源码中的如下代码不太理解:

 dataRow = dataRowOrig.copyCroppedByBBox(dataRowOrig.fbbox)  #这里将图片已经resize为60*60了,而且landmark也已经进行了相应的缩放操作,debug这里输出图像和点是正确的

        scaledLM = dataRow.landmarksScaledMinus05_plus05()#不明白上面已经得到了正确的landmark,为什么还要将landmark进行处理,难道是和图片一样要做归一化操作?如果是,那么归一化方法应该和图片的对应吧,为什么要除以60?

#如下是图片的预处理和归一化操作
        image = dataRow.image.astype('f4')
        # image = (image-meanTrainSet)/(1.e-6 + stdTrainSet)
        image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY).reshape(1, IMAGE_SIZE, IMAGE_SIZE)
        m, s = cv2.meanStdDev(image)
        image = (image - m) / (1.e-6 + s)

        HD5Images[i, :] = image
        HD5Landmarks[i, :] = scaledLM

landmark的归一化操作请解释一下原理,谢谢~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant