how to store 2*2 multi images to create a single image of size 250*250?
조회 수: 1 (최근 30일)
이전 댓글 표시
Sir, I'm trying to implement a pixel level image fusion on a actel fpga board for that i have to cut 250x250 image into 2x2 images. I have used nested for loop. For 250x250 i'm getting proper fused image but for 2x2 after some iteration it is showing error saying "Matrix must be positive definite" . How to debug this error and also i'm facing problem while storing those images in a single 250x250 image.
My project code and images i have used are attached with this link
댓글 수: 0
채택된 답변
Mohammad Abouali
2014년 12월 12일
(1) you forgot the attachment
(2) instead of dividing your image into blocks using nested loops use im2col() function. That automatically retrieves the block in your image as columns so you get 4x16384 matrix where each column is one block of your image. Later you can use col2im to do the reverse, if needed.
댓글 수: 2
Mohammad Abouali
2014년 12월 12일
편집: Mohammad Abouali
2014년 12월 12일
there is also blockproc() functions that applies a function on blocks of image. You can run those block in parallel too. May be this one is more useful in your case.
It has this general form:
outputImage=blockproc(inputImage,[2 2], func);
where inputImage is your input image. You might need to combine your 4 bands into one image such as:
inputImage=cat(3,RedBand,GreenBand,BlueBand,NIRBand);
[2 2] is your block size so blocks of 2 pixel by 2pixel and func is the function handle to the procedure or computation that you want to be done on each block of the image.
To process the blocks in parallel do
outputImage=blockproc(inputImage,[2 2], func,'UseParallel',true);
You need to have parallel processing toolbox though; otherwise, it would run in serial mode.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!