필터 지우기
필터 지우기

how to flip a segmented image along the major axis

조회 수: 13 (최근 30일)
narayana reddy
narayana reddy 2016년 2월 7일
댓글: Image Analyst 2018년 3월 21일
I and my friends are doing project on skin cancer detection using image processing, We completed upto segmentation, now we have to find area of non overlapped region of the segmented image.For this we have to flip the image along its major axis andminor axis. so please help us in this matter.
Advance thanks.
  댓글 수: 2
James Morris
James Morris 2018년 3월 19일
편집: James Morris 2018년 3월 19일
Hi, I have used (and slightly edited) your code to rotate and center my own skin lesions, but I am now struggling on being able to fold it along the X axis, and calculate the difference between the 2 overlapping areas. I need to show the overlapping regions in an image, furthermore I need to also be able sum the differences of the overlapping area, as this data needs to go into a classifier. I have linked my image of what I have so far, and also my code. Any guidance on how to solve my issue will be greatly appreciated. Thanks.
Image Analyst
Image Analyst 2018년 3월 19일
See my answer below Just sum the images if you need a pixel count:
sum1 = sum(overlapped(:));
sum2 = sum(nonOverlapped(:));

댓글을 달려면 로그인하십시오.

답변 (4개)

Image Analyst
Image Analyst 2017년 2월 26일
I gave you the initial part of the code already but it appears you need more help so here's some more. See attached m-file below the image. I don't know how you got a very high value for the orientation - I get 14 degrees. The only remaining part you asked for is " we have to flip the image along its major axis" and for that you can use flipud(rotatedImage) - very simple.
  댓글 수: 29
Hannah Gabrielle Alagon
Hannah Gabrielle Alagon 2017년 10월 23일
Hello. can someone help on how to do this image below.
Image Analyst
Image Analyst 2017년 10월 23일
I don't know what help you need beyond the code that I attached. Be more specific.

댓글을 달려면 로그인하십시오.


Image Analyst
Image Analyst 2016년 2월 7일
편집: Image Analyst 2016년 2월 7일
First align the image so that the major axis is horizontal (or vertical) with imrotate(). Then use imtranslate() to put the center line at the center of the image. Then use flipud (or fliplr) and AND or XOR them together
rotatedBinary = imrotate(binaryImage, angle);
rotatedBinary = imtranslate(rotatedBinary,.....
flipped = flipud(rotatedBinary);
overlapped = flipped & rotatedBinary;
nonOverlapped = xor(flipped, rotatedBinary);
I'm hoping you can find the angle yourself (it comes from Orientation in regionprops), and can find the amount of lines to translate it (it also comes from Centroid in regionprops)
  댓글 수: 4
narayana reddy
narayana reddy 2016년 2월 26일
Orientation which is obtained by regionprops is very high, with this value the image is not looking straight. please help me
anastasia
anastasia 2017년 2월 26일
how to find the major axis initially and then align it using imtranslate()? Please help with the initial part of the code.

댓글을 달려면 로그인하십시오.


sandeep kumar
sandeep kumar 2017년 11월 25일
편집: sandeep kumar 2017년 11월 25일
Image Analyst I implemented your code testGrayimage.m but iam not able to get a proper segmented image iam attaching below the images, in fig.(1) the inner blob is suppose to be the lesion area but it is selecting the outerleft arc please help ..
  댓글 수: 4
sandeep kumar
sandeep kumar 2017년 11월 26일
편집: sandeep kumar 2017년 11월 26일
sir images vary in sizes some are bigger some are smaller some has intense blob while in some images their is a very less difference between lesion and skin intensity. sir is there any way that out of all the regions in the binaryImage it could only select a region which is may be say circular or elliptical in shape like in above fig can we select only the inner blob and also in the fig attached
Image Analyst
Image Analyst 2017년 11월 26일
Yes, you can do background division with the / symbol, but you'd need a snapshot of a totally uniform image, like I said. Divide the background image by the max value to get a "percentage image", then divide your sample image by the percentage image and rescale. I'm attaching a demo of a different background correction method.
Why don't you just call imclearborder to get rid of blobs touching the border? It just treats the symptom, not the cause, but I don't think you're skilled enough yet to do a proper background correction.

댓글을 달려면 로그인하십시오.


James Morris
James Morris 2018년 3월 21일
Hi image analyst, from the matlab file you posted, you rotated and calculated the area difference along the x axis. I was just wondering if you could show and explain how to do it along the Y axis too?

Community Treasure Hunt

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

Start Hunting!

Translated by