How can I perform image preprocessing to a images ?
7 次查看(过去 30 天)
显示 更早的评论
Hello everyone,
I captured some images from camera. My final aim to identify the material composition from the images. However before that i need to perform some image calibration, noise removal, feature extraction , dimensionality reduction. can you please suggest some code or routine to the do these task?
Also after this task, i wanted to apply classification algorithm so it can detect the material from it
Can you guys tell me a way to do in the Matlab. Thanks a ton.
Dakota
回答(1 个)
Image Analyst
2021-4-2
You have to create a canvass large enough to contain them all, like say twice as tall and as many times wide as needed. Then figure out what line of the image contains the first brown line. Then paste that onto the same line in the canvass for all images. See my copy and paste example and adapt as needed.
30 个评论
Image Analyst
2021-4-2
Because your top line of the stripe is not in the same for for every image, you can't do stitching. You basically have to do pasting where you have a huge image and just paste each individual image onto the right place on the big canvass. Let's say you have 10 images and each one is like 480 rows by 640 columns. Then you could make a blank canvass of 1000 rows by 6400 columns. Now if the first image has the stripe at line 100, and you want all stripes to be at line 300, then paste the first image with an upper left corner at (400 - 100, 1). Now if the second image has its top stripe at line 120, you'd paste that image at (400 - 120, 513). So now that image will have it's top at line 280 and the stripe will also be at line 300 just like the first image. Then continue on like that for all images. Does that make sense? If you really can't figure it out or understand it let me know.
Image Analyst
2021-4-3
Then you have to correct for distortion first, before pasting onto the canvass (using the pasting algorithm I laid out). There is a function to correct for distortion in either the Image Processing Toolbox or the Computer Vision Toolbox.
Image Analyst
2021-4-3
Image Analyst
2021-4-3
编辑:Image Analyst
2021-4-3
I don't know how they should be stitched together horizontally. You have 7 stripes in some images and only 4 in others so it's not clear what is to be aligned with what. And even if you did paste the images onto a canvass, you're not going to have 7 stripes all the way across the image.
Image Analyst
2021-4-4
All of them have 10 stripes in the image. Your input images have only 4-7 stripes. Why don't you do this. Go into Photoshop or GIMP and make a huge image, at least 3 times as tall as your image and wide enough to contain all the image. Then read in each image, select the whole image, copy it, and go back to the canvass image and paste it on there. Then flatten the image and post it back here so I can see exactly where the 4 stripe images went to and the 7 stripe images went to.
Image Analyst
2021-4-6
Do you know which filenames correspond to which position? Like is it
1 2 3 4 5
6 7 8 9 10
or is it
1 3 5 7 9
2 4 6 8 10
Dakota Warner
2021-4-10
Image Analyst
2021-4-11
Sorry but I just don't have time to do this for you. It would take more than the usual 10-20 minutes I donate to people. Good luck though.
Kristen Chappel
2021-4-13
编辑:Kristen Chappel
2021-4-13
Hey Dakota, have you solved your problem. If yes then can you explain. @Image Analyst, @Prabhan Purwar Can you try it, because i have the similar problem. Also i do have calibration dot image, so you can use it for the set compensation and then again use it for the to correct the images? is it possible with matlab code to set the model so we can correct the image by using dot grid image. You can see the dot calibration image in the attachment.
Image Analyst
2021-4-13
@Kristen Chappel, I don't see the similarity. I don't see what you're asking. What is a calibration dot image? Start your own thread.
Kristen Chappel
2021-4-14
@Image Analyst, @Prabhan Purwar Calibratio dot image used to compensate the error. So this can be used to idetify the error and later correct the images according to this error. I do have calibration dot image, so you can use it for the set compensation and then again use it for the to correct the images? is it possible with matlab code to set the model and this model we can use it to correct the images.
Dakota Warner
2021-4-14
No i did not solve the problem yet. I think dot grid is good option to identify the error and set the model to correct the images later. But, i don't know how to do it
Devyani Sankhe
2021-4-14
I am very interested in this solution, if you solved then please share the code
Kristen Chappel
2021-4-14
Hi, i am struggling to solve this problem, If anyone having solution please do share with me@Image Analyst
Image Analyst
2021-4-15
I still don't see what Kristin's dots have to do with a sequence of many images of a partial set of stripes that drifts upwards.
Kristen Chappel
2021-4-15
Hi @Image Analyst, This dot grid image be can be use it for the calibrate and set the model to remove the issue of the error.
For example something like this but with the dot image instead of checkerboard
Link https://www.mathworks.com/help/vision/ref/undistortpoints.html
Image Analyst
2021-4-15
@Kristen Chappel, OK, so it's mildly related if Dakota needs to undistort her images. I haven't used the built-in distortion correction function. I'd have to learn it just like you will and you can probably do that just as well as I can.
Kristen Chappel
2021-4-15
@Image Analyst, Thanks but i am not expert in Matlab. I tried multiple times but didnot suceed. Can you please do it. Thanks in advance.
Dakota Warner
2021-4-15
Yes @Image Analyst, it will be good option if remove the distortion. Because after distortion all the images will stiched equally. Is it possible to develop code to perform this operation? Thanks a ton.
Dakota Warner
2021-4-17
@Image AnalystCan you please develop the code, because i am not able to find any kind of solution. I am trying but still don't know how to do it. Thank a ton
Image Analyst
2021-4-17
Like I said, I'm just never going to be able to carve out enough time in my busy schedule to donate enough to you to develop a turnkey solution for you. I still have to do my regular job 10-12 hours a day, mow the lawn, do my taxes, interact with family, etc. Sorry, but I know you can do it. You are smart enough and it would be a good way to learn MATLAB better.
Dakota Warner
2021-4-18
i tried but not able to solve. I don't know from where to start. Anyway i am sorry for asking your time. You always tried to help me, that is why i asked you.
Thanks
D. Warner
Dakota Warner
2021-4-21
can you please suggest me feature based stitching code atleast. This could be also useful.
Thanks a ton
D. Warner
Image Analyst
2021-4-21
Dakota Warner
2021-4-26
@Image Analyst, In the Panorama and Image Registration - MATLAB & Simulink, it gives option for the two images stitching only. May i know how to add multiple images for stitching?
Thanks a ton
D. Warner
Image Analyst
2021-4-26
I'd just do it one pair at a time. Do 1 & 2 to get a joined image. Then do the joined image and the third image, and so on.
Image Analyst
2021-4-26
Yes, it's probably better to just spend time to code up the algorithm I laid out.
另请参阅
标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
亚太
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)