void func(IplImage* test)
{
cvReleaseImage(&test);
test = cvLoadImage(...);
}
int main(void)
{
IplImage* ipl = cvCreateImage(...);
func(ipl);
}
이러고 함수 종료하면 에러남
둘 중에 머가 문제일까?
어쨌든 아래와 같이 수정하니깐 됨
void func(IplImage** test)
{
cvReleaseImage(test);
*test = cvLoadImage(...);
}
int main(void)
{
IplImage* ipl = cvCreateImage(...);
func(&ipl);
}
//IplImage* current
//func(¤t); 수행
-> current 6eaff0
¤t 26f918
//IplImage** param로 받음
->
param 26f918 -> IplImage* 변수 current의 주소
&(*param) 26f918 -> IplImage* 변수 current의 주소
¶m 26f670 -> IplImage** 변수 param의 주소
*param 6eaff0 ->IplImage* 변수 current가 가리키는 곳의 주소
//함수 내 release후
->
param 26f918 -> IplImage* 변수 current의 주소
&(*param) 26f918 -> IplImage* 변수 current의 주소
¶m 26f670 -> IplImage** 변수 param의 주소
*param 3928620 ->IplImage* 변수 current가 가리키는 곳의 주소
어쨌든 소스 자체는 잘못된게 없음
*로는 안되고 **는 안되는 이유는...어쨌든 cvloadimage할 때 문제인거 같다
이해가 안되긴 하지만...
'컴퓨터 과학 & 영상처리 관련 > OpenCV' 카테고리의 다른 글
OpenCV 동영상 파일 읽기, 코덱설정 (0) | 2014.11.17 |
---|---|
카메라 노출(exposure) 시간 (0) | 2013.09.02 |
fatal error c1189 #error windows.h already included. mfc apps must not #include windows.h (0) | 2013.07.15 |
faceRegion에 ROI 픽셀 그대로 복사하기 (1) | 2013.06.03 |
opencv 를 이용 웹캠 이미지 받아오기 (0) | 2013.01.14 |