How to measure the diameter(Width) of the joint automatically

5 views (last 30 days)
Hello all,
  1 Comment
Image Analyst
Image Analyst on 7 Mar 2016
Original question:
Hello all,
I'm working on the segmentation and boundary detection of the hand joints and for image analysis, i want to measure the each joint width and as i'm new in image processing, i tried to use some width measurements including Imtool which it is totally manual and it is not correct, because of the human error.
Attached is some sample use image both RGB and BW image for measuring the joint and still every time i'm getting new results because of the selecting the wrong points of the joint(manually).
I also tried to use a Euclidean distance formula to calculate the exact size to make sure about it by clicking on the pixel, but it is not giving me the unique results, because each time coincidentally, i'm selecting the different pixel with the different x and y value.
It would be good if the measurements can done on the black and white image, because there is only two color is include, black and white and it helps my calculation to be fast and easy.
I would appreciate you all if you help me to measure the hand joint width automatically (or any good solution) to accelerate my calculation and also increases the accuracy of results.
Thank you very much for reading and answering my question. I really appreciate your time.
Fred

Sign in to comment.

Answers (2)

John BG
John BG on 3 Feb 2016
Edited: John BG on 4 Feb 2016
the BW contour does not seem to be all you need to automate the process you have in mind.
the human hand has 4 kinds of articulations [https://en.wikipedia.org/wiki/Hand]:
1. interphalangeal articulations of hand (the hinge joints between the bones of the digits)
2. metacarpophalangeal joints (where the digits meet the palm)
3. intercarpal articulations (where the palm meets the wrist)
4. wrist (may also be viewed as belonging to the forearm)
Correct if wrong but you are only interested to automate detection of interphalangeal articulations.
BW contour is useful to find fingers from knuckles to tips with the following:
A=imread('BWcontour.jpg')
% convention: thumb=1 .. twinkle=5
A(A<10)=40 % lift a bit black to grey, to see mouse cross
imshow(A)
tip1=ginput(1);
knuckle1=ginput(1)
tip2=ginput(1);
knuckle2=ginput(1)
tip3=ginput(1);
knuckle3=ginput(1)
tip4=ginput(1);
knuckle4=ginput(1)
tip5=ginput(1);
knuckle5=ginput(1)
finger1=[tip1; knuckle1]
finger2=[tip2; knuckle2]
finger3=[tip3; knuckle3]
finger4=[tip4; knuckle4]
finger5=[tip5; knuckle5]
hold all
f1=line(finger1(:,1),finger1(:,2)) % this already plots no need for plot(f1.XData,f1.YData) plot(f1) returns error
f2=line(finger2(:,1),finger2(:,2))
f3=line(finger3(:,1),finger3(:,2))
f4=line(finger4(:,1),finger4(:,2))
f5=line(finger5(:,1),finger5(:,2))
obtaining:
.
I have couple Nikon cameras, and they came with a CD including really useful image processing software, one of them called Capture NX-D
that allows you to perform image gamma corrections. Look at the bottom left corner of the following screen shot:
the straight diagonal gamma curve of this image is the default that shows null gamma correction. There are in fact 3 diagonals that when uncorrected look like a single line. When modifying it, Capture NDX allows to manually pull left to right modifying RGB composition as follows:
. for instance this one,
because now the joints show with enough contrast. Rather-whites and rather-blacks are easier to detect that compared having to locate a specific RGB combination.
On the previous image invert RGB, in MATLAB you can invert pulling 0 or near 0 pixels up to 255, and bringing close to 255 pixels down to 0. I chose to invert colors with Paintbrush, or it can be done with same Capture NDX application. Manually inverting colours in MATLAB is a bit tricky, without the image processing toolbox I mean, because if you don't choose the right thresholds, then the contour suffers ringing.
. Now let's repeat the drawing of lines along fingers. Here on I do it manually and for finger 2 only to save time. Automating the spotting of finger tips and knuckles is not difficult.
Starting over, click the end point, finger tip FIRST.
camroll(90)
axis normal
A=imread('gamma5.jpg')
A(A<10)=40
figure(1);imshow(A)
A1=A(:,:,1)
A2=A(:,:,2)
A3=A(:,:,3)
[tip2x,tip2y]=ginput(1) % click tip(end point) first
[knuckle2x,knuckle2y]=ginput(1)
the points along the reference line are
xx100p=floor(linspace(knuckle2x,tip2x,100))
yy100p=floor(linspace(knuckle2y,tip2y,100))
hold all
figure(1);plot(xx100p,yy100p,'go')
and the values of the image along these points are
A1_line10p=zeros(1,10)
A2_line10p=zeros(1,10)
A3_line10p=zeros(1,10)
for k=1:1:10
A1_line10p(k)=A1(yy10p(k),xx10p(k))
A2_line10p(k)=A2(yy10p(k),xx10p(k))
A3_line10p(k)=A3(yy10p(k),xx10p(k))
end
figure(2);plot([1:1:length(A1_line10p)],A1_line10p)
hold all
figure(2);plot([1:1:length(A1_line10p)],A2_line10p)
hold all
figure(2);plot([1:1:length(A1_line10p)],A3_line10p)
hold all
grid on
If instead of 100 points, only 10 had taken, there would be a loss of resolution, peak values might not even reach above 100, that seems to be a clear value to tell you have an interphalangeal articulation.
You can easily such point manually moving the cursor along the reference line:
-images showing cursor along reference line-
You can also try to visualize the standard deviation and variance of the .JPEG RGB values, std and var:
Adouble=double(A)
surf(std(Adouble,0,3))
surf(var(Adouble,0,3))
var:
Note that I have added a visual reference on low left corners. Such reference may simplify acquiring finger tips, knuckles, as well as making sure that between BW image and gamma modified/Luminance inverted images coordinates do match.
Hope it helps
John

John BG
John BG on 4 Feb 2016
Dear Mr G Bilgin,
the straight answer would be: X-ray the hand, find where the bone joints exactly are, and measure the diameter on each joint. X-raying hands requires professionals with licence, and there is H&S constrains to X-ray dose on subjects.
Since you have not supplied X-ray images, I understand you want to measure the diameters just with skin photos, and there is where your question needs an statistical approach.
My initial answer uses finger skin corrugations to tell where the joints underneath you are after are located, but in the photo sample hand there 3 clear marks for each spotted phalanx. Yet consider the following:
  • some people may show 4, or 2 grooves, not 3.
  • Young hands may show no marks at all.
  • Black skin reflects less light than white skin.
  • hairy hands
  • scarred fingers
  • tatooed fingers
  • missing fingers due to for instance work/traffic accident or hand belonging to a gang that requires twinkle self mutilation
  • specks
  • sun tan ring marks
If you are aiming at producing an application that people may want to pay moneys for, you may want to speak to security and medical experts who work with wide databases, they will probably charge you but you will have access to the broadest possible 'spectrum' of hands to validate your application before being confident to claim you have an application that 'generically' measures finger 'joints' diameters.
The NIKON application I mentioned is one of many out there, but what you probably want is to write your MATLAB script performing the Gamma correction and everything else with no other 3rd party help than a really broad database of hands to test your application works before trying it on cases you don't know in advance.
Note that the lower lighting of the back of the thumb in the supplied photo showed a cluttered thumb that would make it more difficult to spot the grooves that easily show up as peaks in all other fingers.
There may be security standards for anatomy metering already in the market, with technical standards that you may want to read. Correctly lighting the hand, and showing a standard coordinate reference may help on such direction.
Thanks for your thumbs up
John
  1 Comment
fred grahambel
fred grahambel on 6 Feb 2016
Dear John,
Thank you for your comments and your helps. I really appreciate it.
My goal is just to measure the hand joint for the course project and im not going to develop and sell the application.
I have used some image processing techniques (Canny, thresholding, gradient) as a boundary detection for the project, and my goal is to measure the joint width of the segmented hand and compare to the size obtained from the RGB image as a ground truth to see how boundary detection method perfectly extracted the edges and then calculate the error. Currently i'm measuring the joint (width) size by using the x and y value of the pixel in the image and then by using the Euclidean distance formula, i'm calculating the size, which it takes too much time and it has a human error. Please let me know if you can help me.
Thanks Fred

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!