Centering Multiple circular images
古いコメントを表示
I have multiple images of circular EHL contacts. I need to track the color change of each location within the contact. This is difficult as the contact moves slightly in the different images.
I have tried using the following code to center the images
EHL_image = imread('filename.bmp');
bwimage = rgb2gray(EHL_image);
bwimage(1:460,:) = 0;
BW = im2bw(bwimage,.4);
BWout = imfill(BW,'holes');
[Center, Rad, metric] = imfindcircles(BWout,[100 150],'Method','twostage');
After this process, matlab produces a post-processed image and a predicted circle as seen in the figure "Post_process." I cut the upper portion of the image off as I have found removing the distortion caused by the wake improves imfindcircles accuracy. As seen in the image Post process, the imfindcircles function does not center the circle over the contact well and it greatly varies from image to image.
I need some way to create some type of reference point within the contact such that I can associate the RGB values at different pixel locations with the same location within the contact. This is difficult as all parts of the contact undergo color change as the speed is increased between images.
I have attached two original images of the EHL contact at different speeds. Any creative ideas would be greatly appreciated.
採用された回答
その他の回答 (1 件)
Image Analyst
2018 年 2 月 16 日
編集済み: Image Analyst
2018 年 2 月 17 日
Try the attached script. It finds the circular region, finds the centroid of the region, finds the mean R, G, and B intensities in the circular mask region, and returns all the pixel values in the mask for each color channel.
You'll see:
The diameter = 268.39 pixels.
Mean Red Intensity = 123.18
Mean Green Intensity = 75.18
Mean Blue Intensity = 176.13
The Centroid is at x=445.903224, y=507.938276.

If you want to compare the very same pixels in different images (which, if analyzed separately might have slightly differently shaped masks) then you can just compute the mask once, and translate it, with imtranslate(), over each image to the centroid of that particular image. That way the mask is the same shape for all images. Though I still don't know exactly how you want to compare the colors: if it's the overall mean (seems okay), or if you want to somehow compare the R, G, and B values of each of the 56574 pixels in the mask (seems weird to me).
Does this work for you?
2 件のコメント
morri295
2018 年 2 月 19 日
Image Analyst
2018 年 2 月 19 日
You can use bwareaopen() instead of bwareafilt() in many cases.
カテゴリ
ヘルプ センター および File Exchange で Descriptive Statistics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
