Feet pressure points for pronation detection in foot scan image












0















Having problem in detecting feet pronation in foot scan image, I tried to mark pressure point based on threshold and able to get some results, but this technique failed in those images in which feet color is dark. Result of what I have tried is Here but I want the final result looks like these Feet Image Results.

Any help/suggestion will be appreciated.
Thanks



Edit
I have added the scan image of hand in which pressure points are circled and processed image supposed to detect only pressure point but it failed based on color of skin as I mentioned above. I'm applying color threshold. The image which in which detection failed is Here










share|improve this question

























  • Can you add an example of an image that doesn't work properly?

    – J.D.
    Jan 2 at 21:22











  • @J.D. i edited my question and added the image

    – Smart
    Jan 3 at 9:35











  • Seems like you need actual pressure sensor data instead of a photo...

    – Nyerguds
    Mar 1 at 9:34











  • @Nyerguds yes, you are right

    – Smart
    Mar 1 at 9:39
















0















Having problem in detecting feet pronation in foot scan image, I tried to mark pressure point based on threshold and able to get some results, but this technique failed in those images in which feet color is dark. Result of what I have tried is Here but I want the final result looks like these Feet Image Results.

Any help/suggestion will be appreciated.
Thanks



Edit
I have added the scan image of hand in which pressure points are circled and processed image supposed to detect only pressure point but it failed based on color of skin as I mentioned above. I'm applying color threshold. The image which in which detection failed is Here










share|improve this question

























  • Can you add an example of an image that doesn't work properly?

    – J.D.
    Jan 2 at 21:22











  • @J.D. i edited my question and added the image

    – Smart
    Jan 3 at 9:35











  • Seems like you need actual pressure sensor data instead of a photo...

    – Nyerguds
    Mar 1 at 9:34











  • @Nyerguds yes, you are right

    – Smart
    Mar 1 at 9:39














0












0








0








Having problem in detecting feet pronation in foot scan image, I tried to mark pressure point based on threshold and able to get some results, but this technique failed in those images in which feet color is dark. Result of what I have tried is Here but I want the final result looks like these Feet Image Results.

Any help/suggestion will be appreciated.
Thanks



Edit
I have added the scan image of hand in which pressure points are circled and processed image supposed to detect only pressure point but it failed based on color of skin as I mentioned above. I'm applying color threshold. The image which in which detection failed is Here










share|improve this question
















Having problem in detecting feet pronation in foot scan image, I tried to mark pressure point based on threshold and able to get some results, but this technique failed in those images in which feet color is dark. Result of what I have tried is Here but I want the final result looks like these Feet Image Results.

Any help/suggestion will be appreciated.
Thanks



Edit
I have added the scan image of hand in which pressure points are circled and processed image supposed to detect only pressure point but it failed based on color of skin as I mentioned above. I'm applying color threshold. The image which in which detection failed is Here







c# opencv image-processing






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 7 at 17:09









Kaiwen Chang

6019




6019










asked Jan 2 at 18:07









SmartSmart

11




11













  • Can you add an example of an image that doesn't work properly?

    – J.D.
    Jan 2 at 21:22











  • @J.D. i edited my question and added the image

    – Smart
    Jan 3 at 9:35











  • Seems like you need actual pressure sensor data instead of a photo...

    – Nyerguds
    Mar 1 at 9:34











  • @Nyerguds yes, you are right

    – Smart
    Mar 1 at 9:39



















  • Can you add an example of an image that doesn't work properly?

    – J.D.
    Jan 2 at 21:22











  • @J.D. i edited my question and added the image

    – Smart
    Jan 3 at 9:35











  • Seems like you need actual pressure sensor data instead of a photo...

    – Nyerguds
    Mar 1 at 9:34











  • @Nyerguds yes, you are right

    – Smart
    Mar 1 at 9:39

















Can you add an example of an image that doesn't work properly?

– J.D.
Jan 2 at 21:22





Can you add an example of an image that doesn't work properly?

– J.D.
Jan 2 at 21:22













@J.D. i edited my question and added the image

– Smart
Jan 3 at 9:35





@J.D. i edited my question and added the image

– Smart
Jan 3 at 9:35













Seems like you need actual pressure sensor data instead of a photo...

– Nyerguds
Mar 1 at 9:34





Seems like you need actual pressure sensor data instead of a photo...

– Nyerguds
Mar 1 at 9:34













@Nyerguds yes, you are right

– Smart
Mar 1 at 9:39





@Nyerguds yes, you are right

– Smart
Mar 1 at 9:39












1 Answer
1






active

oldest

votes


















0














There is not enough color differences to do this easily. I tried by increasing contrast and converting to HSV colorspace (info - opencv), which makes selecting colors easier.



Result:



enter image description here



# load image
img = cv2.imread("hand.png")

#increase contrast
new_image = np.zeros(img.shape, img.dtype)
alpha = 4 # Simple contrast control
beta = -300 # Simple brightness control
for y in range(img.shape[0]):
for x in range(img.shape[1]):
for c in range(img.shape[2]):
new_image[y,x,c] = np.clip(alpha*img[y,x,c] + beta, 0, 255)

# convert to HSV
hsv = cv2.cvtColor(new_image, cv2.COLOR_BGR2HSV)
# set lower and upper color limits
lower_val = np.array([30,0,200])
upper_val = np.array([75,240,255])
# Threshold the HSV image
mask = cv2.inRange(hsv, lower_val, upper_val)
# remove noise
kernel = np.ones((3,3),np.uint8)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)

# select whole hand
# set lower and upper color limits
lower_val = np.array([0,0,100])
upper_val = np.array([179,255,255])
# Threshold the HSV image
mask2 = cv2.inRange(hsv, lower_val, upper_val)

# create a mask that has the whole hand, but not the prssure points
mask_combined = cv2.bitwise_xor(mask, mask2)
# Create a copy of the image
image = img.copy()
# Fill copy image with a blue-green-ish color
image[:] = (150, 150, 20)
# use the combined mask to color in upressured area's of the hand
res2 = cv2.bitwise_and(image,image, mask= mask_combined)
# Fill copy image with red color(set each pixel to red)
image[:] = (20, 20, 205)
# use the pressure mask to color in pressured area's
res = cv2.bitwise_and(image,image, mask= mask)
# combine colored images
final = dst = cv2.add(res2,res)
#show image
cv2.imshow("img", img)
cv2.imshow("result", final)
cv2.imshow("mask", mask)
cv2.imshow("mask2", mask_combined)
cv2.waitKey(0)
cv2.destroyAllWindows()


Note: I cropped the image you provided, if you have the full image the result may improve by tweaking the colorlimits and the morphology - read about it here






share|improve this answer


























  • i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

    – Smart
    Jan 4 at 10:23











  • I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

    – J.D.
    Jan 4 at 15:32













Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011116%2ffeet-pressure-points-for-pronation-detection-in-foot-scan-image%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














There is not enough color differences to do this easily. I tried by increasing contrast and converting to HSV colorspace (info - opencv), which makes selecting colors easier.



Result:



enter image description here



# load image
img = cv2.imread("hand.png")

#increase contrast
new_image = np.zeros(img.shape, img.dtype)
alpha = 4 # Simple contrast control
beta = -300 # Simple brightness control
for y in range(img.shape[0]):
for x in range(img.shape[1]):
for c in range(img.shape[2]):
new_image[y,x,c] = np.clip(alpha*img[y,x,c] + beta, 0, 255)

# convert to HSV
hsv = cv2.cvtColor(new_image, cv2.COLOR_BGR2HSV)
# set lower and upper color limits
lower_val = np.array([30,0,200])
upper_val = np.array([75,240,255])
# Threshold the HSV image
mask = cv2.inRange(hsv, lower_val, upper_val)
# remove noise
kernel = np.ones((3,3),np.uint8)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)

# select whole hand
# set lower and upper color limits
lower_val = np.array([0,0,100])
upper_val = np.array([179,255,255])
# Threshold the HSV image
mask2 = cv2.inRange(hsv, lower_val, upper_val)

# create a mask that has the whole hand, but not the prssure points
mask_combined = cv2.bitwise_xor(mask, mask2)
# Create a copy of the image
image = img.copy()
# Fill copy image with a blue-green-ish color
image[:] = (150, 150, 20)
# use the combined mask to color in upressured area's of the hand
res2 = cv2.bitwise_and(image,image, mask= mask_combined)
# Fill copy image with red color(set each pixel to red)
image[:] = (20, 20, 205)
# use the pressure mask to color in pressured area's
res = cv2.bitwise_and(image,image, mask= mask)
# combine colored images
final = dst = cv2.add(res2,res)
#show image
cv2.imshow("img", img)
cv2.imshow("result", final)
cv2.imshow("mask", mask)
cv2.imshow("mask2", mask_combined)
cv2.waitKey(0)
cv2.destroyAllWindows()


Note: I cropped the image you provided, if you have the full image the result may improve by tweaking the colorlimits and the morphology - read about it here






share|improve this answer


























  • i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

    – Smart
    Jan 4 at 10:23











  • I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

    – J.D.
    Jan 4 at 15:32


















0














There is not enough color differences to do this easily. I tried by increasing contrast and converting to HSV colorspace (info - opencv), which makes selecting colors easier.



Result:



enter image description here



# load image
img = cv2.imread("hand.png")

#increase contrast
new_image = np.zeros(img.shape, img.dtype)
alpha = 4 # Simple contrast control
beta = -300 # Simple brightness control
for y in range(img.shape[0]):
for x in range(img.shape[1]):
for c in range(img.shape[2]):
new_image[y,x,c] = np.clip(alpha*img[y,x,c] + beta, 0, 255)

# convert to HSV
hsv = cv2.cvtColor(new_image, cv2.COLOR_BGR2HSV)
# set lower and upper color limits
lower_val = np.array([30,0,200])
upper_val = np.array([75,240,255])
# Threshold the HSV image
mask = cv2.inRange(hsv, lower_val, upper_val)
# remove noise
kernel = np.ones((3,3),np.uint8)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)

# select whole hand
# set lower and upper color limits
lower_val = np.array([0,0,100])
upper_val = np.array([179,255,255])
# Threshold the HSV image
mask2 = cv2.inRange(hsv, lower_val, upper_val)

# create a mask that has the whole hand, but not the prssure points
mask_combined = cv2.bitwise_xor(mask, mask2)
# Create a copy of the image
image = img.copy()
# Fill copy image with a blue-green-ish color
image[:] = (150, 150, 20)
# use the combined mask to color in upressured area's of the hand
res2 = cv2.bitwise_and(image,image, mask= mask_combined)
# Fill copy image with red color(set each pixel to red)
image[:] = (20, 20, 205)
# use the pressure mask to color in pressured area's
res = cv2.bitwise_and(image,image, mask= mask)
# combine colored images
final = dst = cv2.add(res2,res)
#show image
cv2.imshow("img", img)
cv2.imshow("result", final)
cv2.imshow("mask", mask)
cv2.imshow("mask2", mask_combined)
cv2.waitKey(0)
cv2.destroyAllWindows()


Note: I cropped the image you provided, if you have the full image the result may improve by tweaking the colorlimits and the morphology - read about it here






share|improve this answer


























  • i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

    – Smart
    Jan 4 at 10:23











  • I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

    – J.D.
    Jan 4 at 15:32
















0












0








0







There is not enough color differences to do this easily. I tried by increasing contrast and converting to HSV colorspace (info - opencv), which makes selecting colors easier.



Result:



enter image description here



# load image
img = cv2.imread("hand.png")

#increase contrast
new_image = np.zeros(img.shape, img.dtype)
alpha = 4 # Simple contrast control
beta = -300 # Simple brightness control
for y in range(img.shape[0]):
for x in range(img.shape[1]):
for c in range(img.shape[2]):
new_image[y,x,c] = np.clip(alpha*img[y,x,c] + beta, 0, 255)

# convert to HSV
hsv = cv2.cvtColor(new_image, cv2.COLOR_BGR2HSV)
# set lower and upper color limits
lower_val = np.array([30,0,200])
upper_val = np.array([75,240,255])
# Threshold the HSV image
mask = cv2.inRange(hsv, lower_val, upper_val)
# remove noise
kernel = np.ones((3,3),np.uint8)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)

# select whole hand
# set lower and upper color limits
lower_val = np.array([0,0,100])
upper_val = np.array([179,255,255])
# Threshold the HSV image
mask2 = cv2.inRange(hsv, lower_val, upper_val)

# create a mask that has the whole hand, but not the prssure points
mask_combined = cv2.bitwise_xor(mask, mask2)
# Create a copy of the image
image = img.copy()
# Fill copy image with a blue-green-ish color
image[:] = (150, 150, 20)
# use the combined mask to color in upressured area's of the hand
res2 = cv2.bitwise_and(image,image, mask= mask_combined)
# Fill copy image with red color(set each pixel to red)
image[:] = (20, 20, 205)
# use the pressure mask to color in pressured area's
res = cv2.bitwise_and(image,image, mask= mask)
# combine colored images
final = dst = cv2.add(res2,res)
#show image
cv2.imshow("img", img)
cv2.imshow("result", final)
cv2.imshow("mask", mask)
cv2.imshow("mask2", mask_combined)
cv2.waitKey(0)
cv2.destroyAllWindows()


Note: I cropped the image you provided, if you have the full image the result may improve by tweaking the colorlimits and the morphology - read about it here






share|improve this answer















There is not enough color differences to do this easily. I tried by increasing contrast and converting to HSV colorspace (info - opencv), which makes selecting colors easier.



Result:



enter image description here



# load image
img = cv2.imread("hand.png")

#increase contrast
new_image = np.zeros(img.shape, img.dtype)
alpha = 4 # Simple contrast control
beta = -300 # Simple brightness control
for y in range(img.shape[0]):
for x in range(img.shape[1]):
for c in range(img.shape[2]):
new_image[y,x,c] = np.clip(alpha*img[y,x,c] + beta, 0, 255)

# convert to HSV
hsv = cv2.cvtColor(new_image, cv2.COLOR_BGR2HSV)
# set lower and upper color limits
lower_val = np.array([30,0,200])
upper_val = np.array([75,240,255])
# Threshold the HSV image
mask = cv2.inRange(hsv, lower_val, upper_val)
# remove noise
kernel = np.ones((3,3),np.uint8)
mask = cv2.morphologyEx(mask, cv2.MORPH_CLOSE, kernel)

# select whole hand
# set lower and upper color limits
lower_val = np.array([0,0,100])
upper_val = np.array([179,255,255])
# Threshold the HSV image
mask2 = cv2.inRange(hsv, lower_val, upper_val)

# create a mask that has the whole hand, but not the prssure points
mask_combined = cv2.bitwise_xor(mask, mask2)
# Create a copy of the image
image = img.copy()
# Fill copy image with a blue-green-ish color
image[:] = (150, 150, 20)
# use the combined mask to color in upressured area's of the hand
res2 = cv2.bitwise_and(image,image, mask= mask_combined)
# Fill copy image with red color(set each pixel to red)
image[:] = (20, 20, 205)
# use the pressure mask to color in pressured area's
res = cv2.bitwise_and(image,image, mask= mask)
# combine colored images
final = dst = cv2.add(res2,res)
#show image
cv2.imshow("img", img)
cv2.imshow("result", final)
cv2.imshow("mask", mask)
cv2.imshow("mask2", mask_combined)
cv2.waitKey(0)
cv2.destroyAllWindows()


Note: I cropped the image you provided, if you have the full image the result may improve by tweaking the colorlimits and the morphology - read about it here







share|improve this answer














share|improve this answer



share|improve this answer








edited Jan 4 at 15:29

























answered Jan 3 at 11:12









J.D.J.D.

1,232229




1,232229













  • i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

    – Smart
    Jan 4 at 10:23











  • I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

    – J.D.
    Jan 4 at 15:32





















  • i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

    – Smart
    Jan 4 at 10:23











  • I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

    – J.D.
    Jan 4 at 15:32



















i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

– Smart
Jan 4 at 10:23





i really appreciate that for your help and i got your point but i want to want the whole feet or in your case hand image result in the form of color threshold the solution you have provided is pointing pressure points but remaining hand is not visible i want it to be visible clearly and just color difference on pressure points as i attached and image in my question

– Smart
Jan 4 at 10:23













I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

– J.D.
Jan 4 at 15:32







I extended the code to also mask out the hand and create a colored final result. Its not very pretty, but it's about as good as I can make it, without spending excessive time. Hopefully you can improve on this yourself. Good luck!

– J.D.
Jan 4 at 15:32






















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011116%2ffeet-pressure-points-for-pronation-detection-in-foot-scan-image%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Angular Downloading a file using contenturl with Basic Authentication

Olmecas

Can't read property showImagePicker of undefined in react native iOS