i have two images,and have a function which requires 3x3 sliding window data from both image A and image B. Is there a way to get it done with blockpro function. Any hint would be useful.
I dont see to pass block from Image B. The only way i could think of is to stack image A and image B and write code to get each part in the function myFilter.
Your explanation is not clear. Why not just do blockproc on A and then do it on B? That would satisfy "a function which requires 3x3 sliding window data from both image A and image B". If you want something different, then say what is to be done at each block location to A and B.
its because the result of the function depends on both 3x3 blocks of both image A and image B. I finally managed to get around with combining images like cat)3, imageA, imageB). then using blockproc with combine image. In the functin i have extracted imageA and imageB part to proceed with further processing. thx.
Sounds sort of complicated. What type of image are A and B? If they're color then you have 6 color channels on the cat'ed array, if they're grayscale, then you have 2. Usually image processing works with 1 or 3 color channels, not 2 or 6, so I'd be careful that it's doing what you expect. Why would you not do it like I said where you do it on A and then do it on B and then combine the results? That seems much more straightforward and less risky.
% This is the tricky part. Here, all of im2 gets 'snapshot'ed inthe function handle, so its available inside myfun when called via funcHandle inside blockproc (!).
hi , i never knew ther is location properties. cheers. But i just combine mz images and extract part of imageA and imageB in my function handle for blockproc. thx.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
0 Comments
Sign in to comment.